Documentation
¶
Index ¶
- Constants
- Variables
- func FieldKey(field *ast.Field, vars map[string]any) (string, error)
- func QueryKey(query string, vars map[string]any) (string, error)
- type BackendType
- type CacheItem
- type Config
- type Info
- type L1Config
- type L2Config
- type Option
- type Options
- type Service
- func (s *Service) Attach(ctx context.Context, db *db.Pool) error
- func (s *Service) Catalog(ctx context.Context) cs.Source
- func (s *Service) Delete(ctx context.Context, key string) error
- func (s *Service) Engine() engines.Engine
- func (s *Service) Get(ctx context.Context, key string) (any, error)
- func (s *Service) Init(ctx context.Context) error
- func (s *Service) Invalidate(ctx context.Context, tags ...string) error
- func (s *Service) IsReadonly() bool
- func (s *Service) Load(ctx context.Context, key string, fn func() (any, error), options ...Option) (any, error)
- func (s *Service) Name() string
- func (s *Service) Set(ctx context.Context, key string, data any, options ...Option) error
Constants ¶
View Source
const ( ItemDataTypeMap = iota ItemDataTypeDBJsonTable ItemDataTypeJsonValue ItemDataTypeBytes ItemDataTypeString ItemDataTypeResponse ItemNil )
Variables ¶
View Source
var ErrMissCache = errors.New("Key not found in cache")
View Source
var (
ErrNoCacheConfigured = errors.New("no cache configured")
)
Functions ¶
Types ¶
type BackendType ¶
type BackendType string
const ( L2RedisBackend BackendType = "redis" L2MemcachedBackend BackendType = "memcached" L2PegasusBackend BackendType = "pegasus" )
type CacheItem ¶
func NewCacheItem ¶
func (*CacheItem) DecodeMsgpack ¶
func (*CacheItem) EncodeMsgpack ¶
type Config ¶
type L1Config ¶
type L2Config ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func ApplyOptions ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Invalidate ¶
func (*Service) IsReadonly ¶
Click to show internal directories.
Click to hide internal directories.