Documentation ¶
Overview ¶
Package trillian represents the log for the needs of this personality.
Index ¶
- type Client
- func (c *Client) AddSignedStatement(ctx context.Context, data []byte) error
- func (c *Client) Close()
- func (c *Client) ConsistencyProof(ctx context.Context, from, to uint64) ([][]byte, error)
- func (c *Client) FirmwareManifestAtIndex(ctx context.Context, index, treeSize uint64) ([]byte, [][]byte, error)
- func (c *Client) InclusionProofByHash(ctx context.Context, hash []byte, treeSize uint64) (uint64, [][]byte, error)
- func (c *Client) Root() *tt.LogRootV1
- func (c *Client) UpdateRoot(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *client.LogVerifier // contains filtered or unexported fields }
Client represents the personality's view of the Trillian Log.
func NewClient ¶
func NewClient(ctx context.Context, timeout time.Duration, logAddr string, treeStorage *trees.TreeStorage) (*Client, error)
NewClient returns a new client that will read/write to its tree using the Trillian gRPC API URL provided, with the given timeout for connections. The Client returned should have Close called by the owner when done.
func (*Client) AddSignedStatement ¶
AddSignedStatement adds the statement to the log if it isn't already present.
func (*Client) Close ¶
func (c *Client) Close()
Close finishes the underlying connections and tidies up after the Client is finished.
func (*Client) ConsistencyProof ¶
ConsistencyProof gets the consistency proof between two given tree sizes.
func (*Client) FirmwareManifestAtIndex ¶
func (c *Client) FirmwareManifestAtIndex(ctx context.Context, index, treeSize uint64) ([]byte, [][]byte, error)
FirmwareManifestAtIndex gets the value at the given index and an inclusion proof to the given tree size.
func (*Client) InclusionProofByHash ¶
func (c *Client) InclusionProofByHash(ctx context.Context, hash []byte, treeSize uint64) (uint64, [][]byte, error)
InclusionProofByHash gets an inclusion proof in the specified tree size for the first leaf found with the specified hash.
func (*Client) Root ¶
Root returns the most recent root seen by this client. Use UpdateRoot() to update this client's view of the latest root.
func (*Client) UpdateRoot ¶
UpdateRoot retrieves the current SignedLogRoot, verifying it against roots this client has seen in the past, and updating the currently trusted root if the new root verifies, and is newer than the currently trusted root. After returning, the most recent verified root will be obtainable via c.Root().