service

package
v0.0.0-...-b926886 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Unlicense Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger *slog.Logger
	Host   host.Host
	DHT    *dht.IpfsDHT
}

type Handler

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

func Register

func Register(cfg *Config, svc *Service) (h *Handler, err error)

func (*Handler) Close

func (h *Handler) Close() (err error)

Unregisters the handler for the host

func (*Handler) Protocol

func (h *Handler) Protocol() (protocol protocol.ID)

type Service

type Service struct {
	// Protocol of the service to advertise
	Protocol protocol.ID
	// Addresses to advertise the service. If more than one address is used it will work as a load balancer.
	Addresses []multiaddr.Multiaddr
	// Optional. Allowed peers to permit access to consume this service
	AllowedPeers []peer.ID
	// Optional. If a DHT is available the service will be advertised within it.
	Advertise bool
	// Optional interval to use for advertising
	AdvertiseInterval time.Duration
}

Jump to

Keyboard shortcuts

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