Documentation
¶
Index ¶
- func CreateAndInitTree(ctx context.Context, config GRPCConfig) (*trillian.Tree, error)
- type ClientManager
- type GRPCConfig
- type Response
- type TrillianClient
- func (t *TrillianClient) AddLeaf(ctx context.Context, byteValue []byte) *Response
- func (t *TrillianClient) GetConsistencyProof(ctx context.Context, firstSize, lastSize int64) *Response
- func (t *TrillianClient) GetLatest(ctx context.Context, leafSizeInt int64) *Response
- func (t *TrillianClient) GetLeafAndProofByHash(ctx context.Context, hash []byte) *Response
- func (t *TrillianClient) GetLeafAndProofByIndex(ctx context.Context, index int64) *Response
- func (t *TrillianClient) GetLeafWithoutProof(ctx context.Context, index int64) *Response
- func (t *TrillianClient) GetLeavesByRange(ctx context.Context, startIndex, count int64) *Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAndInitTree ¶
Types ¶
type ClientManager ¶ added in v1.4.1
type ClientManager struct {
// contains filtered or unexported fields
}
ClientManager creates and caches Trillian clients and their underlying gRPC connections.
func NewClientManager ¶ added in v1.4.1
func NewClientManager(treeIDToConfig map[int64]GRPCConfig, defaultConfig GRPCConfig) *ClientManager
NewClientManager creates a new ClientManager.
func (*ClientManager) Close ¶ added in v1.4.1
func (cm *ClientManager) Close() error
Close stops clients and closes underlying gRPC connections.
func (*ClientManager) GetTrillianClient ¶ added in v1.4.1
func (cm *ClientManager) GetTrillianClient(treeID int64) (*TrillianClient, error)
GetTrillianClient returns a Rekor Trillian client wrapper for the given tree ID.
type GRPCConfig ¶ added in v1.4.1
type GRPCConfig struct {
Address string
Port uint16
TLSCACert string
UseSystemTrustStore bool
GRPCServiceConfig string
}
GRPCConfig holds the configuration for a gRPC client. Because all its fields are comparable, it can be used as a map key.
type Response ¶
type Response struct {
// Status is the status code of the response
Status codes.Code
// Error contains an error on request or client failure
Err error
// GetAddResult contains the response from queueing a leaf in Trillian
GetAddResult *trillian.QueueLeafResponse
// GetLeafAndProofResult contains the response for fetching an inclusion proof and leaf
GetLeafAndProofResult *trillian.GetEntryAndProofResponse
// GetLatestResult contains the response for the latest checkpoint
GetLatestResult *trillian.GetLatestSignedLogRootResponse
// GetConsistencyProofResult contains the response for a consistency proof between two log sizes
GetConsistencyProofResult *trillian.GetConsistencyProofResponse
// GetLeavesByRangeResult contains the response for fetching a leaf without an inclusion proof
GetLeavesByRangeResult *trillian.GetLeavesByRangeResponse
// contains filtered or unexported fields
}
Response includes a status code, an optional error message, and one of the results based on the API call
type TrillianClient ¶
type TrillianClient struct {
// contains filtered or unexported fields
}
TrillianClient provides a wrapper around the Trillian client
func (*TrillianClient) AddLeaf ¶
func (t *TrillianClient) AddLeaf(ctx context.Context, byteValue []byte) *Response
func (*TrillianClient) GetConsistencyProof ¶
func (t *TrillianClient) GetConsistencyProof(ctx context.Context, firstSize, lastSize int64) *Response
func (*TrillianClient) GetLatest ¶
func (t *TrillianClient) GetLatest(ctx context.Context, leafSizeInt int64) *Response
func (*TrillianClient) GetLeafAndProofByHash ¶
func (t *TrillianClient) GetLeafAndProofByHash(ctx context.Context, hash []byte) *Response
func (*TrillianClient) GetLeafAndProofByIndex ¶
func (t *TrillianClient) GetLeafAndProofByIndex(ctx context.Context, index int64) *Response
func (*TrillianClient) GetLeafWithoutProof ¶ added in v1.4.1
func (t *TrillianClient) GetLeafWithoutProof(ctx context.Context, index int64) *Response
GetLeafWithoutProof is a convenience wrapper for fetching a single leaf by index without proofs.
func (*TrillianClient) GetLeavesByRange ¶ added in v1.4.1
func (t *TrillianClient) GetLeavesByRange(ctx context.Context, startIndex, count int64) *Response
GetLeavesByRange fetches leaves from startIndex (inclusive) up to count leaves without proofs.