Documentation ¶
Index ¶
- Constants
- Variables
- type AuthProvider
- type Config
- type Notification
- type Request
- func (r *Request) Empty(param string) bool
- func (r *Request) Get(param string) string
- func (r *Request) GetCookie(name string) string
- func (r *Request) Json(value interface{}) error
- func (r *Request) Response() *Response
- func (r *Request) Route(path string) string
- func (r *Request) Session(name string) (*Session, error)
- func (r *Request) SetCookie(name string, value string, duration time.Duration)
- type Response
- func (r *Response) Error(code int, message string, params ...interface{}) *Response
- func (r *Response) ErrorJson(code int, data interface{}) *Response
- func (r *Response) File(path string) *Response
- func (r *Response) Json(data interface{}) *Response
- func (r *Response) Plain(data string, params ...interface{}) *Response
- func (r *Response) Redirect(code int, url string) *Response
- func (r *Response) SetCode(code int) *Response
- func (r *Response) SetHeader(key string, value string) *Response
- type Route
- type Server
- func (s *Server) Delete(route string, handler func(*Request) *Response, authentication AuthProvider) error
- func (s *Server) Get(route string, handler func(*Request) *Response, authentication AuthProvider) error
- func (s *Server) Handle(w http.ResponseWriter, req *http.Request)
- func (s *Server) Listen() error
- func (s *Server) Notifications() <-chan *Notification
- func (s *Server) Post(route string, handler func(*Request) *Response, authentication AuthProvider) error
- func (s *Server) Put(route string, handler func(*Request) *Response, authentication AuthProvider) error
- func (s *Server) UseSessionStore(store sessions.Store)
- type Session
Constants ¶
View Source
const ( TEXT string = "TEXT_RESPONSE" FILE string = "FILE_RESPONSE" REDIRECT string = "REDIRECT_RESPONSE" )
View Source
const ( GET string = "GET" POST string = "POST" PUT string = "PUT" DELETE string = "DELETE" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AuthProvider ¶
type Config ¶
type Notification ¶
type Request ¶
type Response ¶
type Response struct { Code int Body string Duration time.Duration // contains filtered or unexported fields }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Notifications ¶
func (s *Server) Notifications() <-chan *Notification
func (*Server) UseSessionStore ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.