services

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: 9 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 = func(message.Stream)

type Network

type Network struct {
	Services Services
	*message.Client
}

func NewNetwork

func NewNetwork(router routing.Router) *Network

func (*Network) RegisterService

func (n *Network) RegisterService(id peer.ID, address *api.ServiceAddress, handler Handler) bool

type Services

type Services map[string]map[peer.ID]Handler

func (Services) Dial

func (s Services) Dial(ctx context.Context, addr multiaddr.Multiaddr) (message.Stream, error)

func (Services) Register

func (s Services) Register(id peer.ID, address *api.ServiceAddress, handler Handler) bool

Jump to

Keyboard shortcuts

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