Documentation
¶
Index ¶
Constants ¶
This section is empty.
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"`
ItemsKeyID string `json:"items_key_id" msgpack:"items_key_id,omitempty"`
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 Session ¶ added in v0.6.0
type Session struct {
Base `msgpack:",inline" storm:"inline"`
ExpireAt time.Time `msgpack:"expire_at"`
UserID string `msgpack:"user_id" storm:"index"`
UserAgent string `msgpack:"user_agent"`
APIVersion string `msgpack:"api_version"`
AccessToken string `msgpack:"access_token" storm:"index"`
RefreshToken string `msgpack:"refresh_token"`
// Custom fields
Current bool `msgpack:"-"`
}
A Session represents a database record.
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,omitempty"`
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.
Click to show internal directories.
Click to hide internal directories.