server

package
v0.0.0-...-75544e8 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogOperation

type LogOperation interface {
	Name() string
	ExecutePass([]trillian.LogID, LogOperationManagerContext) bool
}

LogOperation defines a task that operates on logs. Examples are scheduling, signing, consistency checking or cleanup.

type LogOperationManager

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

LogOperationManager controls scheduling activities for logs. At the moment it's very simple with a single task running over active logs one at a time. This will be expanded later. This is meant for embedding into the actual operation implementations and should not be created separately.

func NewLogOperationManager

func NewLogOperationManager(done chan struct{}, sp LogStorageProviderFunc, batchSize int, sleepBetweenRuns time.Duration, signInterval time.Duration, timeSource util.TimeSource, logOperation LogOperation) *LogOperationManager

func NewLogOperationManagerForTest

func NewLogOperationManagerForTest(done chan struct{}, sp LogStorageProviderFunc, batchSize int, sleepBetweenRuns time.Duration, signInterval time.Duration, timeSource util.TimeSource, logOperation LogOperation) *LogOperationManager

For use by tests only, configures one shot mode

func (LogOperationManager) OperationLoop

func (l LogOperationManager) OperationLoop()

OperationLoop starts the manager working. It continues until told to exit. TODO(Martin2112): No mechanism for error reporting etc., this is OK for v1 but needs work

type LogOperationManagerContext

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

LogOperationManagerContext bundles up the values so testing can be made easier

type LogStorageProviderFunc

type LogStorageProviderFunc func(int64) (storage.LogStorage, error)

LogStorageProviderFunc decouples the server from storage implementations

type MockLogOperation

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

Mock of LogOperation interface

func NewMockLogOperation

func NewMockLogOperation(ctrl *gomock.Controller) *MockLogOperation

func (*MockLogOperation) EXPECT

func (_m *MockLogOperation) EXPECT() *_MockLogOperationRecorder

func (*MockLogOperation) ExecutePass

func (_m *MockLogOperation) ExecutePass(_param0 []trillian.LogID, _param1 LogOperationManagerContext) bool

func (*MockLogOperation) Name

func (_m *MockLogOperation) Name() string

type SequencerManager

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

func NewSequencerManager

func NewSequencerManager(km crypto.KeyManager) *SequencerManager

func (SequencerManager) ExecutePass

func (s SequencerManager) ExecutePass(logIDs []trillian.LogID, context LogOperationManagerContext) bool

func (SequencerManager) Name

func (s SequencerManager) Name() string

type TrillianLogServer

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

TrillianLogServer implements the RPC API defined in the proto

func NewTrillianLogServer

func NewTrillianLogServer(p LogStorageProviderFunc) *TrillianLogServer

NewTrillianLogServer creates a new RPC server backed by a LogStorageProvider.

func (*TrillianLogServer) GetConsistencyProof

GetConsistencyProof obtains a proof that two versions of the tree are consistent with each other and that the later tree includes all the entries of the prior one. For more details see the example trees in RFC 6962.

func (*TrillianLogServer) GetEntryAndProof

GetEntryAndProof returns both a Merkle Leaf entry and an inclusion proof for a given index and tree size.

func (*TrillianLogServer) GetInclusionProof

GetInclusionProof obtains the proof of inclusion in the tree for a leaf that has been sequenced. Similar to the get proof by hash handler but one less step as we don't need to look up the index

func (*TrillianLogServer) GetInclusionProofByHash

GetInclusionProofByHash obtains proofs of inclusion by leaf hash. Because some logs can contain duplicate hashes it is possible for multiple proofs to be returned.

func (*TrillianLogServer) GetLatestSignedLogRoot

GetLatestSignedLogRoot obtains the latest published tree root for the Merkle Tree that underlies the log.

func (*TrillianLogServer) GetLeavesByHash

GetLeavesByIndex obtains one or more leaves based on their tree hash. It is not possible to fetch leaves that have been queued but not yet integrated. Logs may accept duplicate entries so this may return more results than the number of hashes in the request.

func (*TrillianLogServer) GetLeavesByIndex

GetLeavesByIndex obtains one or more leaves based on their sequence number within the tree. It is not possible to fetch leaves that have been queued but not yet integrated. TODO: Validate indices against published tree size in case we implement write sharding that can get ahead of this point. Not currently clear what component should own this state.

func (*TrillianLogServer) GetSequencedLeafCount

GetSequencedLeafCount returns the number of leaves that have been integrated into the Merkle Tree. This can be zero for a log containing no entries.

func (*TrillianLogServer) QueueLeaves

QueueLeaves submits a batch of leaves to the log for later integration into the underlying tree.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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