Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCacheMiss = errors.New("lets proxy: certificate cache miss")
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
// Get returns a certificate data for the specified key.
// If there's no such key, Get returns ErrCacheMiss.
Get(ctx context.Context, key string) ([]byte, error)
// Put stores the data in the cache under the specified key.
// Underlying implementations may use any data storage format,
// as long as the reverse operation, Get, results in the original data.
Put(ctx context.Context, key string, data []byte) error
// Delete removes a certificate data from the cache under the specified key.
// If there's no such key in the cache, Delete returns nil.
Delete(ctx context.Context, key string) error
}
type MemoryCache ¶
type MemoryCache struct {
Name string // use for log
// contains filtered or unexported fields
}
func NewMemoryCache ¶
func NewMemoryCache(name string) *MemoryCache
func (*MemoryCache) Delete ¶
func (c *MemoryCache) Delete(ctx context.Context, key string) (err error)
type MemoryValueLRU ¶
type MemoryValueLRU struct {
// Must not change concurrency with usage
Name string // use for log
MaxSize int
CleanCount int
// contains filtered or unexported fields
}
func NewMemoryValueLRU ¶
func NewMemoryValueLRU(name string) *MemoryValueLRU
func (*MemoryValueLRU) Delete ¶
func (c *MemoryValueLRU) Delete(ctx context.Context, key string) (err error)
type Value ¶
type Value interface {
// Get returns a certificate data for the specified key.
// If there's no such key, Get returns ErrCacheMiss.
Get(ctx context.Context, key string) (interface{}, error)
// Put stores the data in the cache under the specified key.
// Underlying implementations may use any data storage format,
// as long as the reverse operation, Get, results in the original data.
Put(ctx context.Context, key string, value interface{}) error
// Delete removes a certificate data from the cache under the specified key.
// If there's no such key in the cache, Delete returns nil.
Delete(ctx context.Context, key string) error
}
Click to show internal directories.
Click to hide internal directories.