Documentation
¶
Index ¶
- type LogOperation
- type LogOperationManager
- type LogOperationManagerContext
- type LogStorageProviderFunc
- type MockLogOperation
- type SequencerManager
- type TrillianLogServer
- func (t *TrillianLogServer) GetConsistencyProof(ctx context.Context, req *trillian.GetConsistencyProofRequest) (*trillian.GetConsistencyProofResponse, error)
- func (t *TrillianLogServer) GetEntryAndProof(ctx context.Context, req *trillian.GetEntryAndProofRequest) (*trillian.GetEntryAndProofResponse, error)
- func (t *TrillianLogServer) GetInclusionProof(ctx context.Context, req *trillian.GetInclusionProofRequest) (*trillian.GetInclusionProofResponse, error)
- func (t *TrillianLogServer) GetInclusionProofByHash(ctx context.Context, req *trillian.GetInclusionProofByHashRequest) (*trillian.GetInclusionProofByHashResponse, error)
- func (t *TrillianLogServer) GetLatestSignedLogRoot(ctx context.Context, req *trillian.GetLatestSignedLogRootRequest) (*trillian.GetLatestSignedLogRootResponse, error)
- func (t *TrillianLogServer) GetLeavesByHash(ctx context.Context, req *trillian.GetLeavesByHashRequest) (*trillian.GetLeavesByHashResponse, error)
- func (t *TrillianLogServer) GetLeavesByIndex(ctx context.Context, req *trillian.GetLeavesByIndexRequest) (*trillian.GetLeavesByIndexResponse, error)
- func (t *TrillianLogServer) GetSequencedLeafCount(ctx context.Context, req *trillian.GetSequencedLeafCountRequest) (*trillian.GetSequencedLeafCountResponse, error)
- func (t *TrillianLogServer) QueueLeaves(ctx context.Context, req *trillian.QueueLeavesRequest) (*trillian.QueueLeavesResponse, error)
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 ¶
func (t *TrillianLogServer) GetConsistencyProof(ctx context.Context, req *trillian.GetConsistencyProofRequest) (*trillian.GetConsistencyProofResponse, error)
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 ¶
func (t *TrillianLogServer) GetEntryAndProof(ctx context.Context, req *trillian.GetEntryAndProofRequest) (*trillian.GetEntryAndProofResponse, error)
GetEntryAndProof returns both a Merkle Leaf entry and an inclusion proof for a given index and tree size.
func (*TrillianLogServer) GetInclusionProof ¶
func (t *TrillianLogServer) GetInclusionProof(ctx context.Context, req *trillian.GetInclusionProofRequest) (*trillian.GetInclusionProofResponse, error)
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 ¶
func (t *TrillianLogServer) GetInclusionProofByHash(ctx context.Context, req *trillian.GetInclusionProofByHashRequest) (*trillian.GetInclusionProofByHashResponse, error)
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 ¶
func (t *TrillianLogServer) GetLatestSignedLogRoot(ctx context.Context, req *trillian.GetLatestSignedLogRootRequest) (*trillian.GetLatestSignedLogRootResponse, error)
GetLatestSignedLogRoot obtains the latest published tree root for the Merkle Tree that underlies the log.
func (*TrillianLogServer) GetLeavesByHash ¶
func (t *TrillianLogServer) GetLeavesByHash(ctx context.Context, req *trillian.GetLeavesByHashRequest) (*trillian.GetLeavesByHashResponse, error)
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 ¶
func (t *TrillianLogServer) GetLeavesByIndex(ctx context.Context, req *trillian.GetLeavesByIndexRequest) (*trillian.GetLeavesByIndexResponse, error)
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 ¶
func (t *TrillianLogServer) GetSequencedLeafCount(ctx context.Context, req *trillian.GetSequencedLeafCountRequest) (*trillian.GetSequencedLeafCountResponse, error)
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 ¶
func (t *TrillianLogServer) QueueLeaves(ctx context.Context, req *trillian.QueueLeavesRequest) (*trillian.QueueLeavesResponse, error)
QueueLeaves submits a batch of leaves to the log for later integration into the underlying tree.