{"modulePath":"github.com/ARM-software/embedded-development-services-client-utils/utils","version":"v1.20.2","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cache\n\nPackage cache defines utilities for caching data or state.\n\n## Constants\n\n```go\nconst (\n\t// Apply caching wherever possible\n\tApply = iota\n\t// NoCache directive does not prevent the storing of data but instead prevents the reuse of data without revalidation\n\tNoCache\n\t// NoStore directive ensures there is no caching performed at all\n\tNoStore\n)\n```\n\n## Types\n\n```go\ntype Control int\n```\n\n```go\ntype IServerCache interface {\n\t// SetCacheControl specifies the caching behaviour.\n\tSetCacheControl(control Control) error\n\t// GetCacheControl returns the caching behaviour followed.\n\tGetCacheControl() Control\n\t// SetKey sets  an explicit key for restoring and saving the cache\n\tSetKey(key string) error\n\t// GetKey returns  an explicit key for restoring a cache\n\tGetKey() string\n\t// Invalidate invalidates all cache entries.\n\tInvalidate(ctx context.Context) error\n}\n```\nIServerCache defines a caching mechanism server-side.\n\n```go\nfunc NewServiceCache() IServerCache\n```\nNewServiceCache creates a service cache.\n\n```go\ntype ServiceCache struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (c *ServiceCache) GetCacheControl() Control\n```\n\n```go\nfunc (c *ServiceCache) GetKey() string\n```\n\n```go\nfunc (c *ServiceCache) Invalidate(context.Context) error\n```\n\n```go\nfunc (c *ServiceCache) SetCacheControl(control Control) error\n```\n\n```go\nfunc (c *ServiceCache) SetKey(key string) (err error)\n```\n\n","path":"github.com/ARM-software/embedded-development-services-client-utils/utils/cache","name":"cache","synopsis":"Package cache defines utilities for caching data or state.","isRedistributable":true}
