Documentation
¶
Index ¶
- type AuthToken
- type AuthTokenAttributes
- type AuthTokenListResponse
- type AuthTokenResponse
- type Details
- type Flag
- type Flagger
- type Flags
- type Included
- type Key
- type Links
- type Login
- type LoginAttributes
- type LoginListResponse
- type LoginResponse
- type Refresh
- type RefreshAttributes
- type RefreshListResponse
- type RefreshResponse
- type Relation
- type RelationCollection
- type Resource
- type ResourceType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthToken ¶
type AuthToken struct { Key Attributes AuthTokenAttributes `json:"attributes"` }
type AuthTokenAttributes ¶
type AuthTokenAttributes struct {
Access string `json:"access"`
}
type AuthTokenListResponse ¶
type AuthTokenResponse ¶
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) MustAuthToken ¶
MustAuthToken - returns AuthToken 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) MustLogin ¶
MustLogin - returns Login 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) 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 Login ¶
type Login struct { Key Attributes LoginAttributes `json:"attributes"` }
type LoginAttributes ¶
type LoginListResponse ¶
type LoginResponse ¶
type Refresh ¶
type Refresh struct { Key Attributes RefreshAttributes `json:"attributes"` }
type RefreshAttributes ¶
type RefreshAttributes struct {
Token string `json:"token"`
}
type RefreshListResponse ¶
type RefreshResponse ¶
type RelationCollection ¶
func (RelationCollection) MarshalJSON ¶
func (r RelationCollection) MarshalJSON() ([]byte, error)
type ResourceType ¶
type ResourceType string
const ( AUTH_TOKEN ResourceType = "auth_token" LOGIN ResourceType = "login" REFRESH ResourceType = "refresh" )
List of ResourceType