Documentation
¶
Index ¶
- Constants
- Variables
- func Close(c Cache) error
- func Evictions(c Cache) int64
- func GetJSON[T any](ctx context.Context, c Cache, key string) (T, bool, error)
- func GetOrSet(ctx context.Context, c Cache, key string, ttl time.Duration, ...) ([]byte, error)
- func Length(c Cache) int
- func Ping(ctx context.Context, c Cache) error
- func Remember[T any](ctx context.Context, c Cache, key string, ttl time.Duration, ...) (T, error)
- func SetJSON[T any](ctx context.Context, c Cache, key string, value T, ttl time.Duration) error
- type Cache
- type Closer
- type Codec
- type Counter
- type Evicter
- type FileOptions
- type FileStore
- func (f *FileStore) Clear(context.Context) error
- func (f *FileStore) ClearPrefix(ctx context.Context, prefix string) error
- func (f *FileStore) Close() error
- func (f *FileStore) Delete(_ context.Context, key string) error
- func (f *FileStore) Dir() string
- func (f *FileStore) Get(_ context.Context, key string) ([]byte, bool, error)
- func (f *FileStore) Has(ctx context.Context, key string) (bool, error)
- func (f *FileStore) Incr(ctx context.Context, key string, delta int64, ttl time.Duration) (int64, error)
- func (f *FileStore) Len() int
- func (f *FileStore) Ping(context.Context) error
- func (f *FileStore) Set(_ context.Context, key string, value []byte, ttl time.Duration) error
- func (f *FileStore) Sweep() int
- type Handle
- func (h *Handle) Alias() string
- func (h *Handle) Clear(ctx context.Context) error
- func (h *Handle) ClearPrefix(ctx context.Context, prefix string) error
- func (h *Handle) Close() error
- func (h *Handle) Delete(ctx context.Context, key string) error
- func (h *Handle) Get(ctx context.Context, key string) ([]byte, bool, error)
- func (h *Handle) GetMulti(ctx context.Context, keys []string) (map[string][]byte, error)
- func (h *Handle) Has(ctx context.Context, key string) (bool, error)
- func (h *Handle) Incr(ctx context.Context, key string, delta int64, ttl time.Duration) (int64, error)
- func (h *Handle) Key(key string) string
- func (h *Handle) Len() int
- func (h *Handle) Namespace() string
- func (h *Handle) Ping(ctx context.Context) error
- func (h *Handle) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
- func (h *Handle) Stats() Stats
- func (h *Handle) Store() Cache
- func (h *Handle) TTL(ttl time.Duration) time.Duration
- type JSONCodec
- type Measured
- type MemoryOptions
- type MemoryStore
- func (m *MemoryStore) Bytes() int64
- func (m *MemoryStore) Clear(_ context.Context) error
- func (m *MemoryStore) ClearPrefix(_ context.Context, prefix string) error
- func (m *MemoryStore) Close() error
- func (m *MemoryStore) Delete(_ context.Context, key string) error
- func (m *MemoryStore) Evictions() int64
- func (m *MemoryStore) Get(_ context.Context, key string) ([]byte, bool, error)
- func (m *MemoryStore) GetMulti(ctx context.Context, keys []string) (map[string][]byte, error)
- func (m *MemoryStore) Has(ctx context.Context, key string) (bool, error)
- func (m *MemoryStore) Incr(_ context.Context, key string, delta int64, ttl time.Duration) (int64, error)
- func (m *MemoryStore) Len() int
- func (m *MemoryStore) Ping(context.Context) error
- func (m *MemoryStore) Set(_ context.Context, key string, value []byte, ttl time.Duration) error
- type Multi
- type Namespacer
- type NoopStore
- func (*NoopStore) Clear(context.Context) error
- func (*NoopStore) ClearPrefix(context.Context, string) error
- func (*NoopStore) Delete(context.Context, string) error
- func (*NoopStore) Get(context.Context, string) ([]byte, bool, error)
- func (*NoopStore) Has(context.Context, string) (bool, error)
- func (*NoopStore) Len() int
- func (*NoopStore) Ping(context.Context) error
- func (*NoopStore) Set(context.Context, string, []byte, time.Duration) error
- type Options
- type Pinger
- type Stats
- type Status
Constants ¶
Variables ¶
View Source
var ( ErrUnsupported = errors.New("coyote/cache: the backend does not support this operation") ErrUnreachable = errors.New("coyote/cache: cache is unreachable") ErrClosed = errors.New("coyote/cache: cache is closed") ErrBuildAbandoned = errors.New("coyote/cache: the build for this key did not finish") )
Functions ¶
Types ¶
type FileOptions ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
func NewFileStore ¶
func NewFileStore(opts FileOptions) *FileStore
func (*FileStore) ClearPrefix ¶
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
type MemoryOptions ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore(opts MemoryOptions) *MemoryStore
func (*MemoryStore) Bytes ¶
func (m *MemoryStore) Bytes() int64
func (*MemoryStore) ClearPrefix ¶
func (m *MemoryStore) ClearPrefix(_ context.Context, prefix string) error
func (*MemoryStore) Close ¶
func (m *MemoryStore) Close() error
func (*MemoryStore) Evictions ¶
func (m *MemoryStore) Evictions() int64
func (*MemoryStore) Len ¶
func (m *MemoryStore) Len() int
type Namespacer ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.