Documentation
¶
Index ¶
Constants ¶
View Source
const ( MaxSnippets = 100 MaxSnippetSize = 64 << 10 )
MaxSnippets and MaxSnippetSize keep the snippets of an account a small list.
View Source
const ( MaxSavedSearches = 100 MaxSavedSearchIDs = 50 )
MaxSavedSearches and MaxSavedSearchIDs keep the saved searches of an account a small list, each with a short enough set of tags/folders that a WHERE ... IN (?) stays cheap.
View Source
const MaxRetentionDays = 3650
MaxRetentionDays keeps the trash retention a sane number of days, ten years.
Variables ¶
View Source
var ( ErrInvalidLocale = errors.New("unknown locale") ErrInvalidTheme = errors.New("unknown theme") ErrInvalidColorMode = errors.New("unknown color mode") ErrInvalidView = errors.New("unknown view") ErrInvalidPlan = errors.New("unknown plan") ErrInvalidRetention = fmt.Errorf("the trash retention is between 0 and %d days", MaxRetentionDays) ErrInvalidNeighbors = errors.New("unknown limit of neighbors") ErrInvalidAvatar = errors.New("the avatar is not an image of the account") ErrInvalidSnippet = fmt.Errorf("a snippet needs a name, at most %d of them of %d bytes each", MaxSnippets, MaxSnippetSize) ErrInvalidSavedSearch = fmt.Errorf("a saved search needs a name and a known tag/folder mode, at most %d of them", MaxSavedSearches) ErrInvalidSidebar = errors.New("the sidebar sections are known lists, each at most once") )
Functions ¶
Types ¶
type Input ¶
type Input struct {
Locale *string `json:"locale,omitempty" binding:"optional"`
Theme *string `json:"theme,omitempty" binding:"optional"`
ColorMode *string `json:"color_mode,omitempty" binding:"optional"`
View *string `json:"view,omitempty" binding:"optional"`
Plan *string `json:"plan,omitempty" binding:"optional"`
TrashRetentionDays *int `json:"trash_retention_days,omitempty" binding:"optional"`
NeighborsLimit *int `json:"neighbors_limit,omitempty" binding:"optional"` // one of domain.NeighborsLimits
Name *string `json:"name,omitempty" binding:"optional"`
Avatar *string `json:"avatar,omitempty" binding:"optional"` // the id of an image of the account, "" for none
Snippets *[]domain.Snippet `json:"snippets,omitempty" binding:"optional"` // the whole list, it replaces the saved one
SavedSearches *[]domain.SavedSearch `json:"saved_searches,omitempty" binding:"optional"` // the whole list, it replaces the saved one
SidebarSections *[]domain.SidebarSection `json:"sidebar_sections,omitempty" binding:"optional"` // the whole list, in order
}
Input holds the settings to change: a nil one is kept.
Click to show internal directories.
Click to hide internal directories.