Documentation
¶
Index ¶
- type Cache
- func (a *Cache) AddValues(ctx context.Context, entry *cache.Entry, values []interface{}) error
- func (a *Cache) AsSource(ctx context.Context, entry *cache.Entry) (cache.Source, error)
- func (a *Cache) AssignRows(entry *cache.Entry, rows *sql.Rows) error
- func (c *Cache) Client() *as.Client
- func (a *Cache) Close(ctx context.Context, entry *cache.Entry) error
- func (a *Cache) Delete(ctx context.Context, entry *cache.Entry) error
- func (a *Cache) Get(ctx context.Context, SQL string, args []interface{}, options ...interface{}) (*cache.Entry, error)
- func (a *Cache) IndexBy(ctx context.Context, db *sql.DB, column, SQL string, args []interface{}, ...) (int, error)
- func (a *Cache) IndexByWithResult(ctx context.Context, db *sql.DB, column, SQL string, args []interface{}, ...) (*cache.IndexByResult, error)
- func (a *Cache) Rollback(ctx context.Context, entry *cache.Entry) error
- func (a *Cache) UpdateType(ctx context.Context, entry *cache.Entry, args []interface{}) (bool, error)
- type Config
- type Errors
- type FailureHandler
- type IndexSource
- type MultiReader
- type OrderedSource
- type Placeholders
- type Pool
- type Reader
- type RecordMatched
- type SingleSource
- type Source
- func (s *Source) CheckType(ctx context.Context, values []interface{}) (bool, error)
- func (s *Source) Close(ctx context.Context) error
- func (s *Source) ConvertColumns() ([]io.Column, error)
- func (s *Source) Err() error
- func (s *Source) Next() bool
- func (s *Source) Rollback(ctx context.Context) error
- func (s *Source) Scanner(ctx context.Context) cache.ScannerFn
- func (s *Source) XTypes() []*xunsafe.Type
- type TimeoutConfig
- type UnorderedSource
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
cache.CreationMetrics
// contains filtered or unexported fields
}
func (*Cache) Client ¶ added in v0.26.1
Client returns the borrowed client used by this cache. Its creator (or Pool) owns its lifetime. Callers may use it for related cache control records, but must not close it independently of the owning cache pool.
func (*Cache) IndexByWithResult ¶ added in v0.24.0
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 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 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
type OrderedSource ¶
type OrderedSource struct {
// contains filtered or unexported fields
}
func NewOrderedSource ¶
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
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.
type RecordMatched ¶
type RecordMatched struct {
// contains filtered or unexported fields
}
type SingleSource ¶
type SingleSource struct {
// contains filtered or unexported fields
}
func NewSingleSource ¶
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
}
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 (*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)