Documentation ¶
Index ¶
- Constants
- Variables
- func CacheKey(networkID uint32, parts ...string) string
- func CommonAddressHexRepair(address *common.Address) string
- func ErrIsDuplicateEntryError(err error) bool
- func ErrIsLockError(err error) bool
- func ForceParseTimeParam(dsn string) (string, error)
- func KeyFromParts(parts ...string) string
- type Cache
- type CacheJob
- type Cacheable
- type CacheableFn
- type Cacher
- type Collector
- func NewCollectors(collectors ...Collector) Collector
- func NewCounterIncCollect(key string) Collector
- func NewCounterObserveMillisCollect(key string) Collector
- func NewHistogramCollect(key string) Collector
- func NewSuccessFailCounterAdd(keySuccess string, keyFail string, count float64) Collector
- func NewSuccessFailCounterInc(keySuccess string, keyFail string) Collector
- type Conn
- func (c *Conn) Close(context.Context) error
- func (c *Conn) NewSession(name string, timeout time.Duration) (*dbr.Session, error)
- func (c *Conn) NewSessionForEventReceiver(er dbr.EventReceiver) *dbr.Session
- func (c *Conn) SetConnMaxIdleTime(d time.Duration)
- func (c *Conn) SetConnMaxLifetime(d time.Duration)
- func (c *Conn) SetMaxIdleConns(n int)
- func (c *Conn) SetMaxOpenConns(n int)
- type Connections
- type CounterID
- type DelayCache
- type EventRcvr
- type ExecIface
- type GenesisContainer
- type IndexedList
- type LCache
- type ListenCloser
- type Metrics
- func (m *Metrics) CounterAdd(name string, v float64) error
- func (m *Metrics) CounterInc(name string) error
- func (m *Metrics) CounterInit(name string, help string)
- func (m *Metrics) HistogramInit(name string, help string, buckets []float64)
- func (m *Metrics) HistogramObserve(name string, v float64) error
- func (m *Metrics) Init()
- type RetrySleeper
- type Running
- type Worker
Constants ¶
View Source
const ( DriverMysql = "mysql" DriverNone = "" )
View Source
const ( DeadlockDBErrorMessage = "Deadlock found when trying to get lock; try restarting transaction" TimeoutDBErrorMessage = "Lock wait timeout exceeded; try restarting transaction" )
View Source
const ( WorkerQueueSize = 10 WorkerThreadCount = 1 )
View Source
const (
CacheSeparator = "|"
)
View Source
const (
KeyValueBootstrap = "bootstrap"
)
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
func CommonAddressHexRepair ¶
func ErrIsLockError ¶
func ForceParseTimeParam ¶
func KeyFromParts ¶
Types ¶
type Cache ¶
type Cacheable ¶
type Cacheable struct { Key []string CacheableFn CacheableFn TTL time.Duration }
Cacheable is a keyed CacheableFn
type CacheableFn ¶
CacheableFn is a function whose output can safely be cached
type Collector ¶
type Collector interface { Error() Collect() error }
func NewCollectors ¶
func NewCounterIncCollect ¶
func NewHistogramCollect ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a wrapper around a dbr connection and a health stream
func (*Conn) NewSession ¶
func (*Conn) NewSessionForEventReceiver ¶
func (c *Conn) NewSessionForEventReceiver(er dbr.EventReceiver) *dbr.Session
func (*Conn) SetConnMaxIdleTime ¶
func (*Conn) SetConnMaxLifetime ¶
func (*Conn) SetMaxIdleConns ¶
func (*Conn) SetMaxOpenConns ¶
type Connections ¶
type Connections struct { Eventer *EventRcvr // contains filtered or unexported fields }
func NewDBFromConfig ¶
func NewDBFromConfig(conf cfg.Services, ro bool) (*Connections, error)
func (Connections) Close ¶
func (c Connections) Close() error
func (Connections) DB ¶
func (c Connections) DB() *Conn
func (Connections) Stream ¶
func (c Connections) Stream() *EventRcvr
type CounterID ¶
type CounterID struct {
// contains filtered or unexported fields
}
func NewCounterID ¶
func NewCounterID() *CounterID
type DelayCache ¶
func NewDelayCache ¶
func NewDelayCache(cache Cacher) *DelayCache
func (*DelayCache) Processor ¶
func (c *DelayCache) Processor(_ int, job interface{})
type GenesisContainer ¶
type GenesisContainer struct { NetworkID uint32 XChainGenesisTx *txs.Tx XChainID ids.ID DjtxAssetID ids.ID GenesisBytes []byte }
func NewGenesisContainer ¶
func NewGenesisContainer(networkID uint32) (*GenesisContainer, error)
type IndexedList ¶
type IndexedList interface { PushFront(key, val interface{}) Exists(key interface{}) bool }
func NewIndexedList ¶
func NewIndexedList(maxSize int) IndexedList
type ListenCloser ¶
ListenCloser listens for messages until it's asked to close
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
var (
Prometheus Metrics
)
func (*Metrics) CounterInc ¶
func (*Metrics) CounterInit ¶
func (*Metrics) HistogramInit ¶
type RetrySleeper ¶
type RetrySleeper struct {
// contains filtered or unexported fields
}
func NewRetrySleeper ¶
func (*RetrySleeper) Inc ¶
func (r *RetrySleeper) Inc()
Click to show internal directories.
Click to hide internal directories.