dbretry

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SQLQueryRetryCounter = "sql_query_retry_count"
	SQLQueryEndCounter   = "sql_query_end_counter"
)

Variables

This section is empty.

Functions

func Metrics

func Metrics() []xmetrics.Metric

Metrics returns the Metrics relevant to this package

Types

type Measures

type Measures struct {
	SQLQueryRetryCount metrics.Counter
	SQLQueryEndCount   metrics.Counter
}

func NewMeasures

func NewMeasures(p provider.Provider) Measures

type Option

type Option func(r *retryConfig)

func WithInterval

func WithInterval(interval time.Duration) Option

func WithIntervalMultiplier

func WithIntervalMultiplier(mult time.Duration) Option

func WithMeasures

func WithMeasures(p provider.Provider) Option

func WithRetries

func WithRetries(retries int) Option

func WithSleep

func WithSleep(sleep func(time.Duration)) Option

type RetryInsertService

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

func CreateRetryInsertService

func CreateRetryInsertService(inserter db.Inserter, options ...Option) RetryInsertService

func (RetryInsertService) InsertRecords

func (ri RetryInsertService) InsertRecords(records ...db.Record) error

type RetryListGService

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

func CreateRetryListGService

func CreateRetryListGService(listGetter blacklist.Updater, options ...Option) RetryListGService

func (RetryListGService) GetBlacklist

func (ltg RetryListGService) GetBlacklist() (list []blacklist.BlackListedItem, err error)

type RetryRGService

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

func CreateRetryRGService

func CreateRetryRGService(recordGetter db.RecordGetter, options ...Option) RetryRGService

func (RetryRGService) GetRecords

func (rtg RetryRGService) GetRecords(deviceID string, limit int) ([]db.Record, error)

func (RetryRGService) GetRecordsOfType

func (rtg RetryRGService) GetRecordsOfType(deviceID string, limit int, eventType db.EventType) ([]db.Record, error)

type RetryUpdateService

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

func CreateRetryUpdateService

func CreateRetryUpdateService(pruner db.Pruner, options ...Option) RetryUpdateService

func (RetryUpdateService) GetRecordIDs

func (ru RetryUpdateService) GetRecordIDs(shard int, limit int, deathDate int64) ([]int, error)

func (RetryUpdateService) PruneRecords

func (ru RetryUpdateService) PruneRecords(records []int) error

Jump to

Keyboard shortcuts

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