Documentation
¶
Index ¶
- func IsMethod(method string) bool
- type Context
- type Cookie
- func (c Cookie) Domain(domain string) Cookie
- func (c Cookie) Expires(expires time.Time) Cookie
- func (c Cookie) HttpOnly(httpOnly bool) Cookie
- func (c Cookie) MaxAge(maxAge time.Duration) Cookie
- func (c Cookie) Name() string
- func (c Cookie) Path(path string) Cookie
- func (c Cookie) SameSite(sameSite SameSite) Cookie
- func (c Cookie) Secure(secure bool) Cookie
- func (c Cookie) ToHeader() string
- func (c Cookie) Value() string
- type FormData
- type Handler
- type Method
- type Request
- type Response
- type Route
- type Router
- type SameSite
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cookie ¶
type Cookie struct {
// contains filtered or unexported fields
}
Cookie represents a browser cookie
func CookiesFromHeader ¶
CookiesFromHeader gets the cookies from a Cookie header
type FormData ¶
type FormData struct { Values map[string]string Files map[string]struct { Filename string Data []byte } }
FormData is TODO
type Request ¶
type Request struct { Method Method // Version string Host string RequestURI string Headers map[string]string FormData FormData Cookies []Cookie Body []byte }
Request represents a HTTP request in a struct
func ParseRequest ¶
ParseRequest converts a []byte to a *Request if it is a valid HTTP request
type Server ¶
type Server struct { Router *http.Handler Listener *net.TCPListener ReadTimeout time.Duration WriteTimeout time.Duration // contains filtered or unexported fields }
func CreateServer ¶
CreateServer creates a *Server
func (*Server) ListenAndServe ¶
func (s *Server) ListenAndServe()
ListenAndServe listens for incoming connections, and passes them onto handle.
Click to show internal directories.
Click to hide internal directories.