http

package
v0.0.0-...-3b57d64 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package http is a simple client for interacting with witnesses over HTTP.

Index

Constants

This section is empty.

Variables

View Source
var ErrSTHTooOld = errors.New("STH too old")

ErrSTHTooOld is returned if the STH passed to Update needs to be updated.

Functions

This section is empty.

Types

type Witness

type Witness struct {
	URL *url.URL
}

Witness consists of the witness' URL and signature verifier.

func (Witness) GetLatestSTH

func (w Witness) GetLatestSTH(ctx context.Context, logID string) ([]byte, error)

GetLatestSTH returns a recent STH from the witness for the specified log ID.

func (Witness) Update

func (w Witness) Update(ctx context.Context, logID string, sth []byte, proof [][]byte) ([]byte, error)

Update attempts to clock the witness forward for the given logID. The latest signed STH will be returned if this succeeds, or if the error is http.ErrSTHTooOld. In all other cases no STH should be expected.

Jump to

Keyboard shortcuts

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