Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultPutSingleflightTimeout is based off default value for BasePolicy.SocketTimeout // Since retries are not recommended for Put operations, we will use this simple value DefaultPutSingleflightTimeout = time.Second * 30 // This might be too short for a pure default configuration. // It looks like it should be something like SocketTimeout + SleepBetweenRetries * cumulative product from 1 to MaxRetries of SleepMultiplier... // But in our common use case, 30 seconds is very long, and the Aerospike Client should timeout first. DefaultGetSingleflightTimeout = time.Second * 30 )
Variables ¶
View Source
var DefaultAerospikePool = &Pool{}
Functions ¶
This section is empty.
Types ¶
type Aero ¶ added in v0.18.0
type Aero interface {
// Mocks aerospike.Client.Get
Get(policy *aero.BasePolicy, key *aero.Key, binNames ...string) (record *aero.Record, err error)
// Mocks aerospike.Client.Put
Put(writePolicy *aero.WritePolicy, key *aero.Key, value aero.BinMap) (err error)
}
Aero is a mock of aerospike.Client.
type Option ¶ added in v0.16.0
type Option func(srv *Service)
func WithBasePolicy ¶ added in v0.16.0
func WithBasePolicy(basePolicy *aero.BasePolicy) Option
WithBasePolicy will provide an initial BasePolicy. Even when overridden, the timeout will be applied UNLESS using WithBypassConfiguredTimeout.
func WithBypassConfiguredTimeout ¶ added in v0.16.0
func WithBypassConfiguredTimeout() Option
WithBypassConfiguredTimeout will bypass the configured timeout if using WithClientPolicy or WithBasePolicy.
func WithClientPolicy ¶ added in v0.16.0
func WithClientPolicy(clientPolicy *aero.ClientPolicy) Option
WithClientPolicy will provide an initial ClientPolicy. Even when overridden, the timeout will be applied UNLESS using WithBypassConfiguredTimeout.
type Service ¶
Service represents aerospike client Service
func New ¶
func New(config *datastore.Connection) (*Service, error)
New creates a new Aerospike service
func NewWithOptions ¶ added in v0.16.0
func NewWithOptions(config *datastore.Connection, options ...Option) (*Service, error)
Click to show internal directories.
Click to hide internal directories.