Documentation ¶
Index ¶
- Constants
- type AccessController
- func (ac *AccessController) Add(aclMap *domain.ACLMap)
- func (ac *AccessController) AddHandler(action string, handler domain.ACLHandlerFunc)
- func (ac *AccessController) HasAction(action string) bool
- func (ac *AccessController) IsHTTPRequestAuthorized(req *http.Request, ctx domain.IContext, action string, user domain.IUser) (bool, string)
- func (ac *AccessController) NewContextHandler(action string, next http.HandlerFunc) http.HandlerFunc
- type Config
- type ErrorResponse
- type Options
- type Router
- type Server
- func (s *Server) Run(address string, options Options) *Server
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) *Server
- func (s *Server) Stop()
- func (s *Server) UseContextMiddleware(middleware domain.IContextMiddleware) *Server
- func (s *Server) UseMiddleware(middleware domain.IMiddleware) *Server
- func (s *Server) UseRouter(router *Router) *Server
Constants ¶
View Source
const BodyLimitBytes uint32 = 1048576 * 5
Request JSON body limit is set at 5MB (currently not enforced)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessController ¶
implements IAccessController
func NewAccessController ¶
func NewAccessController(ctx domain.IContext, renderer domain.IRenderer) *AccessController
TODO: Currently, AccessController only acts as a gateway for endpoints on router level. Build AC to handler other aspects of ACL
func (*AccessController) Add ¶
func (ac *AccessController) Add(aclMap *domain.ACLMap)
func (*AccessController) AddHandler ¶
func (ac *AccessController) AddHandler(action string, handler domain.ACLHandlerFunc)
func (*AccessController) HasAction ¶
func (ac *AccessController) HasAction(action string) bool
func (*AccessController) IsHTTPRequestAuthorized ¶
func (*AccessController) NewContextHandler ¶
func (ac *AccessController) NewContextHandler(action string, next http.HandlerFunc) http.HandlerFunc
type ErrorResponse ¶
type Router ¶
Router type
func NewRouter ¶
func NewRouter(ctx domain.IContext, ac domain.IAccessController) *Router
NewRouter Returns a new Router object
func (*Router) AddResources ¶
type Server ¶
Server type
func (*Server) UseContextMiddleware ¶
func (s *Server) UseContextMiddleware(middleware domain.IContextMiddleware) *Server
func (*Server) UseMiddleware ¶
func (s *Server) UseMiddleware(middleware domain.IMiddleware) *Server
Click to show internal directories.
Click to hide internal directories.