Help us shape the future of Go! Take the 2026 Go Developer Survey

aerospike

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 32 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New

func New(namespace string, setName string, client *as.Client, timeToLiveInSec uint32, options ...interface{}) (*Cache, error)

func (*Cache) AddValues

func (a *Cache) AddValues(ctx context.Context, entry *cache.Entry, values []interface{}) error

func (*Cache) AsSource

func (a *Cache) AsSource(ctx context.Context, entry *cache.Entry) (cache.Source, error)

func (*Cache) AssignRows

func (a *Cache) AssignRows(entry *cache.Entry, rows *sql.Rows) error

func (*Cache) Close

func (a *Cache) Close(ctx context.Context, entry *cache.Entry) error

func (*Cache) Delete

func (a *Cache) Delete(ctx context.Context, entry *cache.Entry) error

func (*Cache) Get

func (a *Cache) Get(ctx context.Context, SQL string, args []interface{}, options ...interface{}) (*cache.Entry, error)

func (*Cache) IndexBy

func (a *Cache) IndexBy(ctx context.Context, db *sql.DB, column, SQL string, args []interface{}, options ...interface{}) (int, error)

func (*Cache) IndexByWithResult added in v0.24.0

func (a *Cache) IndexByWithResult(ctx context.Context, db *sql.DB, column, SQL string, args []interface{}, options ...interface{}) (*cache.IndexByResult, error)

func (*Cache) Rollback

func (a *Cache) Rollback(ctx context.Context, entry *cache.Entry) error

func (*Cache) UpdateType

func (a *Cache) UpdateType(ctx context.Context, entry *cache.Entry, args []interface{}) (bool, error)

type Config added in v0.26.0

type Config struct {
	Provider string
	Location string
	Identity string
	TTL      time.Duration
	Timeout  TimeoutConfig
	// FailedRequestLimit is the tolerated number of consecutive failed native
	// record operations. A lookup can perform both lazy and warmup operations.
	FailedRequestLimit int
	ResetFailuresInMs  int
}

Config describes one configured cache. Provider is aerospike://host:port/namespace; Location is the set name. Identity scopes native query keys within that set. It must distinguish views using different connectors even when SQL matches.

type Errors

type Errors struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Errors) Add

func (e *Errors) Add(err error)

func (*Errors) Err

func (e *Errors) Err() error

type FailureHandler added in v0.2.0

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

FailureHandler temporarily bypasses cache reads after consecutive failures. Close stops its reset timer and prevents further timers from being scheduled.

func NewFailureHandler added in v0.2.0

func NewFailureHandler(limit int64, resetAfter *time.Duration) *FailureHandler

func (*FailureHandler) Close added in v0.2.0

func (f *FailureHandler) Close() error

func (*FailureHandler) HandleFailure added in v0.2.0

func (f *FailureHandler) HandleFailure()

func (*FailureHandler) HandleSuccess added in v0.2.0

func (f *FailureHandler) HandleSuccess()

func (*FailureHandler) IsProbing added in v0.2.0

func (f *FailureHandler) IsProbing() bool

type IndexSource

type IndexSource interface {
	Close() error
	Index(value interface{}) (*indexedValue, error)
	ColumnIndex() int
	Count() int
}

func NewIndexSource

func NewIndexSource(aCache *Cache, column string, ordered bool, fields []*cache.Field, url string, metaBin as.BinMap) (IndexSource, error)

type MultiReader

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

func NewMultiReader

func NewMultiReader(matcher *cache.ParmetrizedQuery) *MultiReader

func (*MultiReader) AddReader

func (m *MultiReader) AddReader(reader *Reader)

func (*MultiReader) Close

func (m *MultiReader) Close() error

func (*MultiReader) Read

func (m *MultiReader) Read(target []byte) (int, error)

Read and ReadLine consume the same windowed row stream. Buffering one fragment preserves forward progress for callers using buffers smaller than a row.

func (*MultiReader) ReadLine

func (m *MultiReader) ReadLine() ([]byte, bool, error)

type OrderedSource

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

func NewOrderedSource

func NewOrderedSource(aCache *Cache, column string, url string, metaBin as.BinMap, index int) *OrderedSource

func (*OrderedSource) Close

