Documentation ¶
Index ¶
Constants ¶
View Source
const (
TypeImage = 1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID AccountID `json:"-"` Username string `json:"username,omitempty"` PasswordHash string `json:"-" db:"password_hash"` DisplayName *string `json:"display_name,omitempty" db:"display_name"` // URL to the avatar image Avatar *string `json:"avatar,omitempty"` // URL to the header image Header *string `json:"header,omitempty"` // Biography of user Note *string `json:"note,omitempty"` CreateAt DateTime `json:"create_at,omitempty" db:"create_at"` DeleteAt *DateTime `json:"-" db:"delete_at"` }
func (*Account) CheckPassword ¶
Check if given password is match to account's password
func (*Account) SetPassword ¶
Hash password and set it to account object
type DateTime ¶
Wrapper of time.Time to implement custom method for JSON/DB interface
func (*DateTime) MarshalJSON ¶
encoding/json/Marshaler
func (*DateTime) UnmarshalJSON ¶
encoding/json/Unmarshaler
type MediaAttachment ¶
type MediaAttachment struct { ID MediaAttachmentID `json:"-"` StatusID StatusID `json:"id" db:"status_id"` Type int64 `json:"-" db:"type"` URL string `json:"url,omitempty" db:"url"` Description string `json:"description,omitempty"` CreateAt DateTime `json:"create_at,omitempty" db:"create_at"` DeleteAt *DateTime `json:"-" db:"delete_at"` MediaType *string `json:"type,omitempty"` }
func (*MediaAttachment) SetMediaType ¶
func (m *MediaAttachment) SetMediaType()
type MediaAttachmentID ¶
type MediaAttachmentID = int64
type PasswordHash ¶
type PasswordHash = string
type Status ¶
type Status struct { ID StatusID `json:"id"` AccountID AccountID `json:"-" db:"account_id"` Content string `json:"content"` CreateAt DateTime `json:"create_at,omitempty" db:"create_at"` DeleteAt *DateTime `json:"-" db:"delete_at"` Account *Account `json:"account,omitempty"` MediaAttachment []*MediaAttachment `json:"media_attachments,omitempty"` }
Click to show internal directories.
Click to hide internal directories.