service

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDeviceNotFound = errors.New("device not found")
View Source
var ErrInvalidPrivateKey = errors.New("invalid private key")

Functions

This section is empty.

Types

type Device

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

func NewDevice

func NewDevice() (*Device, error)

func (*Device) GetDevice

func (d *Device) GetDevice(ctx context.Context, name string, filterPublicKeys []string) (*wgtypes.Device, error)

func (*Device) GetDevices

func (d *Device) GetDevices(ctx context.Context, filterPublicKeys []string) ([]*wgtypes.Device, error)

func (*Device) UpdatePrivateKey added in v0.2.0

func (d *Device) UpdatePrivateKey(ctx context.Context, name string, privateKey string) error

type Peer

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

func NewPeer

func NewPeer(device *Device, ipRouter routes.IPRouter) (*Peer, error)

func (*Peer) DeletePeers

func (p *Peer) DeletePeers(ctx context.Context, deviceName string, publicKeys []string) error

func (*Peer) GetPeers

func (p *Peer) GetPeers(ctx context.Context, deviceName string, filterPublicKeys []string) ([]wgtypes.Peer, error)

func (*Peer) RegisterPeers

func (p *Peer) RegisterPeers(ctx context.Context, deviceName string, peers []wgtypes.Peer) error

Jump to

Keyboard shortcuts

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