services

package
v0.0.0-...-b517edd Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureForwarding

func ConfigureForwarding(wgIface string, gatewayIface string, cidr string) error

func ConfigureRouting

func ConfigureRouting(wgIface string, cidr string) error

func ExecUserWireGuard

func ExecUserWireGuard(wgcommand string, ifaceName string) error

func MustParseCIDR

func MustParseCIDR(cidr string) (net.IP, *net.IPNet)

func MustParseIP

func MustParseIP(ip string) net.IP

func ServerVPNIP

func ServerVPNIP(cidr string) *net.IPNet

Types

type DNSServer

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

func NewDNSServer

func NewDNSServer(upstream []string) (*DNSServer, error)

func (*DNSServer) Close

func (d *DNSServer) Close() error

func (*DNSServer) Lookup

func (d *DNSServer) Lookup(m *dns.Msg) (*dns.Msg, error)

func (*DNSServer) ServeDNS

func (d *DNSServer) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

type DeviceManager

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

func NewDeviceManager

func NewDeviceManager(w *WireGuard, s storage.Storage, cidr string) *DeviceManager

func (*DeviceManager) AddDevice

func (d *DeviceManager) AddDevice(user string, name string, publicKey string) (*storage.Device, error)

func (*DeviceManager) DeleteDevice

func (d *DeviceManager) DeleteDevice(user string, name string) error

func (*DeviceManager) ListDevices

func (d *DeviceManager) ListDevices(user string) ([]*storage.Device, error)

func (*DeviceManager) Sync

func (d *DeviceManager) Sync() error

type WireGuard

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

func NewWireGuard

func NewWireGuard(iface string, privateKey string, port int, externalAddress string, dns []string) (*WireGuard, error)

func (*WireGuard) AddPeer

func (s *WireGuard) AddPeer(publicKey string, addressCIDR string) error

func (*WireGuard) Close

func (s *WireGuard) Close() error

func (*WireGuard) DNS

func (s *WireGuard) DNS() string

func (*WireGuard) Device

func (s *WireGuard) Device() (*wgtypes.Device, error)

func (*WireGuard) Endpoint

func (s *WireGuard) Endpoint() string

func (*WireGuard) HasPeer

func (s *WireGuard) HasPeer(publicKey string) bool

func (*WireGuard) ListPeers

func (s *WireGuard) ListPeers() ([]wgtypes.Peer, error)

func (*WireGuard) Peer

func (s *WireGuard) Peer(publicKey string) (*wgtypes.Peer, error)

func (*WireGuard) PublicKey

func (s *WireGuard) PublicKey() string

func (*WireGuard) RemovePeer

func (s *WireGuard) RemovePeer(publicKey string) error

Jump to

Keyboard shortcuts

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