store

package
v0.22.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MuSigLoggerTag = "MUSIG_STORE"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Transport is an implementation of transport used to fetch data from
	// feeds.
	Transport transport.Service

	// DataModels is the list of models for which we should collect
	// signatures.
	DataModels []string

	// Logger is a current logger interface used by the store.
	Logger log.Logger
}

Config is the configuration for Store.

type SignatureProvider

type SignatureProvider interface {
	// SignaturesByDataModel returns a list of signatures for the given data
	// model.
	SignaturesByDataModel(model string) []*messages.MuSigSignature
}

type Store

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

Store stores MuSigSignature messages received from the transport layer.

It stores only the latest signature provided by each feed for each data model.

func New

func New(cfg Config) *Store

New creates a new Store instance.

func (*Store) SignaturesByDataModel

func (m *Store) SignaturesByDataModel(model string) []*messages.MuSigSignature

SignaturesByDataModel implements SignatureProvider interface.

func (*Store) Start

func (m *Store) Start(ctx context.Context) error

Start implements the supervisor.Service interface.

func (*Store) Wait

func (m *Store) Wait() <-chan error

Wait implements the supervisor.Service interface.

Jump to

Keyboard shortcuts

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