Documentation
¶
Index ¶
- type API
- func (api *API) GetPermissionsBundleHandler(w http.ResponseWriter, req *http.Request)
- func (api *API) GetPolicyHandler(writer http.ResponseWriter, request *http.Request)
- func (api *API) GetRoleHandler(w http.ResponseWriter, req *http.Request)
- func (api *API) GetRolesHandler(w http.ResponseWriter, req *http.Request)
- func (api *API) PostPolicyHandler(writer http.ResponseWriter, request *http.Request)
- type PermissionsBundler
- type PermissionsStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API provides a struct to wrap the api around
func Setup ¶
func Setup( cfg *config.Config, r *mux.Router, permissionsStore PermissionsStore, bundler PermissionsBundler) *API
Setup function sets up the api and returns an api
func (*API) GetPermissionsBundleHandler ¶ added in v0.5.0
func (api *API) GetPermissionsBundleHandler(w http.ResponseWriter, req *http.Request)
GetPermissionsBundleHandler gets and returns the permissions bundle as JSON in the HTTP response body.
func (*API) GetPolicyHandler ¶ added in v0.5.0
func (api *API) GetPolicyHandler(writer http.ResponseWriter, request *http.Request)
GetPolicyHandler is a handler that gets policy by its ID from DB
func (*API) GetRoleHandler ¶ added in v0.3.0
func (api *API) GetRoleHandler(w http.ResponseWriter, req *http.Request)
GetRoleHandler is a handler that gets a role by its ID from MongoDB
func (*API) GetRolesHandler ¶ added in v0.4.0
func (api *API) GetRolesHandler(w http.ResponseWriter, req *http.Request)
GetRolesHandler is a handler that gets all roles from MongoDB
func (*API) PostPolicyHandler ¶ added in v0.5.0
func (api *API) PostPolicyHandler(writer http.ResponseWriter, request *http.Request)
PostPolicyHandler is a handler that creates a new policies in DB
type PermissionsBundler ¶ added in v0.5.0
PermissionsBundler defines the functions used by the API to get permissions bundles
type PermissionsStore ¶ added in v0.3.0
type PermissionsStore interface { Checker(ctx context.Context, state *healthcheck.CheckState) error Close(ctx context.Context) error GetRole(ctx context.Context, id string) (*models.Role, error) GetRoles(ctx context.Context, offset, limit int) (*models.Roles, error) AddPolicy(ctx context.Context, policy *models.Policy) (*models.Policy, error) GetPolicy(ctx context.Context, id string) (*models.Policy, error) }
PermissionsStore defines the behaviour of a PermissionsStore
Click to show internal directories.
Click to hide internal directories.