registry

package
v0.0.0-...-af941b8 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package registry implements extra error handling over MeshAPI request

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry structure holds necessary data to execute API calls

func NewRegistry

func NewRegistry(
	reg mesh.Registry,
	publisher events.Publisher[any],
) *Registry

NewRegistry create new Registry instance

func (*Registry) Configure

func (r *Registry) Configure(
	token string,
	id uuid.UUID,
	peerID uuid.UUID,
	peerInfo mesh.PeerUpdateRequest,
) error

Configure interaction with specific peer.

func (*Registry) List

func (r *Registry) List(token string, self uuid.UUID) (resp mesh.MachinePeers, err error)

List given peer's neighbours in the mesh network.

func (*Registry) Local

func (r *Registry) Local(token string) (mesh.Machines, error)

Local peers owned the same user.

func (*Registry) Map

func (r *Registry) Map(token string, self uuid.UUID) (resp *mesh.MachineMap, err error)

func (*Registry) NotifyNewTransfer

func (r *Registry) NotifyNewTransfer(
	token string,
	self uuid.UUID,
	peer uuid.UUID,
	fileName string,
	fileCount int,
	transferID string,
) error

func (*Registry) Register

func (r *Registry) Register(token string, self mesh.Machine) (*mesh.Machine, error)

Register Self to mesh network.

func (*Registry) SetNotificationSubject

func (r *Registry) SetNotificationSubject(pub events.Publisher[any])

func (*Registry) Unpair

func (r *Registry) Unpair(token string, self uuid.UUID, peer uuid.UUID) error

Unpair invited peer.

func (*Registry) Unregister

func (r *Registry) Unregister(token string, self uuid.UUID) error

Unregister Peer from the mesh network.

func (*Registry) Update

func (r *Registry) Update(token string, id uuid.UUID, info mesh.MachineUpdateRequest) error

Update already registered peer.

Jump to

Keyboard shortcuts

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