log

package
v0.0.0-...-f1c747c Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package log includes code that is specific to Trillian's log mode, particularly code for running sequencing operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sequencer

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

Sequencer instances are responsible for integrating new leaves into a single log. Leaves will be assigned unique sequence numbers when they are processed. There is no strong ordering guarantee but in general entries will be processed in order of submission to the log.

func NewSequencer

func NewSequencer(hasher merkle.TreeHasher, timeSource util.TimeSource, logStorage storage.LogStorage, signer *crypto.Signer) *Sequencer

NewSequencer creates a new Sequencer instance for the specified inputs.

func (Sequencer) SequenceBatch

func (s Sequencer) SequenceBatch(ctx context.Context, logID int64, limit int) (int, error)

SequenceBatch wraps up all the operations needed to take a batch of queued leaves and integrate them into the tree. TODO(Martin2112): Can possibly improve by deferring a function that attempts to rollback, which will fail if the tx was committed. Should only do this if we can hide the details of the underlying storage transactions and it doesn't create other problems.

func (*Sequencer) SetGuardWindow

func (s *Sequencer) SetGuardWindow(sequencerGuardWindow time.Duration)

SetGuardWindow changes the interval that must elapse between leaves being queued and them being eligible for sequencing. The default is a zero interval.

func (Sequencer) SignRoot

func (s Sequencer) SignRoot(ctx context.Context, logID int64) error

SignRoot wraps up all the operations for creating a new log signed root.

Jump to

Keyboard shortcuts

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