http

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DumbDialer added in v1.4.0

type DumbDialer struct {
	Peers     map[string][]peer.AddrInfo
	Connector dial.Connector
	Self      peer.ID
	// contains filtered or unexported fields
}

DumbDialer always dials one of the seed nodes

func (*DumbDialer) Dial added in v1.4.0

func (d *DumbDialer) Dial(ctx context.Context, addr multiaddr.Multiaddr) (message.Stream, error)

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