Documentation ¶
Index ¶
- Variables
- type CacheNamespace
- type CacheService
- type Memo
- type MemoCreate
- type MemoDelete
- type MemoFind
- type MemoOrganizer
- type MemoOrganizerFind
- type MemoOrganizerUpsert
- type MemoPatch
- type Resource
- type ResourceCreate
- type ResourceDelete
- type ResourceFind
- type Role
- type RowStatus
- type Shortcut
- type ShortcutCreate
- type ShortcutDelete
- type ShortcutFind
- type ShortcutPatch
- type Signin
- type Signup
- type SystemStatus
- type User
- type UserCreate
- type UserDelete
- type UserFind
- type UserPatch
- type UserSetting
- type UserSettingFind
- type UserSettingKey
- type UserSettingUpsert
- type Visibility
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UserSettingLocaleValue = []string{"en", "zh"} UserSettingMemoVisibilityValue = []Visibility{Privite, Protected, Public} UserSettingEditorFontStyleValue = []string{"normal", "mono"} )
Functions ¶
This section is empty.
Types ¶
type CacheNamespace ¶ added in v0.4.0
type CacheNamespace string
CacheNamespace is the type of a cache.
const ( // UserCache is the cache type of users. UserCache CacheNamespace = "u" // MemoCache is the cache type of memos. MemoCache CacheNamespace = "m" // ShortcutCache is the cache type of shortcuts. ShortcutCache CacheNamespace = "s" // ResourceCache is the cache type of resources. ResourceCache CacheNamespace = "r" )
type CacheService ¶ added in v0.4.0
type CacheService interface { FindCache(namespace CacheNamespace, id int, entry interface{}) (bool, error) UpsertCache(namespace CacheNamespace, id int, entry interface{}) error DeleteCache(namespace CacheNamespace, id int) }
CacheService is the service for caches.
type Memo ¶
type Memo struct { ID int `json:"id"` // Standard fields RowStatus RowStatus `json:"rowStatus"` CreatorID int `json:"creatorId"` CreatedTs int64 `json:"createdTs"` UpdatedTs int64 `json:"updatedTs"` // Domain specific fields Content string `json:"content"` Visibility Visibility `json:"visibility"` Pinned bool `json:"pinned"` // Related fields Creator *User `json:"creator"` }
type MemoCreate ¶
type MemoCreate struct { // Standard fields CreatorID int // Domain specific fields Visibility Visibility `json:"visibility"` Content string `json:"content"` }
type MemoDelete ¶
type MemoDelete struct {
ID int `json:"id"`
}
type MemoOrganizer ¶
type MemoOrganizerFind ¶
type MemoOrganizerUpsert ¶
type MemoPatch ¶
type MemoPatch struct { ID int // Standard fields CreatedTs *int64 `json:"createdTs"` RowStatus *RowStatus `json:"rowStatus"` // Domain specific fields Content *string `json:"content"` Visibility *Visibility `json:"visibility"` }
type ResourceCreate ¶
type ResourceDelete ¶
type ResourceFind ¶
type ShortcutCreate ¶
type ShortcutDelete ¶
type ShortcutDelete struct {
ID int
}
type ShortcutFind ¶
type ShortcutPatch ¶
type SystemStatus ¶
type User ¶
type User struct { ID int `json:"id"` // Standard fields RowStatus RowStatus `json:"rowStatus"` CreatedTs int64 `json:"createdTs"` UpdatedTs int64 `json:"updatedTs"` // Domain specific fields Email string `json:"email"` Role Role `json:"role"` Name string `json:"name"` PasswordHash string `json:"-"` OpenID string `json:"openId"` UserSettingList []*UserSetting `json:"userSettingList"` }
type UserCreate ¶
type UserCreate struct { // Domain specific fields Email string `json:"email"` Role Role `json:"role"` Name string `json:"name"` Password string `json:"password"` PasswordHash string OpenID string }
func (UserCreate) Validate ¶ added in v0.4.1
func (create UserCreate) Validate() error
type UserDelete ¶ added in v0.3.0
type UserDelete struct {
ID int
}
type UserSetting ¶ added in v0.4.0
type UserSetting struct { UserID int Key UserSettingKey `json:"key"` // Value is a JSON string with basic value Value string `json:"value"` }
type UserSettingFind ¶ added in v0.4.0
type UserSettingFind struct { UserID int Key *UserSettingKey `json:"key"` }
type UserSettingKey ¶ added in v0.4.0
type UserSettingKey string
const ( // UserSettingLocaleKey is the key type for user locale. UserSettingLocaleKey UserSettingKey = "locale" // UserSettingMemoVisibilityKey is the key type for user preference memo default visibility. UserSettingMemoVisibilityKey UserSettingKey = "memoVisibility" // UserSettingEditorFontStyleKey is the key type for editor font style. UserSettingEditorFontStyleKey UserSettingKey = "editorFontStyle" )
func (UserSettingKey) String ¶ added in v0.4.0
func (key UserSettingKey) String() string
String returns the string format of UserSettingKey type.
type UserSettingUpsert ¶ added in v0.4.0
type UserSettingUpsert struct { UserID int Key UserSettingKey `json:"key"` Value string `json:"value"` }
func (UserSettingUpsert) Validate ¶ added in v0.4.1
func (upsert UserSettingUpsert) Validate() error
type Visibility ¶ added in v0.2.0
type Visibility string
Visibility is the type of a visibility.
const ( // Public is the PUBLIC visibility. Public Visibility = "PUBLIC" // Protected is the PROTECTED visibility. Protected Visibility = "PROTECTED" // Privite is the PRIVATE visibility. Privite Visibility = "PRIVATE" )
func (Visibility) String ¶ added in v0.2.0
func (e Visibility) String() string
Click to show internal directories.
Click to hide internal directories.