trillianclient

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndInitTree

func CreateAndInitTree(ctx context.Context, adminClient trillian.TrillianAdminClient, logClient trillian.TrillianLogClient) (*trillian.Tree, error)

Types

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
	// 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 NewTrillianClient

func NewTrillianClient(ctx context.Context, logClient trillian.TrillianLogClient, logID int64) TrillianClient

NewTrillianClient creates a TrillianClient with the given Trillian client and log/tree ID.

func (*TrillianClient) AddLeaf

func (t *TrillianClient) AddLeaf(byteValue []byte) *Response

func (*TrillianClient) GetConsistencyProof

func (t *TrillianClient) GetConsistencyProof(firstSize, lastSize int64) *Response

func (*TrillianClient) GetLatest

func (t *TrillianClient) GetLatest(leafSizeInt int64) *Response

func (*TrillianClient) GetLeafAndProofByHash

func (t *TrillianClient) GetLeafAndProofByHash(hash []byte) *Response

func (*TrillianClient) GetLeafAndProofByIndex

func (t *TrillianClient) GetLeafAndProofByIndex(index int64) *Response

Jump to

Keyboard shortcuts

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