aerospike

package
v0.0.0-...-0244bd9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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 ConnectionPolicy struct {
	ConnectionQueueSize   int `mapstructure:"CONNECTION_QUEUE_SIZE"`
	TimeOutMs             int `mapstructure:"TIMEOUT_MS"`
	IdleTimeoutMs         int `mapstructure:"IDLE_TIMEOUT_MS"`
	MinConnectionsPerNode int `mapstructure:"MIN_CONNECTIONS_PER_NODE"`
}

type ReadWritePolicy

type ReadWritePolicy struct {
	TotalTimeoutMs        int `mapstructure:"TOTAL_TIMEOUT_MS"`
	MaxRetries            int `mapstructure:"MAX_RETRIES"`
	SleepBetweenRetriesMs int `mapstructure:"SLEEP_BETWEEN_RETRIES_MS"`
	SocketTimeoutMs       int `mapstructure:"SOCKET_TIMEOUT_MS"`
}

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository(cache *Storage, liveTime time.Duration, setName string) *Repository

func (*Repository) Add

func (r *Repository) Add(key string, val []byte, item ...cache.ItemF) error

func (*Repository) AddOrGet

func (r *Repository) AddOrGet(key string, val []byte, opts ...cache.ItemF) (*cache.Item, bool, error)

func (*Repository) CompareAndSwap

func (r *Repository) CompareAndSwap(
	key string,
	handler func(value *cache.Item) (*cache.Item, error),
	sleepDur ...time.Duration,
) error

func (*Repository) Delete

func (r *Repository) Delete(key string) error

func (*Repository) Exist

func (r *Repository) Exist(key string) bool

func (*Repository) Get

func (r *Repository) Get(key string) (*cache.Item, error)

func (*Repository) Reset

func (r *Repository) Reset()

func (*Repository) Set

func (r *Repository) Set(key string, val []byte, item ...cache.ItemF) error

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"`
}

type Storage

type Storage struct {
	*aero.Client
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(cfg Config) (*Storage, error)

func (*Storage) Stat

func (s *Storage) Stat() (*Stats, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址