Documentation ¶
Index ¶
- func Delete(c context.Context, key string) error
- func DeleteRepos(c context.Context, user *model.User) error
- func Get(c context.Context, key string) (interface{}, error)
- func GetPerms(c context.Context, user *model.User, owner, name string) (*model.Perm, error)
- func GetRepoMap(c context.Context, user *model.User) (map[string]bool, error)
- func GetRepos(c context.Context, user *model.User) ([]*model.RepoLite, error)
- func GetTeamPerms(c context.Context, user *model.User, org string) (*model.Perm, error)
- func Set(c context.Context, key string, value interface{}) error
- func ToContext(c Setter, cache Cache)
- type Cache
- type Setter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteRepos ¶ added in v0.5.0
DeleteRepos evicts the cached user repositories from the cache associated with the current context.
func GetPerms ¶
GetPerms returns the user permissions repositories from the cache associated with the current repository.
func GetRepoMap ¶ added in v0.5.0
GetRepoMap returns the list of user repositories from the cache associated with the current context in a map structure.
func GetRepos ¶
GetRepos returns the list of user repositories from the cache associated with the current context.
func GetTeamPerms ¶ added in v0.5.0
GetTeamPerms returns the user permissions from the cache associated with the current organization.
Types ¶
type Cache ¶
type Cache interface { Get(string) (interface{}, error) Set(string, interface{}) error Delete(string) error }
func Default ¶
func Default() Cache
Default creates an in-memory cache with the default 30 minute expiration period.
func FromContext ¶
FromContext returns the Cache associated with this context.