Documentation ¶
Index ¶
- Constants
- func FromArgs(args ...interface{}) (values map[string]string)
- func GetPath(pa string) string
- func GetValue(args map[string]string, keys ...string) (value string, ok bool)
- func ParsePair(s string) (key, value string)
- func ParseSocks(metadata ...string) (string, error)
- func Split(s, sep string) (elements []string)
- func Trim(s string) string
- func TrimSpace(s string) string
- type DeviceConfig
- type DeviceSetting
- type PeerConfig
- type VirtualTun
Constants ¶
View Source
const ( LogLevelSilent = iota LogLevelError LogLevelVerbose )
Variables ¶
This section is empty.
Functions ¶
func ParseSocks ¶
Types ¶
type DeviceConfig ¶
type DeviceConfig struct { SecretKey string `json:"PrivateKey"` Endpoint []netip.Addr `json:"Address"` Peers []*PeerConfig `json:"Peers"` DNS []netip.Addr `json:"DNS"` MTU int `json:"MTU"` ListenPort int `json:"ListenPort"` }
func FromBytes ¶
func FromBytes(b []byte) (*DeviceConfig, error)
func FromFile ¶
func FromFile(file string) (*DeviceConfig, error)
func ParseInterface ¶
func ParseInterface(metadata ...string) (device *DeviceConfig, err error)
func (*DeviceConfig) DeviceAddr ¶
func (d *DeviceConfig) DeviceAddr() []netip.Addr
func (*DeviceConfig) IPCRequest ¶
func (d *DeviceConfig) IPCRequest() string
func (*DeviceConfig) Up ¶
func (d *DeviceConfig) Up(level int) (*VirtualTun, error)
type DeviceSetting ¶
type DeviceSetting struct {
// contains filtered or unexported fields
}
type PeerConfig ¶
type PeerConfig struct { PublicKey string `json:"PublicKey"` Endpoint string `json:"Endpoint "` KeepAlive int `json:"PersistentKeepalive"` AllowedIPs []netip.Prefix `json:"AllowedIPs"` }
func ParsePeers ¶
func ParsePeers(metadata ...string) (peer *PeerConfig, err error)
type VirtualTun ¶
Click to show internal directories.
Click to hide internal directories.