Documentation
¶
Index ¶
- Variables
- type Model
- type NewUser
- type Post
- func (m *Post) AddToManyIDs(name string, IDs []string) error
- func (m *Post) DeleteToManyIDs(name string, IDs []string) error
- func (m Post) GetID() string
- func (m Post) GetReferencedIDs() []jsonapi.ReferenceID
- func (m Post) GetReferencedStructs() []jsonapi.MarshalIdentifier
- func (m Post) GetReferences() []jsonapi.Reference
- func (m *Post) SetID(id string) error
- func (m *Post) SetToManyReferenceIDs(name string, IDs []string) error
- func (m Post) SetToOneReferenceID(name, ID string) error
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *sqlx.DB
Functions ¶
This section is empty.
Types ¶
type Post ¶
type Post struct { ID int64 `json:"-"` CreatedAt time.Time `json:"created-at" db:"created_at"` UpdatedAt time.Time `json:"updated-at" db:"updated_at"` Title string `json:"title" db:"title"` Excerpt string `json:"excerpt" db:"excerpt"` Content string `json:"content" db:"content"` Permalink string `json:"permalink" db:"permalink"` User *User `json:"-"` UserId string `json:"-" db:"user_id"` }
func (*Post) AddToManyIDs ¶
AddToManyIDs adds some new sweets that a users loves so much
func (*Post) DeleteToManyIDs ¶
DeleteToManyIDs removes some sweets from a users because they made him very sick
func (Post) GetReferencedIDs ¶
func (m Post) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (Post) GetReferencedStructs ¶
func (m Post) GetReferencedStructs() []jsonapi.MarshalIdentifier
GetReferencedStructs to satisfy the jsonapi.MarhsalIncludedRelations interface
func (Post) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface
func (*Post) SetToManyReferenceIDs ¶
SetToManyReferenceIDs sets the sweets reference IDs and satisfies the jsonapi.UnmarshalToManyRelations interface
func (Post) SetToOneReferenceID ¶
type User ¶
type User struct { ID int64 `json:"-"` CreatedAt time.Time `json:"created-at" db:"created_at"` UpdatedAt time.Time `json:"updated-at" db:"updated_at"` Username string `json:"username"` Email string `json:"email"` PasswordHash string `json:"-" db:"password_hash"` }
func (User) GetReferencedIDs ¶
func (m User) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (User) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface
Click to show internal directories.
Click to hide internal directories.