Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { Store Addable Missing(ctx context.Context, key string) (bool, error) Delete(ctx context.Context, key string) (bool, error) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) (bool, error) Remember(ctx context.Context, key string, dest interface{}, value func() interface{}, ttl time.Duration) error }
func NewRepository ¶
func NewRepository(store Store) Repository
type Store ¶
type Store interface { Has(ctx context.Context, key string) (bool, error) Get(ctx context.Context, key string, dest interface{}) error Put(ctx context.Context, key string, value interface{}, ttl time.Duration) (bool, error) Increment(ctx context.Context, key string, value int) (int, error) Decrement(ctx context.Context, key string, value int) (int, error) Forever(ctx context.Context, key string, value interface{}) (bool, error) Forget(ctx context.Context, key string) (bool, error) Flush(ctx context.Context) (bool, error) GetPrefix() string }
Click to show internal directories.
Click to hide internal directories.