{"modulePath":"github.com/opencloud-eu/opencloud","version":"v1.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sync\n\n## Variables\n\n```go\nvar (\n\t// ParsingViperConfig addresses the fact that config parsing using Viper is not thread safe.\n\tParsingViperConfig sync.Mutex\n)\n```\n\n## Types\n\n```go\ntype Cache struct {\n\t// contains filtered or unexported fields\n}\n```\nCache is a barebones cache implementation.\n\n```go\nfunc NewCache(capacity int) Cache\n```\nNewCache returns a new instance of Cache.\n\n```go\nfunc (c *Cache) Delete(key string) bool\n```\nDelete removes an entry by given key\n\n```go\nfunc (c *Cache) Load(key string) *CacheEntry\n```\nLoad loads an entry by given key\n\n```go\nfunc (c *Cache) Store(key string, val interface{}, expiration time.Time)\n```\nStore adds an entry for given key and value\n\n```go\ntype CacheEntry struct {\n\tV interface{}\n\t// contains filtered or unexported fields\n}\n```\nCacheEntry represents an entry on the cache. You can type assert on V.\n\n```go\ntype NamedRWMutex struct {\n\t// contains filtered or unexported fields\n}\n```\nNamedRWMutex works the same as RWMutex, the only difference is that it stores mutexes in a map and reuses them. It's handy if you want to write-lock, write-unlock, read-lock and read-unlock for specific names only.\n\n```go\nfunc NewNamedRWMutex() NamedRWMutex\n```\nNewNamedRWMutex returns a new instance of NamedRWMutex.\n\n```go\nfunc (m *NamedRWMutex) Lock(name string)\n```\nLock locks rw for writing.\n\n```go\nfunc (m *NamedRWMutex) RLock(name string)\n```\nRLock locks rw for reading.\n\n```go\nfunc (m *NamedRWMutex) RUnlock(name string)\n```\nRUnlock undoes a single RLock call.\n\n```go\nfunc (m *NamedRWMutex) Unlock(name string)\n```\nUnlock unlocks rw for writing.\n\n","path":"github.com/opencloud-eu/opencloud/pkg/sync","name":"sync","synopsis":"","isRedistributable":true}
