Documentation
¶
Overview ¶
Package rait provides the core logic of rait
Index ¶
- type ErrDecode
- type Instance
- func (instance *Instance) EnsureInterface(peer *Peer) (netlink.Link, error)
- func (instance *Instance) IsManagedInterface(link netlink.Link) bool
- func (instance *Instance) ListInterfaces() ([]netlink.Link, error)
- func (instance *Instance) LoadPeers() ([]*Peer, error)
- func (instance *Instance) RenderTemplate(in string, out string) error
- func (instance *Instance) SyncInterfaces(up bool) error
- func (instance *Instance) WireguardConfig(peer *Peer) (string, *wgtypes.Config, error)
- type Peer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct { PrivateKey wgtypes.Key // mandatory, the private key of the client AddressFamily string // optional, default ip4, the address family of the client, ip4 or ip6 SendPort int // mandatory, the sending port of the client InterfacePrefix string // optional, default rait, the common prefix to name the wireguard interfaces InterfaceGroup int // optional, default 54, the ifgroup for the wireguard interfaces InterfaceNamespace netns.NsHandle // optional, default current, the netns to move wireguard interface into TransitNamespace netns.NsHandle // optional, default current, the netns to create wireguard sockets in MTU int // optional, default 1400, the MTU of the wireguard interfaces FwMark int // optional, default 54, the fwmark on packets sent by wireguard Peers string // optional, default /etc/rait/peers.conf, the url of the peer list }
Instance represents the control structure of RAIT
func InstanceFromMap ¶
func InstanceFromPath ¶
func (*Instance) EnsureInterface ¶
func (*Instance) IsManagedInterface ¶
func (*Instance) ListInterfaces ¶
func (*Instance) RenderTemplate ¶
RenderTemplate gathers information about interfaces and renders the liquid template
func (*Instance) SyncInterfaces ¶
type Peer ¶
type Peer struct { PublicKey wgtypes.Key // mandatory, the public key of the peer AddressFamily string // optional, default ip4, the address family of the specified endpoint, ip4 or ip6 Endpoint net.IP // optional, default localhost, the endpoint ip address or resolvable domain name SendPort int // mandatory, the sending port of the peer }
Peer represents a single wireguard peer which corresponds to an interface in RAIT
func PeerFromMap ¶
func PeersFromPath ¶
Click to show internal directories.
Click to hide internal directories.