Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Details ¶
type Details json.RawMessage
func (Details) MarshalJSON ¶
MarshalJSON - casts Details to []byte
func (*Details) UnmarshalJSON ¶
UnmarshalJSON - casts data to Details
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) 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 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 RelationCollection ¶
func (RelationCollection) MarshalJSON ¶
func (r RelationCollection) MarshalJSON() ([]byte, error)
type ResourceType ¶
type ResourceType string
const ( MODULES ResourceType = "modules" USER ResourceType = "user" )
List of ResourceType
type User ¶
type User struct { Key Attributes UserAttributes `json:"attributes"` }
type UserAttributes ¶
type UserAttributes struct { // timestamp without timezone when user was created CreatedAt time.Time `json:"created_at"` // email from module Email *string `json:"email,omitempty"` // module name Module []string `json:"module"` // user id from module ModuleId string `json:"module_id"` // name from module Name *string `json:"name,omitempty"` // phone from module Phone *string `json:"phone,omitempty"` // submodule where user 'comes from' Submodule []string `json:"submodule"` // username from module Username *string `json:"username,omitempty"` }