http

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package http contains private implementation details for the distributor server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Distributor

type Distributor interface {
	// GetLogs returns a list of all log IDs the distributor is aware of, sorted
	// by the ID.
	GetLogs(ctx context.Context) ([]string, error)
	// GetWitnesses returns a list of all witness verifier keys the distributor is
	// aware of, sorted by the ID.
	GetWitnesses(ctx context.Context) ([]string, error)
	// GetCheckpointN gets the largest checkpoint for a given log that has at least `n` signatures.
	GetCheckpointN(ctx context.Context, logID string, n uint32) ([]byte, error)
	// GetCheckpointWitness gets the largest checkpoint for the log that was witnessed by the given witness.
	GetCheckpointWitness(ctx context.Context, logID, witID string) ([]byte, error)
	// Distribute adds a new witnessed checkpoint to be distributed. This checkpoint must be signed
	// by both the log and the witness specified, and be larger than any previous checkpoint distributed
	// for this pair.
	Distribute(ctx context.Context, logID, witID string, nextRaw []byte) error
}

Distributor persists witnessed checkpoints and allows querying of them.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the core handler implementation of the witness.

func NewServer

func NewServer(d Distributor) *Server

NewServer creates a new server.

func (*Server) RegisterHandlers

func (s *Server) RegisterHandlers(r *mux.Router)

RegisterHandlers registers HTTP handlers for witness endpoints.

Jump to

Keyboard shortcuts

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