Documentation
¶
Index ¶
Constants ¶
View Source
const ( HeaderCorrelationID = "X-Correlation-ID" HeaderRequestID = "X-Request-ID" )
View Source
const ( DefaultTake = 20 MaxTake = 100 )
View Source
const HeaderUser = "X-User"
Variables ¶
View Source
var ErrNoUser = errors.New("no user in request")
Functions ¶
Types ¶
type APIError ¶
type APIError struct {
Status int
Envelope ErrorEnvelope
Body string
}
func (*APIError) Unauthorized ¶
type ErrorEnvelope ¶
type ErrorItem ¶
type ErrorItem struct {
Code string `json:"code"`
Message string `json:"message"`
CustomerActions []string `json:"customerActions,omitempty"`
SupportActions []string `json:"supportActions,omitempty"`
Fields []FieldError `json:"fields,omitempty"`
}
type FieldError ¶
type Page ¶
type PageRequest ¶
type PageRequest struct {
Take int `query:"take" json:"take,omitempty" validate:"omitempty,min=1,max=100"`
Skip int `query:"skip" json:"skip,omitempty" validate:"omitempty,min=0"`
}
func (PageRequest) Limit ¶
func (p PageRequest) Limit() int
func (PageRequest) Offset ¶
func (p PageRequest) Offset() int
type Timestamps ¶
type UUIDRequest ¶
type UUIDRequest struct {
ID string `path:"id" validate:"required,uuid"`
}
type User ¶
type User struct {
ID int64 `json:"id"`
Email string `json:"email,omitempty"`
Name string `json:"name,omitempty"`
Roles []string `json:"roles,omitempty"`
Features []string `json:"features,omitempty"`
Tenant string `json:"tenant,omitempty"`
Impersonator *int64 `json:"impersonator,omitempty"`
Claims map[string]string `json:"claims,omitempty"`
}
func (User) Impersonated ¶
Click to show internal directories.
Click to hide internal directories.