Documentation ¶
Overview ¶
Package api contains commonly used constants and functions for the HTTP endpoints.
Index ¶
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" IdentityKey = "identity" GroupKey = "group" ActionKey = "action" TagKey = "tag" NameKey = "name" TotalKey = "total" SubjectKey = "subject" ObjectKey = "object" LevelKey = "level" TreeKey = "tree" DirKey = "dir" ListPerms = "list_perms" VisibilityKey = "visibility" TokenKey = "token" DefPermission = "view" DefTotal = uint64(100) DefOffset = 0 DefOrder = "updated_at" DefDir = "asc" DefLimit = 10 DefLevel = 0 DefStatus = "enabled" DefClientStatus = mgclients.Enabled DefGroupStatus = mgclients.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 NameOrder = "name" IDOrder = "id" AscDir = "asc" DescDir = "desc" )
Variables ¶
This section is empty.
Functions ¶
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.