feat: init project

This commit is contained in:
Steven
2022-09-11 16:38:06 +08:00
commit 5f48be3b7a
48 changed files with 4585 additions and 0 deletions

20
api/cache.go Normal file
View File

@ -0,0 +1,20 @@
package api
// CacheNamespace is the type of a cache.
type CacheNamespace string
const (
// UserCache is the cache type of workspaces.
WorkspaceCache CacheNamespace = "w"
// UserCache is the cache type of users.
UserCache CacheNamespace = "u"
// ShortcutCache is the cache type of shortcuts.
ShortcutCache CacheNamespace = "s"
)
// CacheService is the service for caches.
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)
}