services

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: BSD-3-Clause Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedisConn

func NewRedisConn(opts *redis.Options) (*redis.Client, error)

func NewStream

func NewStream() *health.Stream

Types

type Connections

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

func NewConnections

func NewConnections(l logging.Logger, s *health.Stream, db *db.Conn, r *redis.Client) *Connections

func NewConnectionsFromConfig

func NewConnectionsFromConfig(conf cfg.Services) (*Connections, error)

func (Connections) Cache

func (c Connections) Cache() *cache.Cache

func (Connections) Close added in v1.1.0

func (c Connections) Close() error

func (Connections) DB

func (c Connections) DB() *db.Conn

func (Connections) Logger added in v1.1.0

func (c Connections) Logger() logging.Logger

func (Connections) Redis

func (c Connections) Redis() *redis.Client

func (Connections) Stream

func (c Connections) Stream() *health.Stream

type Consumable

type Consumable interface {
	ID() string
	ChainID() string
	Body() []byte
	Timestamp() int64
}

type Consumer

type Consumer interface {
	Name() string
	Bootstrap(context.Context) error
	Consume(context.Context, Consumable) error
}

Consumer takes in Consumables and adds them to the service's backend

type ConsumerCtx

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

ConsumerCtx

func NewConsumerContext

func NewConsumerContext(ctx context.Context, job *health.Job, db dbr.SessionRunner, ts int64) ConsumerCtx

func (ConsumerCtx) Ctx

func (ic ConsumerCtx) Ctx() context.Context

func (ConsumerCtx) DB

func (ic ConsumerCtx) DB() dbr.SessionRunner

func (ConsumerCtx) Job

func (ic ConsumerCtx) Job() *health.Job

func (ConsumerCtx) Time

func (ic ConsumerCtx) Time() time.Time

Directories

Path Synopsis
indexes
avm
pvm

Jump to

Keyboard shortcuts

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