consul

package
v0.0.0-...-31dd5a7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consul

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

func New

func New(endpoint string) (*Consul, error)

func (*Consul) AddPeer

func (cb *Consul) AddPeer(location string, wgInterface wireguard.Interface, peer wireguard.Peer) error

func (*Consul) GetPeers

func (cb *Consul) GetPeers(location string) ([]wireguard.Peer, error)

func (*Consul) Lock

func (cb *Consul) Lock(location string, value string) error

func (*Consul) MonitorKv

func (cb *Consul) MonitorKv(location string, wgInterface wireguard.Interface)

func (*Consul) MonitorNodes

func (cb *Consul) MonitorNodes(location string, wgInterface wireguard.Interface)

func (*Consul) Unlock

func (cb *Consul) Unlock()

type ConsulService

type ConsulService interface {
	//location can be a key for K/V stores or table for databases,....
	Lock(location string, value string) error
	//unlock the lock
	Unlock()
	//get all peers
	GetPeers(location string) ([]wireguard.Peer, error)
	// add a peer
	AddPeer(location string, wgInterface wireguard.Interface, peer wireguard.Peer) error
	// monitor the K/V store for changes
	MonitorKv(location string, wgInterface wireguard.Interface)
	// monitor the nodes for changes
	MonitorNodes(location string, wgInterface wireguard.Interface)
}

Jump to

Keyboard shortcuts

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