{"modulePath":"github.com/coding/drone","version":"v0.4.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cache\n\n## Functions\n\n```go\nfunc Get(c context.Context, key string) (interface{}, error)\n```\n\n```go\nfunc GetPerms(c context.Context, user *model.User, owner, name string) (*model.Perm, error)\n```\nGetPerm returns the user permissions repositories from the cache associated with the current repository.\n\n```go\nfunc GetRepos(c context.Context, user *model.User) ([]*model.RepoLite, error)\n```\nGetRepos returns the list of user repositories from the cache associated with the current context.\n\n```go\nfunc Set(c context.Context, key string, value interface{}) error\n```\n\n```go\nfunc ToContext(c Setter, cache Cache)\n```\nToContext adds the Cache to this context if it supports the Setter interface.\n\n## Types\n\n```go\ntype Cache interface {\n\tGet(string) (interface{}, error)\n\tSet(string, interface{}) error\n}\n```\n\n```go\nfunc Default() Cache\n```\nDefault creates an in-memory cache with the default 30 minute expiration period.\n\n```go\nfunc FromContext(c context.Context) Cache\n```\nFromContext returns the Cache associated with this context.\n\n```go\nfunc NewTTL(t time.Duration) Cache\n```\nNewTTL returns an in-memory cache with the specified ttl expiration period.\n\n```go\ntype Setter interface {\n\tSet(string, interface{})\n}\n```\nSetter defines a context that enables setting values.\n\n","path":"github.com/coding/drone/cache","name":"cache","synopsis":"","isRedistributable":true}
