Documentation ¶
Index ¶
- type Cache
- type FileSystemCache
- func (c *FileSystemCache) Clone() Cache
- func (c *FileSystemCache) Get(key ...string) ([]byte, error)
- func (c *FileSystemCache) GetJSON(o interface{}, key ...string) error
- func (c *FileSystemCache) Prefix(p ...string) Cache
- func (c *FileSystemCache) Set(data []byte, expire time.Duration, key ...string) error
- func (c *FileSystemCache) SetJSON(o interface{}, expire time.Duration, key ...string) error
- type Noop
- func (c *Noop) Clone() Cache
- func (c *Noop) Get(key ...string) ([]byte, error)
- func (c *Noop) GetJSON(o interface{}, key ...string) error
- func (c *Noop) Prefix(p ...string) Cache
- func (c *Noop) Set(data []byte, expire time.Duration, key ...string) error
- func (c *Noop) SetJSON(o interface{}, expire time.Duration, key ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Get(key ...string) ([]byte, error) Set(data []byte, expire time.Duration, key ...string) error SetJSON(o interface{}, expire time.Duration, key ...string) error GetJSON(o interface{}, key ...string) error Clone() Cache Prefix(key ...string) Cache }
Cache defines the interface to implement to handle acme results caching
type FileSystemCache ¶
type FileSystemCache struct {
// contains filtered or unexported fields
}
FileSystemCache is a cache that writes the content to the file system
func NewFileSystemCache ¶
func NewFileSystemCache(path string) *FileSystemCache
NewFileSystemCache instanciates a cache backed on the file system
func (*FileSystemCache) Clone ¶
func (c *FileSystemCache) Clone() Cache
Clone creates a copy of the cache accessor. With the same prefix the cloned copy will operate the same way as the original
func (*FileSystemCache) Get ¶
func (c *FileSystemCache) Get(key ...string) ([]byte, error)
Get retrieves a cached value for a given key. It returns an error if the key is either expired or does not exist
func (*FileSystemCache) GetJSON ¶
func (c *FileSystemCache) GetJSON(o interface{}, key ...string) error
GetJSON retrieves a cached value for a given key and decodes it from json. It returns an error if the key is either expired or does not exist
func (*FileSystemCache) Prefix ¶
func (c *FileSystemCache) Prefix(p ...string) Cache
Prefix adds a common prefix to all cache access
type Noop ¶
type Noop struct{}
func (*Noop) Clone ¶
Clone creates a copy of the cache accessor. With the same prefix the cloned copy will operate the same way as the original
func (*Noop) Get ¶
Get retrieves a cached value for a given key. It returns an error if the key is either expired or does not exist
func (*Noop) GetJSON ¶
GetJSON retrieves a cached value for a given key and decodes it from json. It returns an error if the key is either expired or does not exist