Documentation
¶
Overview ¶
Package api contains functions and data for a functional permissions-api server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MaxPaginationSize represents the maximum number of records that can be returned per page MaxPaginationSize = 1000 // DefaultPaginationSize represents the default number of records that are returned per page DefaultPaginationSize = 100 )
View Source
var ( // ErrNoActionDefined is the error returned when an access request is has no action defined ErrNoActionDefined = errors.New("no action defined") // ErrAccessDenied is returned when access is denied ErrAccessDenied = errors.New("access denied") )
View Source
var ( // ErrResourceNotFound is returned when the requested resource isn't found ErrResourceNotFound = errors.New("resource not found") // ErrSearchNotFound is returned when the requested search term isn't found ErrSearchNotFound = errors.New("search term not found") // ErrResourceAlreadyExists is returned when the resource already exists ErrResourceAlreadyExists = errors.New("resource already exists") )
Functions ¶
This section is empty.
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` }
ErrorResponse represents the data that the server will return on any given call
type Option ¶ added in v0.2.0
Option defines a router option function.
func WithCheckConcurrency ¶ added in v0.2.0
WithCheckConcurrency sets the check concurrency for bulk permission checks.
func WithLogger ¶ added in v0.2.0
func WithLogger(logger *zap.SugaredLogger) Option
WithLogger sets the logger for the router.
type Pagination ¶
Pagination allow you to paginate the results
func ParsePagination ¶
func ParsePagination(c echo.Context) *Pagination
ParsePagination parses the pagination query parameters from the echo context
func (*Pagination) SetHeaders ¶
func (p *Pagination) SetHeaders(c echo.Context, count int)
SetHeaders sets the pagination headers on a response
Click to show internal directories.
Click to hide internal directories.