state

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StateManager

type StateManager interface {
	Latest(context.Context) (*types.SignedTreeHead, error)
	ToSign(context.Context) (*types.SignedTreeHead, error)
	Cosigned(context.Context) (*types.CosignedTreeHead, error)
	AddCosignature(context.Context, *types.PublicKey, *types.Signature) error
	Run(context.Context)
}

StateManager coordinates access to a log's tree heads and (co)signatures

type StateManagerSingle

type StateManagerSingle struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

StateManagerSingle implements a single-instance StateManager. In other words, there's no other state that needs to be synced on any remote machine.

func NewStateManagerSingle

func NewStateManagerSingle(client db.Client, signer crypto.Signer, interval, deadline time.Duration) (*StateManagerSingle, error)

func (*StateManagerSingle) AddCosignature

func (sm *StateManagerSingle) AddCosignature(_ context.Context, vk *types.PublicKey, sig *types.Signature) error

func (*StateManagerSingle) Cosigned

func (*StateManagerSingle) Latest

func (*StateManagerSingle) Run

func (sm *StateManagerSingle) Run(ctx context.Context)

func (*StateManagerSingle) ToSign

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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