web

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(handler WebHandler)

Start the WebU with the given handler.

Types

type Entity

type Entity struct {
	P2P    *p2p.P2P
	Entity *entity.Entity
}

func NewEntityHandler

func NewEntityHandler(p *p2p.P2P, e *entity.Entity) *Entity

NewWebHandler creates a new Entity instance.

func (*Entity) ServeHTTP

func (data *Entity) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface for Entity. This allows Entity to be directly used as an HTTP handler.

func (*Entity) WebHandler

func (data *Entity) WebHandler(w http.ResponseWriter, r *http.Request)

type EntityDocument

type EntityDocument struct {
	Title               string
	H1                  string
	H2                  string
	Addrs               []multiaddr.Multiaddr
	PeersWithSameRendez p2peer.IDSlice
	AllConnectedPeers   p2peer.IDSlice
}

func (*EntityDocument) String

func (d *EntityDocument) String() string

type Node

type Node struct {
	P2P  *p2p.P2P
	Node *entity.Entity
}

func NewNodeHandler

func NewNodeHandler(p *p2p.P2P, e *entity.Entity) *Node

NewWebHandler creates a new Node instance.

func (*Node) ServeHTTP

func (data *Node) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface for Node. This allows Node to be directly used as an HTTP handler.

func (*Node) WebHandler

func (data *Node) WebHandler(w http.ResponseWriter, r *http.Request)

type NodeDocument

type NodeDocument struct {
	Title               string
	H1                  string
	H2                  string
	Addrs               []multiaddr.Multiaddr
	PeersWithSameRendez peer.IDSlice
	AllConnectedPeers   peer.IDSlice
	Topics              []string
}

func (*NodeDocument) String

func (d *NodeDocument) String() string

type Relay

type Relay struct {
	P2P *p2p.P2P
}

func NewRelayHandler

func NewRelayHandler(p *p2p.P2P) *Relay

NewWebHandler creates a new Relay instance.

func (*Relay) ServeHTTP

func (data *Relay) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface for Relay. This allows Relay to be directly used as an HTTP handler.

func (*Relay) WebHandler

func (data *Relay) WebHandler(w http.ResponseWriter, r *http.Request)

type RelayDocument

type RelayDocument struct {
	Title            string
	H1               string
	Addrs            []multiaddr.Multiaddr
	ProtectedPeers   p2peer.IDSlice
	UnprotectedPeers p2peer.IDSlice
}

func (*RelayDocument) String

func (d *RelayDocument) String() string

type WebHandler

type WebHandler interface {
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

WebHandler is an interface for handling web requests.

Jump to

Keyboard shortcuts

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