Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Version2 is the client version. Version2 = "002" // Version3 is the client version. Version3 = "003" // VersionLatest is the client version. VersionLatest = Version3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { ID string `json:"uuid" msgpack:"id" storm:"id"` CreatedAt *time.Time `json:"created_at" msgpack:"created_at" storm:"index"` UpdatedAt *time.Time `json:"updated_at" msgpack:"updated_at" storm:"index"` }
A Base contains the default model fields.
func (*Base) GetCreatedAt ¶
GetCreatedAt returns the model's creation date.
func (*Base) GetUpdatedAt ¶
GetUpdatedAt returns the model's last update date.
func (*Base) SetCreatedAt ¶
SetCreatedAt defines the model's creation date.
func (*Base) SetUpdatedAt ¶
SetUpdatedAt defines the model's last update date.
type Item ¶
type Item struct { Base `msgpack:",inline" storm:"inline"` UserID string `json:"user_uuid" msgpack:"user_id" storm:"index"` Content string `json:"content" msgpack:"content"` ContentType string `json:"content_type" msgpack:"content_type" storm:"index"` EncryptedItemKey string `json:"enc_item_key" msgpack:"enc_item_key"` Deleted bool `json:"deleted" msgpack:"deleted" storm:"index"` }
A Item represents a database record and the rendered API response.
type Model ¶
type Model interface { // GetID returns the model's ID. GetID() string // SetID defines the model's ID. SetID(string) // GetCreatedAt returns the model's creation date. GetCreatedAt() *time.Time // SetCreatedAt defines the model's creation date. SetCreatedAt(time.Time) // GetUpdatedAt returns the model's last update date. GetUpdatedAt() *time.Time // SetUpdatedAt defines the model's last update date. SetUpdatedAt(time.Time) }
A Model defines an object that can be stored in database.
type User ¶
type User struct { Base `msgpack:",inline" storm:"inline"` // Standardfile fields Email string `msgpack:"email" storm:"unique"` Password string `msgpack:"password,omitempty"` PasswordCost int `msgpack:"pw_cost"` PasswordNonce string `msgpack:"pw_nonce,omitempty"` PasswordAuth string `msgpack:"pw_auth,omitempty"` Version string `msgpack:"version"` // V2 flields compatibility PasswordSalt string `msgpack:"pw_salt,omitempty"` // Custom fields PasswordUpdatedAt int64 `msgpack:"password_updated_at"` }
A User represents a database record and the rendered API response.
Click to show internal directories.
Click to hide internal directories.