http

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconHandler added in v1.4.6

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

type DrandHandler added in v1.4.6

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

DrandHandler keeps the reference to the real http handler used by the server to attend to new request, as well as the slice of logic handlers used to process a request. Each handler will attend to requests for one beacon process. The chain hash is used as key.

func New

func New(ctx context.Context, version string, logger log.Logger) (*DrandHandler, error)

New creates an HTTP handler for the public Drand API

func (*DrandHandler) ChainHashes added in v1.4.6

func (h *DrandHandler) ChainHashes(w http.ResponseWriter, r *http.Request)

func (*DrandHandler) ChainInfo added in v1.4.6

func (h *DrandHandler) ChainInfo(w http.ResponseWriter, r *http.Request)

func (*DrandHandler) GetHTTPHandler added in v1.4.6

func (h *DrandHandler) GetHTTPHandler() http.Handler

func (*DrandHandler) Health added in v1.4.6

func (h *DrandHandler) Health(w http.ResponseWriter, r *http.Request)

func (*DrandHandler) LatestRand added in v1.4.6

func (h *DrandHandler) LatestRand(w http.ResponseWriter, r *http.Request)

func (*DrandHandler) PublicRand added in v1.4.6

func (h *DrandHandler) PublicRand(w http.ResponseWriter, r *http.Request)

func (*DrandHandler) RegisterDefaultBeaconHandler added in v1.4.6

func (h *DrandHandler) RegisterDefaultBeaconHandler(bh *BeaconHandler)

func (*DrandHandler) RegisterNewBeaconHandler added in v1.4.6

func (h *DrandHandler) RegisterNewBeaconHandler(c client.Client, chainHash string) *BeaconHandler

RegisterNewBeaconHandler add a new handler for a beacon process using its chain hash

func (*DrandHandler) RemoveBeaconHandler added in v1.4.6

func (h *DrandHandler) RemoveBeaconHandler(chainHash string)

func (*DrandHandler) SetHTTPHandler added in v1.4.6

func (h *DrandHandler) SetHTTPHandler(newHandler http.Handler)

func (*DrandHandler) Watch added in v1.4.6

func (h *DrandHandler) Watch(bh *BeaconHandler, ready chan bool)

Jump to

Keyboard shortcuts

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