Documentation
¶
Index ¶
- type BadRequest
- type Details
- type Flag
- type Flagger
- type Flags
- type Forbidden
- type Included
- type InternalError
- type Key
- type Links
- type Module
- type ModuleAttributes
- type ModuleListResponse
- type ModuleResponse
- type NotFound
- type Positions
- type PositionsAttributes
- type PositionsListResponse
- type PositionsResponse
- type Relation
- type RelationCollection
- type Resource
- type ResourceType
- type User
- type UserAttributes
- type UserListResponse
- type UserResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadRequest ¶
type BadRequest struct {
// Application-specific error code, expressed as a string value
Code string `json:"code"`
// Human-readable explanation specific to this occurrence of the problem
Detail *string `json:"detail,omitempty"`
// Object containing non-standard meta-information about the error
Meta *map[string]interface{} `json:"meta,omitempty"`
// HTTP status code applicable to this problem
Status int32 `json:"status"`
// Short, human-readable summary of the problem
Title string `json:"title"`
}
type Details ¶
type Details json.RawMessage
func (Details) MarshalJSON ¶
MarshalJSON - casts Details to []byte
func (*Details) UnmarshalJSON ¶
UnmarshalJSON - casts data to Details
type Forbidden ¶
type Forbidden struct {
// Application-specific error code, expressed as a string value
Code string `json:"code"`
// Human-readable explanation specific to this occurrence of the problem
Detail *string `json:"detail,omitempty"`
// HTTP status code applicable to this problem
Status int32 `json:"status"`
// Short, human-readable summary of the problem
Title string `json:"title"`
}
type Included ¶
type Included struct {
// contains filtered or unexported fields
}
Included - an array of Resource objects that are related to the primary data and/or each other (“included resources”).
func (Included) MarshalJSON ¶
MarshalJSON - marshals include collection as array of json objects
func (*Included) MustModule ¶
MustModule - returns Module from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustPositions ¶
MustPositions - returns Positions from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) MustUser ¶
MustUser - returns User from include collection. if entry with specified key does not exist - returns nil if entry with specified key exists but type or ID mismatches - panics
func (*Included) UnmarshalJSON ¶
UmarshalJSON - unmarshal array of json objects into include collection
type InternalError ¶
type InternalError struct {
// Application-specific error code, expressed as a string value
Code string `json:"code"`
// Human-readable explanation specific to this occurrence of the problem
Detail *string `json:"detail,omitempty"`
// HTTP status code applicable to this problem
Status int32 `json:"status"`
// Short, human-readable summary of the problem
Title string `json:"title"`
}
type Key ¶
type Key struct {
ID string `json:"id"`
Type ResourceType `json:"type"`
}
func NewKeyInt64 ¶
func NewKeyInt64(id int64, resourceType ResourceType) Key
func (Key) AsRelation ¶
type Module ¶
type Module struct {
Key
Attributes ModuleAttributes `json:"attributes"`
}
type ModuleAttributes ¶
type ModuleAttributes struct {
// indicates whether module (gitlab, telegram etc.) or service (unverified, role etc.)
IsModule bool `json:"is_module"`
// Module url
Link string `json:"link"`
// Module name
Name string `json:"name"`
// Module prefix to use in FE
Prefix string `json:"prefix"`
// Module name to use in FE
Title string `json:"title"`
// Module topic for sender and others
Topic string `json:"topic"`
}
type ModuleListResponse ¶
type ModuleResponse ¶
type NotFound ¶
type NotFound struct {
// Application-specific error code, expressed as a string value
Code string `json:"code"`
// Human-readable explanation specific to this occurrence of the problem
Detail *string `json:"detail,omitempty"`
// HTTP status code applicable to this problem
Status int32 `json:"status"`
// Short, human-readable summary of the problem
Title string `json:"title"`
}
type Positions ¶
type Positions struct {
Key
Attributes PositionsAttributes `json:"attributes"`
}
type PositionsAttributes ¶
type PositionsAttributes struct {
Positions []string `json:"positions"`
}
type PositionsListResponse ¶
type PositionsResponse ¶
type RelationCollection ¶
func (RelationCollection) MarshalJSON ¶
func (r RelationCollection) MarshalJSON() ([]byte, error)
type ResourceType ¶
type ResourceType string
const ( MODULES ResourceType = "modules" POSITIONS ResourceType = "positions" USER ResourceType = "user" )
List of ResourceType
type User ¶
type User struct {
Key
Attributes UserAttributes `json:"attributes"`
}
type UserAttributes ¶
type UserListResponse ¶
type UserResponse ¶
Source Files
¶
- db.go
- flag.go
- included.go
- model_bad_request.go
- model_details.go
- model_forbidden.go
- model_internal_error.go
- model_key.go
- model_links.go
- model_module.go
- model_module_attributes.go
- model_not_found.go
- model_positions.go
- model_positions_attributes.go
- model_relation.go
- model_relation_collection.go
- model_resource_type.go
- model_user.go
- model_user_attributes.go