Documentation ¶
Index ¶
- type Details
- type Flag
- type Flagger
- type Flags
- type Included
- func (c *Included) Add(includes ...Resource)
- func (c Included) MarshalJSON() ([]byte, error)
- func (c *Included) MustModule(key Key) *Module
- func (c *Included) MustOrchestratorRequest(key Key) *OrchestratorRequest
- func (c *Included) MustRequest(key Key) *Request
- func (c *Included) MustUser(key Key) *User
- func (c *Included) UnmarshalJSON(data []byte) error
- type Key
- type Links
- type Module
- type ModuleAttributes
- type ModuleListResponse
- type ModuleResponse
- type MultipleAdding
- type OrchestratorRequest
- type OrchestratorRequestAttributes
- type OrchestratorRequestListResponse
- type OrchestratorRequestRelationships
- type OrchestratorRequestResponse
- type Relation
- type RelationCollection
- type Request
- type RequestAttributes
- type RequestListResponse
- type RequestResponse
- 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 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) MustOrchestratorRequest ¶
func (c *Included) MustOrchestratorRequest(key Key) *OrchestratorRequest
MustOrchestratorRequest - returns OrchestratorRequest 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) MustRequest ¶
MustRequest - returns Request 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 MultipleAdding ¶
type MultipleAdding struct { // access level for setting in module, depending on module it can be string or integer AccessLevel string `json:"access_level"` // user's id who send request FromUser string `json:"from_user"` // Submodule where to grant permission Link string `json:"link"` // Module to grant permission Module string `json:"module"` // user's id for who request was sent ToUser string `json:"to_user"` // List of users for whom we give permission Users []User `json:"users"` }
type OrchestratorRequest ¶
type OrchestratorRequest struct { Key Attributes OrchestratorRequestAttributes `json:"attributes"` Relationships OrchestratorRequestRelationships `json:"relationships"` }
type OrchestratorRequestAttributes ¶
type OrchestratorRequestAttributes struct { // user's id who send request FromUser string `json:"from_user"` // Module to grant permission Module string `json:"module"` // Already built payload to grant permission Payload json.RawMessage `json:"payload"` // user's id for who request was sent ToUser string `json:"to_user"` }
type OrchestratorRequestListResponse ¶
type OrchestratorRequestListResponse struct { Data []OrchestratorRequest `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` }
type OrchestratorRequestRelationships ¶
type OrchestratorRequestRelationships struct {
User Relation `json:"user"`
}
type OrchestratorRequestResponse ¶
type OrchestratorRequestResponse struct { Data OrchestratorRequest `json:"data"` Included Included `json:"included"` }
type RelationCollection ¶
func (RelationCollection) MarshalJSON ¶
func (r RelationCollection) MarshalJSON() ([]byte, error)
type Request ¶
type Request struct { Key Attributes RequestAttributes `json:"attributes"` }
type RequestAttributes ¶
type RequestAttributes struct { // access level for setting in module, depending on module it can be string or integer AccessLevel string `json:"access_level"` // user's id who send request FromUser string `json:"from_user"` // Submodule where to grant permission Link string `json:"link"` // Module to grant permission Module string `json:"module"` // user's id for who request was sent ToUser string `json:"to_user"` // List of users for whom we give permission Users []User `json:"users"` }
type RequestListResponse ¶
type RequestResponse ¶
type ResourceType ¶
type ResourceType string
const ( MODULES ResourceType = "modules" REQUESTS ResourceType = "requests" USERS ResourceType = "users" )
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_details.go
- model_key.go
- model_links.go
- model_module.go
- model_module_attributes.go
- model_multiple_adding.go
- model_orchestrator_request.go
- model_orchestrator_request_attributes.go
- model_orchestrator_request_relationships.go
- model_relation.go
- model_relation_collection.go
- model_request.go
- model_request_attributes.go
- model_resource_type.go
- model_user.go
- model_user_attributes.go