Documentation ¶
Index ¶
- type Chocolate
- type User
- func (u *User) AddToManyIDs(name string, IDs []string) error
- func (u *User) DeleteToManyIDs(name string, IDs []string) error
- func (s User) GetAttributes() map[string]interface{}
- func (u User) GetID() string
- func (u User) GetReferencedIDs() []jsonapi.ReferenceID
- func (u User) GetReferencedStructs() []jsonapi.MarshalIdentifier
- func (u User) GetReferences() []jsonapi.Reference
- func (u *User) SetID(id string) error
- func (u *User) SetToManyReferenceIDs(name string, IDs []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chocolate ¶
type Chocolate struct { ID string `json:"-"` Name string `json:"name"` Taste string `json:"taste"` }
Chocolate is the chocolate that a user consumes in order to get fat and happy
func (Chocolate) GetAttributes ¶
type User ¶
type User struct { ID string `json:"-"` //rename the username field to user-name. Username string `json:"user-name"` PasswordHash string `json:"-"` Chocolates []*Chocolate `json:"-"` ChocolatesIDs []string `json:"-"` // contains filtered or unexported fields }
User is a generic database user
func (*User) AddToManyIDs ¶
AddToManyIDs adds some new sweets that a users loves so much
func (*User) DeleteToManyIDs ¶
DeleteToManyIDs removes some sweets from a users because they made him very sick
func (User) GetAttributes ¶
func (User) GetReferencedIDs ¶
func (u User) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (User) GetReferencedStructs ¶
func (u User) GetReferencedStructs() []jsonapi.MarshalIdentifier
GetReferencedStructs to satisfy the jsonapi.MarhsalIncludedRelations interface
func (User) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface
Click to show internal directories.
Click to hide internal directories.