Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Authenticate() error
- func (c *Client) BringDeviceUp(deviceName string) error
- func (c *Client) Close()
- func (c *Client) Connect() error
- func (c *Client) CreateDeviceInConfigFile(msg *MsgCreateDeviceInConfigFile) error
- func (c *Client) CreatePeers(msg *MsgCreatePeersInMemory) error
- func (c *Client) GetDevice(deviceName string) (*MsgGetDeviceResponse, error)
- func (c *Client) GetPeers(deviceName string) (*MsgGetPeersResponse, error)
- func (c *Client) IsConnected() bool
- func (c *Client) IsDeviceAlive(deviceName string) error
- func (c *Client) RemovePeer(msg *MsgRemovePeerInMemory) error
- func (c *Client) SetProxyPeerInConfigFile(msg *MsgSetProxyPeerInConfigFile) error
- func (c *Client) TakeDeviceDown(deviceName string) error
- type CreatePeerInMemory
- type Device
- type MsgAuthenticate
- type MsgBringDeviceUp
- type MsgCreateDeviceInConfigFile
- type MsgCreatePeersInMemory
- type MsgError
- type MsgGetDevice
- type MsgGetDeviceResponse
- type MsgGetPeers
- type MsgGetPeersResponse
- type MsgIsDeviceAlive
- type MsgRemovePeerInMemory
- type MsgSetProxyPeerInConfigFile
- type MsgTakeDeviceDown
- type MsgType
- type Peer
Constants ¶
View Source
const MaxMsgSize = 1024 * 1024 * 1024
View Source
const UnixSocketName = "@cyclops-wg"
const UnixSocketName = "/var/opt/kernelwg"
Variables ¶
View Source
var ErrNotConnected = errors.New("Not connected to root wireguard process") // This is generated client-side
Well known error messages
View Source
var ErrWireguardDeviceNotExist = errors.New("Wireguard device does not exist")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client can only be used by a single thread at a time. There is a giant lock that ensures this.
func (*Client) Authenticate ¶
func (*Client) BringDeviceUp ¶
func (*Client) CreateDeviceInConfigFile ¶
func (c *Client) CreateDeviceInConfigFile(msg *MsgCreateDeviceInConfigFile) error
func (*Client) CreatePeers ¶
func (c *Client) CreatePeers(msg *MsgCreatePeersInMemory) error
func (*Client) GetDevice ¶
func (c *Client) GetDevice(deviceName string) (*MsgGetDeviceResponse, error)
func (*Client) GetPeers ¶
func (c *Client) GetPeers(deviceName string) (*MsgGetPeersResponse, error)
func (*Client) IsConnected ¶
func (*Client) IsDeviceAlive ¶
func (*Client) RemovePeer ¶
func (c *Client) RemovePeer(msg *MsgRemovePeerInMemory) error
func (*Client) SetProxyPeerInConfigFile ¶
func (c *Client) SetProxyPeerInConfigFile(msg *MsgSetProxyPeerInConfigFile) error
func (*Client) TakeDeviceDown ¶
type CreatePeerInMemory ¶
type MsgAuthenticate ¶
type MsgAuthenticate struct {
Secret string
}
type MsgBringDeviceUp ¶ added in v1.0.5
type MsgBringDeviceUp struct {
DeviceName string
}
type MsgCreatePeersInMemory ¶
type MsgCreatePeersInMemory struct { DeviceName string Peers []CreatePeerInMemory }
type MsgGetDevice ¶ added in v1.0.5
type MsgGetDevice struct {
DeviceName string
}
type MsgGetDeviceResponse ¶
type MsgGetPeers ¶ added in v1.0.5
type MsgGetPeers struct {
DeviceName string
}
type MsgGetPeersResponse ¶
type MsgGetPeersResponse struct {
Peers []Peer
}
type MsgIsDeviceAlive ¶ added in v1.0.5
type MsgIsDeviceAlive struct {
DeviceName string
}
type MsgRemovePeerInMemory ¶
type MsgTakeDeviceDown ¶ added in v1.0.5
type MsgTakeDeviceDown struct {
DeviceName string
}
type MsgType ¶
type MsgType int
const ( MsgTypeNone MsgType = iota MsgTypeError MsgTypeAuthenticate MsgTypeIsDeviceAlive MsgTypeGetDevice MsgTypeGetDeviceResponse MsgTypeGetPeers MsgTypeGetPeersResponse MsgTypeBringDeviceUp MsgTypeTakeDeviceDown MsgTypeCreatePeersInMemory MsgTypeRemovePeerInMemory MsgTypeCreateDeviceInConfigFile MsgTypeSetProxyPeerInConfigFile )
Click to show internal directories.
Click to hide internal directories.