func (o *OrderedSource) Close() error

func (*OrderedSource) ColumnIndex

func (o *OrderedSource) ColumnIndex() int

func (*OrderedSource) Count added in v0.24.0

func (o *OrderedSource) Count() int

func (*OrderedSource) Index

func (o *OrderedSource) Index(value interface{}) (*indexedValue, error)

type Placeholders

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

func NewPlaceholders

func NewPlaceholders(columnIndex int, fields []*cache.Field) *Placeholders

func (*Placeholders) ColumnValue

func (p *Placeholders) ColumnValue() (interface{}, bool)

func (*Placeholders) CreatePlaceholderAt

func (p *Placeholders) CreatePlaceholderAt(i int)

func (*Placeholders) ScanPlaceholders

func (p *Placeholders) ScanPlaceholders() []interface{}

func (*Placeholders) Values

func (p *Placeholders) Values() []interface{}

type Pool added in v0.26.0

type Pool struct {
	ClientPolicy *as.ClientPolicy
	// contains filtered or unexported fields
}

Pool owns configured cache clients and failure timers for a service lifetime. The zero value is ready to use. Call Close after all reads and warmups drain, including on failed startup. Injected caches/clients are never adopted. ClientPolicy controls connection setup and the native per-node connection pool; set it before first use and do not mutate it while the Pool is in use.

func (*Pool) Close added in v0.26.0

func (p *Pool) Close() error

Close is idempotent. It is a service lifetime operation, distinct from Cache.Close which finalizes a single cache entry. No new clients can be opened afterward.

func (*Pool) NewCache added in v0.26.0

func (p *Pool) NewCache(config Config) (*Cache, error)

NewCache returns the native cache service, sharing clients by seed endpoint and cache policy by exact configuration. Failed connects are returned to the caller; no background retry or client is retained after a failed connect.

type Reader

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

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Read

func (r *Reader) Read(b []byte) (int, error)

func (*Reader) ReadLine

func (r *Reader) ReadLine() (line []byte, prefix bool, err error)

type RecordMatched

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

type SingleSource

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

func NewSingleSource

func NewSingleSource(aCache *Cache, column string, url string, metaBin as.BinMap) *SingleSource

func (*SingleSource) Close

func (s *SingleSource) Close() error

func (*SingleSource) ColumnIndex

func (s *SingleSource) ColumnIndex() int

func (*SingleSource) Count added in v0.24.0

func (s *SingleSource) Count() int

func (*SingleSource) Index

func (s *SingleSource) Index(value interface{}) (*indexedValue, error)

type Source

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

func (*Source) CheckType

func (s *Source) CheckType(ctx context.Context, values []interface{}) (bool, error)

func (*Source) Close

func (s *Source) Close(ctx context.Context) error

func (*Source) ConvertColumns

func (s *Source) ConvertColumns() ([]io.Column, error)

func (*Source) Err added in v0.14.0

func (s *Source) Err() error

func (*Source) Next

func (s *Source) Next() bool

func (*Source) Rollback

func (s *Source) Rollback(ctx context.Context) error

func (*Source) Scanner

func (s *Source) Scanner(ctx context.Context) cache.ScannerFn

func (*Source) XTypes

func (s *Source) XTypes() []*xunsafe.Type

type TimeoutConfig

type TimeoutConfig struct {
	MaxRetries            int
	SocketTimeoutMs       int
	TotalTimeoutMs        int
	SleepBetweenRetriesMs int
}

func (*TimeoutConfig) Init added in v0.2.0

func (t *TimeoutConfig) Init()

type UnorderedSource

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

func NewUnorderedSource

func NewUnorderedSource(aCache *Cache, column string, url string, metaBin as.BinMap, index int) *UnorderedSource

func (*UnorderedSource) Close

func (u *UnorderedSource) Close() error

func (*UnorderedSource) ColumnIndex

func (u *UnorderedSource) ColumnIndex() int

func (*UnorderedSource) Count added in v0.24.0

func (u *UnorderedSource) Count() int

func (*UnorderedSource) Index

func (u *UnorderedSource) Index(columnValue interface{}) (*indexedValue, error)

type Writer

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

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) Flush

func (w *Writer) Flush() error

func (*Writer) Write

func (w *Writer) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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