wg

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForeignInterface

type ForeignInterface struct {
	Name      string
	Addresses []string
	Mtu       int
	State     string
}

type ForeignPeer

type ForeignPeer struct {
	PublicKey                   string
	Endpoint                    *string
	AllowedIPs                  []string
	PersistentKeepaliveInterval float64
	LastHandshakeTime           time.Time
	ReceiveBytes                int64
	TransmitBytes               int64
	ProtocolVersion             int
}

type ForeignServer

type ForeignServer struct {
	ForeignInterface *ForeignInterface
	Name             string
	Type             string
	PublicKey        string
	ListenPort       int
	FirewallMark     int
	Peers            []*ForeignPeer
}

type PeerStats

type PeerStats struct {
	LastHandshakeTime time.Time
	ReceiveBytes      int64
	TransmitBytes     int64
	ProtocolVersion   int
}

type Service

type Service interface {
	Close() error
	ForeignServers(ctx context.Context) (foreignServers []*ForeignServer, err error)
	ImportForeignServer(ctx context.Context, name string, userId string) (*server.Server, error)
	StartServer(ctx context.Context, serverId string) (*server.Server, error)
	StopServer(ctx context.Context, serverUd string) (*server.Server, error)
	ConfigureWireGuard(name string, privateKey string, listenPort *int, firewallMark *int, peers []*peer.Peer) error
	PeerStats(name string, peerPublicKey string) (*PeerStats, error)
	AddPeer(ctx context.Context, peerId string) error
	UpdatePeer(ctx context.Context, peerId string) error
	RemovePeer(ctx context.Context, peerId string) error
}

func NewService

func NewService(serverService server.Service, peerService peer.Service) (Service, error)

Jump to

Keyboard shortcuts

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