Documentation
¶
Index ¶
- type Config
- type ConnectionPolicy
- type ReadWritePolicy
- type Repository
- func (r *Repository) Add(key string, val []byte, item ...cache.ItemF) error
- func (r *Repository) AddOrGet(key string, val []byte, opts ...cache.ItemF) (*cache.Item, bool, error)
- func (r *Repository) CompareAndSwap(key string, handler func(value *cache.Item) (*cache.Item, error), ...) error
- func (r *Repository) Delete(key string) error
- func (r *Repository) Exist(key string) bool
- func (r *Repository) Get(key string) (*cache.Item, error)
- func (r *Repository) Reset()
- func (r *Repository) Set(key string, val []byte, item ...cache.ItemF) error
- func (r *Repository) SetItemSizeLimit(limit int)
- func (r *Repository) SetLiveTimeMin(liveTime time.Duration)
- type Stats
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Hosts []host `mapstructure:"HOSTS"`
KeyPrefix string `mapstructure:"KEY_PREFIX"`
Namespace string `mapstructure:"NAMESPACE"`
ConnectionPolicy ConnectionPolicy `mapstructure:"CONNECTION_POLICY"`
WritePolicy ReadWritePolicy `mapstructure:"WRITE_POLICY"`
ReadPolicy ReadWritePolicy `mapstructure:"READ_POLICY"`
}
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
type ConnectionPolicy ¶
type ReadWritePolicy ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(cache *Storage, liveTime time.Duration, setName string) *Repository
func (*Repository) CompareAndSwap ¶
func (*Repository) Delete ¶
func (r *Repository) Delete(key string) error
func (*Repository) Exist ¶
func (r *Repository) Exist(key string) bool
func (*Repository) Reset ¶
func (r *Repository) Reset()
func (*Repository) SetItemSizeLimit ¶
func (r *Repository) SetItemSizeLimit(limit int)
func (*Repository) SetLiveTimeMin ¶
func (r *Repository) SetLiveTimeMin(liveTime time.Duration)
type Stats ¶
type Stats struct {
InPool int `json:"inPool" mapstructure:"inPool"`
OutPool int `json:"outPool" mapstructure:"outPool"`
OpenConns int `json:"openConns" mapstructure:"openConns"`
ConnectionsOpened int `json:"connectionsOpened" mapstructure:"connectionsOpened"`
ConnectionsClosed int `json:"connectionsClosed" mapstructure:"connectionsClosed"`
Nodes int `json:"nodes" mapstructure:"nodes"`
PartitionMapSize int `json:"partitionMapSize" mapstructure:"partitionMapSize"`
TendInterval int `json:"tendInterval" mapstructure:"tendInterval"`
NodesAdded int `json:"nodesAdded" mapstructure:"nodesAdded"`
NodesRemoved int `json:"nodesRemoved" mapstructure:"nodesRemoved"`
ErrorCount int `json:"errorCount" mapstructure:"errorCount"`
}
Click to show internal directories.
Click to hide internal directories.