Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //存储库返回的错误 ErrRepoNextID = errors.New("tab: could not return next id") ErrRepoList = errors.New("tab: could not list") ErrNotFound = errors.New("tab: could not find") ErrRepoGet = errors.New("tab: could not get") ErrRepoAdd = errors.New("tab: could not add") ErrRepoRemove = errors.New("tab: could not remove") )
View Source
var ( // 给出无效标题时使用的错误 ErrInvalidTitle = errors.New("tab: could not use invalid title") ErrTitleTooShort = fmt.Errorf("%s: min length allowed is %d", ErrInvalidTitle, minTitleLength) ErrTitleTooLong = fmt.Errorf("%s: max length allowed is %d", ErrInvalidTitle, maxTitleLength) )
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo interface {
//NextID 返回下一个空闲 ID 并在失败时返回错误
NextID() (ID, error)
// 列表返回一个选项卡切片并在失败的情况下返回一个错误
List() ([]*Tab, error)
// Find 返回一个 tab 或者 nil ,如果它没有找到并且在失败的情况下,则返回一个错误
Find(ID) (*Tab, error)
// 如果未找到或失败,则获取返回选项卡和错误
Get(ID) (*Tab, error)
// 添加持久化选项卡(已经存在或不存在)并在失败时返回错误
Add(*Tab) error
// 删除选项卡并返回并在未找到或失败的情况下出错
Remove(ID) error
}
Click to show internal directories.
Click to hide internal directories.