Documentation ¶
Index ¶
- type CreateRequest
- type Details
- type EstimatedTime
- type EstimatedTimeAttributes
- type EstimatedTimeListResponse
- type EstimatedTimeResponse
- type Flag
- type Flagger
- type Flags
- type FromToUser
- type FromToUserAttributes
- type FromToUserListResponse
- type FromToUserResponse
- type GetRequest
- type Included
- func (c *Included) Add(includes ...Resource)
- func (c Included) MarshalJSON() ([]byte, error)
- func (c *Included) MustEstimatedTime(key Key) *EstimatedTime
- func (c *Included) MustFromToUser(key Key) *FromToUser
- func (c *Included) MustLink(key Key) *Link
- func (c *Included) MustModule(key Key) *Module
- func (c *Included) MustModuleInfo(key Key) *ModuleInfo
- func (c *Included) MustModulesRoles(key Key) *ModulesRoles
- func (c *Included) MustRefresh(key Key) *Refresh
- func (c *Included) MustRequest(key Key) *Request
- func (c *Included) MustRole(key Key) *Role
- func (c *Included) MustSubmodule(key Key) *Submodule
- func (c *Included) MustUser(key Key) *User
- func (c *Included) UnmarshalJSON(data []byte) error
- type Key
- type Link
- type LinkAttributes
- type LinkListResponse
- type LinkResponse
- type Links
- type Module
- type ModuleAttributes
- type ModuleInfo
- type ModuleInfoAttributes
- type ModuleInfoListResponse
- type ModuleInfoResponse
- type ModuleListResponse
- type ModuleResponse
- type ModulesRoles
- type ModulesRolesAttributes
- type ModulesRolesListResponse
- type ModulesRolesResponse
- type NewRequest
- type Refresh
- type RefreshAttributes
- type RefreshListResponse
- type RefreshResponse
- type Relation
- type RelationCollection
- type Request
- type RequestAttributes
- type RequestListResponse
- type RequestRelationships
- type RequestResponse
- type Resource
- type ResourceType
- type Role
- type RoleAttributes
- type RoleListResponse
- type RoleResponse
- type Submodule
- type SubmoduleAttributes
- type SubmoduleListResponse
- type SubmoduleResponse
- 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 CreateRequest ¶
type CreateRequest 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 Details ¶
type Details json.RawMessage
func (Details) MarshalJSON ¶
MarshalJSON - casts Details to []byte
func (*Details) UnmarshalJSON ¶
UnmarshalJSON - casts data to Details
type EstimatedTime ¶
type EstimatedTime struct { Key Attributes EstimatedTimeAttributes `json:"attributes"` }
type EstimatedTimeAttributes ¶
type EstimatedTimeAttributes struct {
EstimatedTime string `json:"estimated_time"`
}
type EstimatedTimeListResponse ¶
type EstimatedTimeListResponse struct { Data []EstimatedTime `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` }
type EstimatedTimeResponse ¶
type EstimatedTimeResponse struct { Data EstimatedTime `json:"data"` Included Included `json:"included"` }
type FromToUser ¶
type FromToUser struct { Key Attributes FromToUserAttributes `json:"attributes"` }
type FromToUserAttributes ¶
type FromToUserListResponse ¶
type FromToUserListResponse struct { Data []FromToUser `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` }
type FromToUserResponse ¶
type FromToUserResponse struct { Data FromToUser `json:"data"` Included Included `json:"included"` }
type GetRequest ¶
type GetRequest struct { // timestamp when request was created CreatedAt string `json:"created_at"` // Error during request processing Error *string `json:"error,omitempty"` // 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"` // Status of the request Status string `json:"status"` // user's id for who request was sent ToUser string `json:"to_user"` }
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) MustEstimatedTime ¶
func (c *Included) MustEstimatedTime(key Key) *EstimatedTime
MustEstimatedTime - returns EstimatedTime 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) MustFromToUser ¶
func (c *Included) MustFromToUser(key Key) *FromToUser
MustFromToUser - returns FromToUser 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) MustLink ¶
MustLink - returns Link 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) 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) MustModuleInfo ¶
func (c *Included) MustModuleInfo(key Key) *ModuleInfo
MustModuleInfo - returns ModuleInfo 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) MustModulesRoles ¶
func (c *Included) MustModulesRoles(key Key) *ModulesRoles
MustModulesRoles - returns ModulesRoles 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) MustRefresh ¶
MustRefresh - returns Refresh 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) MustRole ¶
MustRole - returns Role 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) MustSubmodule ¶
MustSubmodule - returns Submodule 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 Link ¶
type Link struct { Key Attributes LinkAttributes `json:"attributes"` }
type LinkAttributes ¶
type LinkListResponse ¶
type LinkResponse ¶
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 ModuleInfo ¶
type ModuleInfo struct { Key Attributes ModuleInfoAttributes `json:"attributes"` }
type ModuleInfoAttributes ¶
type ModuleInfoListResponse ¶
type ModuleInfoListResponse struct { Data []ModuleInfo `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` }
type ModuleInfoResponse ¶
type ModuleInfoResponse struct { Data ModuleInfo `json:"data"` Included Included `json:"included"` }
type ModuleListResponse ¶
type ModuleResponse ¶
type ModulesRoles ¶
type ModulesRoles struct { Key Attributes ModulesRolesAttributes `json:"attributes"` }
type ModulesRolesAttributes ¶
type ModulesRolesAttributes struct { }
type ModulesRolesListResponse ¶
type ModulesRolesListResponse struct { Data []ModulesRoles `json:"data"` Included Included `json:"included"` Links *Links `json:"links"` }
type ModulesRolesResponse ¶
type ModulesRolesResponse struct { Data ModulesRoles `json:"data"` Included Included `json:"included"` }
type NewRequest ¶
type NewRequest struct { // Module to grant permission Module string `json:"module"` // Already built payload to grant permission Payload json.RawMessage `json:"payload"` }
type Refresh ¶
type Refresh struct { Key Attributes RefreshAttributes `json:"attributes"` }
type RefreshAttributes ¶
type RefreshListResponse ¶
type RefreshResponse ¶
type RelationCollection ¶
func (RelationCollection) MarshalJSON ¶
func (r RelationCollection) MarshalJSON() ([]byte, error)
type Request ¶
type Request struct { Key Attributes RequestAttributes `json:"attributes"` Relationships RequestRelationships `json:"relationships"` }
type RequestAttributes ¶
type RequestAttributes 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"` // timestamp when request was created CreatedAt string `json:"created_at"` // Error during request processing Error *string `json:"error,omitempty"` // Status of the request Status string `json:"status"` }
type RequestListResponse ¶
type RequestRelationships ¶
type RequestRelationships struct {
User Relation `json:"user"`
}
type RequestResponse ¶
type ResourceType ¶
type ResourceType string
const ( ESTIMATED_TIME ResourceType = "estimated_time" LINKS ResourceType = "links" MODULES ResourceType = "modules" REFRESH ResourceType = "refresh" REQUESTS ResourceType = "requests" ROLE ResourceType = "role" USERS ResourceType = "users" )
List of ResourceType
type Role ¶
type Role struct { Key Attributes RoleAttributes `json:"attributes"` }
type RoleAttributes ¶
type RoleListResponse ¶
type RoleResponse ¶
type Submodule ¶
type Submodule struct { Key Attributes SubmoduleAttributes `json:"attributes"` }
type SubmoduleAttributes ¶
type SubmoduleAttributes struct {
Links []string `json:"links"`
}
type SubmoduleListResponse ¶
type SubmoduleResponse ¶
type User ¶
type User struct { Key Attributes UserAttributes `json:"attributes"` }
type UserAttributes ¶
type UserAttributes struct { // submodule access level AccessLevel string `json:"access_level"` // module name Module string `json:"module"` // phone from module Phone *string `json:"phone,omitempty"` // submodule name Submodule string `json:"submodule"` // user id from identity module UserId int64 `json:"user_id"` // username from module Username *string `json:"username,omitempty"` }
type UserListResponse ¶
type UserResponse ¶
Source Files ¶
- db.go
- flag.go
- included.go
- model_create_request.go
- model_details.go
- model_estimated_time.go
- model_estimated_time_attributes.go
- model_from_to_user.go
- model_from_to_user_attributes.go
- model_get_request.go
- model_key.go
- model_link.go
- model_link_attributes.go
- model_links.go
- model_module.go
- model_module_attributes.go
- model_module_info.go
- model_module_info_attributes.go
- model_modules_roles.go
- model_modules_roles_attributes.go
- model_new_request.go
- model_refresh.go
- model_refresh_attributes.go
- model_relation.go
- model_relation_collection.go
- model_request.go
- model_request_attributes.go
- model_request_relationships.go
- model_resource_type.go
- model_role.go
- model_role_attributes.go
- model_submodule.go
- model_submodule_attributes.go
- model_user.go
- model_user_attributes.go