Documentation ¶
Index ¶
- type BeaconHandler
- type DrandHandler
- func (h *DrandHandler) ChainHashes(w http.ResponseWriter, _ *http.Request)
- func (h *DrandHandler) ChainInfo(w http.ResponseWriter, r *http.Request)
- func (h *DrandHandler) GetHTTPHandler() http.Handler
- func (h *DrandHandler) Health(w http.ResponseWriter, r *http.Request)
- func (h *DrandHandler) LatestRand(w http.ResponseWriter, r *http.Request)
- func (h *DrandHandler) PublicRand(w http.ResponseWriter, r *http.Request)
- func (h *DrandHandler) RegisterDefaultBeaconHandler(bh *BeaconHandler)
- func (h *DrandHandler) RegisterNewBeaconHandler(c client2.Client, chainHash string) *BeaconHandler
- func (h *DrandHandler) RemoveBeaconHandler(chainHash string)
- func (h *DrandHandler) SetHTTPHandler(newHandler http.Handler)
- func (h *DrandHandler) Watch(bh *BeaconHandler, ready chan bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeaconHandler ¶
type BeaconHandler struct {
// contains filtered or unexported fields
}
type DrandHandler ¶
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) (*DrandHandler, error)
New creates an HTTP handler for the public Drand API
func (*DrandHandler) ChainHashes ¶
func (h *DrandHandler) ChainHashes(w http.ResponseWriter, _ *http.Request)
func (*DrandHandler) ChainInfo ¶
func (h *DrandHandler) ChainInfo(w http.ResponseWriter, r *http.Request)
func (*DrandHandler) GetHTTPHandler ¶
func (h *DrandHandler) GetHTTPHandler() http.Handler
func (*DrandHandler) Health ¶
func (h *DrandHandler) Health(w http.ResponseWriter, r *http.Request)
func (*DrandHandler) LatestRand ¶
func (h *DrandHandler) LatestRand(w http.ResponseWriter, r *http.Request)
func (*DrandHandler) PublicRand ¶
func (h *DrandHandler) PublicRand(w http.ResponseWriter, r *http.Request)
func (*DrandHandler) RegisterDefaultBeaconHandler ¶
func (h *DrandHandler) RegisterDefaultBeaconHandler(bh *BeaconHandler)
func (*DrandHandler) RegisterNewBeaconHandler ¶
func (h *DrandHandler) RegisterNewBeaconHandler(c client2.Client, chainHash string) *BeaconHandler
RegisterNewBeaconHandler add a new handler for a beacon process using its chain hash
func (*DrandHandler) RemoveBeaconHandler ¶
func (h *DrandHandler) RemoveBeaconHandler(chainHash string)
func (*DrandHandler) SetHTTPHandler ¶
func (h *DrandHandler) SetHTTPHandler(newHandler http.Handler)
func (*DrandHandler) Watch ¶
func (h *DrandHandler) Watch(bh *BeaconHandler, ready chan bool)
Click to show internal directories.
Click to hide internal directories.