Documentation ¶
Index ¶
- Constants
- type OptionsPegasus
- type PegasusStore
- func (p *PegasusStore) Clear(ctx context.Context) error
- func (p *PegasusStore) Close() error
- func (p *PegasusStore) Delete(ctx context.Context, key any) error
- func (p *PegasusStore) Get(ctx context.Context, key any) (any, error)
- func (p *PegasusStore) GetType() string
- func (p *PegasusStore) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)
- func (p *PegasusStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
- func (p *PegasusStore) Set(ctx context.Context, key, value any, options ...lib_store.Option) error
Constants ¶
View Source
const ( // PegasusType represents the storage type as a string value PegasusType = "pegasus" // PegasusTagPattern represents the tag pattern to be used as a key in specified storage PegasusTagPattern = "gocache_tag_%s" // Pegasus ttl(time-to-live) in seconds: -1 if ttl is not set; -2 if entry doesn't exist PegasusNOTTL = -1 PegasusNOENTRY = -2 DefaultTable = "gocache_pegasus" DefaultTablePartitionNum = 4 DefaultScanNum = 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OptionsPegasus ¶
type OptionsPegasus struct { *lib_store.Options MetaServers []string TableName string TablePartitionNum int TableScanNum int }
OptionsPegasus is options of Pegasus
type PegasusStore ¶
type PegasusStore struct {
// contains filtered or unexported fields
}
PegasusStore is a store for Pegasus
func NewPegasus ¶
func NewPegasus(ctx context.Context, options *OptionsPegasus) (*PegasusStore, error)
NewPegasus creates a new store to pegasus instance(s)
func (*PegasusStore) Clear ¶
func (p *PegasusStore) Clear(ctx context.Context) error
Clear resets all data in the store
func (*PegasusStore) Delete ¶
func (p *PegasusStore) Delete(ctx context.Context, key any) error
Delete removes data from Pegasus for given key identifier
func (*PegasusStore) GetType ¶
func (p *PegasusStore) GetType() string
GetType returns the store type
func (*PegasusStore) GetWithTTL ¶
GetWithTTL returns data stored from a given key and its corresponding TTL
func (*PegasusStore) Invalidate ¶
func (p *PegasusStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
Invalidate invalidates some cache data in Pegasus for given options
Click to show internal directories.
Click to hide internal directories.