Documentation ¶
Overview ¶
Package client contains a basic client for the SumDB log.
Index ¶
Constants ¶
View Source
const HashLenBytes = 32
HashLenBytes is the number of bytes in the SumDB hashes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
Checkpoint is a parsed Checkpoint and the raw bytes that it came from.
type Fetcher ¶
type Fetcher interface { // GetData gets the data at the given path, or returns an error. GetData(path string) ([]byte, error) }
Fetcher gets data paths. This allows impl to be swapped for tests.
type HTTPFetcher ¶
type HTTPFetcher struct {
// contains filtered or unexported fields
}
HTTPFetcher gets the data over HTTP(S).
type SumDBClient ¶
type SumDBClient struct {
// contains filtered or unexported fields
}
SumDBClient provides access to information from the Sum DB.
func NewSumDB ¶
func NewSumDB(height int, vkey, url string, c *http.Client) *SumDBClient
NewSumDB creates a new client that fetches tiles of the given height.
func (*SumDBClient) FullLeavesAtOffset ¶
func (c *SumDBClient) FullLeavesAtOffset(offset int) ([][]byte, error)
FullLeavesAtOffset gets the Nth chunk of 2**height leaves.
func (*SumDBClient) LatestCheckpoint ¶
func (c *SumDBClient) LatestCheckpoint() (*Checkpoint, error)
LatestCheckpoint gets the freshest Checkpoint.
func (*SumDBClient) PartialLeavesAtOffset ¶
func (c *SumDBClient) PartialLeavesAtOffset(offset, count int) ([][]byte, error)
PartialLeavesAtOffset gets the final tile of incomplete leaves.
Click to show internal directories.
Click to hide internal directories.