httpserver

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveConnection

type ActiveConnection struct {
	Addr          string        `json:"addr"`
	DeclAddr      string        `json:"decl_addr"`
	Direction     string        `json:"direction"`
	RemoteAddr    string        `json:"remote_addr"`
	LocalAddr     string        `json:"local_addr"`
	Version       proto.Version `json:"version"`
	AppName       string        `json:"app_name"`
	NodeName      string        `json:"node_name"`
	SendClosed    bool          `json:"send_closed"`
	ReceiveClosed bool          `json:"receive_closed"`
}

type ActiveConnections

type ActiveConnections []ActiveConnection

func (ActiveConnections) Len

func (a ActiveConnections) Len() int

func (ActiveConnections) Less

func (a ActiveConnections) Less(i, j int) bool

func (ActiveConnections) Swap

func (a ActiveConnections) Swap(i, j int)

type FullState

type FullState struct {
	Active  []ActiveConnection
	Spawned []string
	Known   []string
}

type HttpServer

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

func NewHttpServer

func NewHttpServer(r Retransmitter) *HttpServer

func (*HttpServer) ActiveConnections

func (a *HttpServer) ActiveConnections(rw http.ResponseWriter, r *http.Request)

func (*HttpServer) KnownPeers

func (a *HttpServer) KnownPeers(rw http.ResponseWriter, r *http.Request)

func (*HttpServer) ListenAndServe

func (a *HttpServer) ListenAndServe() error

func (*HttpServer) Shutdown

func (a *HttpServer) Shutdown(ctx context.Context) error

func (*HttpServer) Spawned

func (a *HttpServer) Spawned(rw http.ResponseWriter, r *http.Request)

type Retransmitter

type Retransmitter interface {
	Counter() *utils.Counter
	KnownPeers() *utils.KnownPeers
	SpawnedPeers() *utils.SpawnedPeers
	ActiveConnections() *utils.Addr2Peers
}

Jump to

Keyboard shortcuts

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