Documentation
¶
Overview ¶
Package http is a simple client for interacting with witnesses over HTTP.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCheckpointTooOld = errors.New("checkpoint too old")
ErrCheckpointTooOld is returned if the checkpoint passed to Update needs to be updated.
Functions ¶
This section is empty.
Types ¶
type Witness ¶
type Witness struct {
// contains filtered or unexported fields
}
Witness is a simple client for interacting with witnesses over HTTP.
func NewWitness ¶
NewWitness returns a Witness accessed over http at the given URL using the client provided.
func (Witness) GetLatestCheckpoint ¶
GetLatestCheckpoint returns a recent checkpoint from the witness for the specified log ID.
func (Witness) Update ¶
func (w Witness) Update(ctx context.Context, logID string, cp []byte, proof [][]byte) ([]byte, error)
Update attempts to clock the witness forward for the given logID. The latest signed checkpoint will be returned if this succeeds, or if the error is http.ErrCheckpointTooOld. In all other cases no checkpoint should be expected.
Click to show internal directories.
Click to hide internal directories.