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 (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 ¶
Chocolate is the chocolate that a user consumes in order to get fat and happy
type User ¶
type User struct { ID int64 `json:"-"` //rename the username field to user-name. Username string `json:"user-name"` PasswordHash string `json:"-"` Chocolates []Chocolate `json:"-" gorm:"many2many:user_chocolates"` ChocolatesIDs []string `json:"-" sql:"-"` // 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) 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.