http

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler processes API requests.

func NewHandler

func NewHandler(opts Options) (*Handler, error)

NewHandler returns a new Handler.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

type Options

type Options struct {
	Logger    log.Logger
	Node      *p2p.Node
	Router    routing.Router
	NetworkId string

	// PeerMap hard-codes the peers used for partitions
	PeerMap map[string][]peer.AddrInfo

	// For API v2
	Network *config.Describe
	MaxWait time.Duration
}

Options are the options for a Handler.

Jump to

Keyboard shortcuts

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