Documentation
¶
Overview ¶
Package api contains commonly used constants and functions for the HTTP endpoints.
Index ¶
- Constants
- func AuthenticateMiddleware(authn smqauthn.Authentication, domainCheck bool) func(http.Handler) http.Handler
- func EncodeError(_ context.Context, err error, w http.ResponseWriter)
- func EncodeResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
- func ValidateUUID(extID string) (err error)
Constants ¶
View Source
const ( MemberKindKey = "member_kind" PermissionKey = "permission" RelationKey = "relation" StatusKey = "status" OffsetKey = "offset" OrderKey = "order" LimitKey = "limit" MetadataKey = "metadata" ParentKey = "parent_id" OwnerKey = "owner_id" ClientKey = "client" UsernameKey = "username" NameKey = "name" GroupKey = "group" ActionKey = "action" ActionsKey = "actions" RoleIDKey = "role_id" RoleNameKey = "role_name" AccessTypeKey = "access_type" TagKey = "tag" FirstNameKey = "first_name" LastNameKey = "last_name" TotalKey = "total" SubjectKey = "subject" ObjectKey = "object" LevelKey = "level" StartLevelKey = "start_level" EndLevelKey = "end_level" TreeKey = "tree" DirKey = "dir" ListPerms = "list_perms" VisibilityKey = "visibility" EmailKey = "email" TokenKey = "token" UserKey = "user" DomainKey = "domain" ChannelKey = "channel" DefPermission = "read_permission" DefTotal = uint64(100) DefOffset = 0 DefOrder = "updated_at" DefDir = "asc" DefLimit = 10 DefLevel = 0 DefStartLevel = 1 DefEndLevel = 0 DefStatus = "enabled" DefClientStatus = clients.Enabled DefUserStatus = users.Enabled DefGroupStatus = groups.Enabled DefListPerms = false MyVisibility = "mine" AllVisibility = "all" // ContentType represents JSON content type. ContentType = "application/json" // MaxNameSize limits name size to prevent making them too complex. MaxLimitSize = 100 MaxNameSize = 1024 MaxIDSize = 36 NameOrder = "name" IDOrder = "id" AscDir = "asc" DescDir = "desc" )
View Source
const SessionKey = sessionKeyType("session")
Variables ¶
This section is empty.
Functions ¶
func AuthenticateMiddleware ¶
func EncodeError ¶
func EncodeError(_ context.Context, err error, w http.ResponseWriter)
EncodeError encodes an error response.
func EncodeResponse ¶
func EncodeResponse(_ context.Context, w http.ResponseWriter, response interface{}) error
EncodeResponse encodes successful response.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.