Documentation ¶
Index ¶
- Constants
- func RandomIP4(A string) string
- func RandomIP6() string
- type Client
- func (c *Client) AllowedIps(srv *Server) string
- func (c *Client) GetFileName() string
- func (c *Client) GetIP4(srv *Server) string
- func (c *Client) GetIP6(srv *Server) string
- func (c *Client) GetIPNumber() int
- func (c *Client) GetIPNumberString() string
- func (c *Client) GetName() string
- func (c *Client) GetPlainTextConfig(srv *Server) (string, error)
- func (c *Client) WriteOnce(dir string) error
- type Server
- type ServerBlueprint
- type State
- func (s *State) AddPeer(peerName string) error
- func (s *State) CanAddPeer(peerName string) (int, error)
- func (s *State) DeletePeer(idx int) error
- func (s *State) GenerateWireguardFile(wgConfigPath string, backup bool) error
- func (s *State) IterateClients(f func(*Client) error) error
- func (s *State) JoinPath(path string) string
Constants ¶
View Source
const PeerNameRegExp = `([A-Za-z][0-9A-Za-z-_]*)`
View Source
const ServerFileName = `0001-server.toml`
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { PublicKey string PrivateKey string ClientRoute string AddServerRoute string MTU int DNS string // contains filtered or unexported fields }
func ReadClient ¶
func (*Client) AllowedIps ¶
func (*Client) GetFileName ¶
func (*Client) GetIPNumber ¶
func (*Client) GetIPNumberString ¶
func (*Client) GetPlainTextConfig ¶
type Server ¶
type Server struct { Interface string Address4 string Address6 string PrivateKey string PublicKey string ListenPort uint16 PostUp4 string PostDown4 string PostUp6 string PostDown6 string ClientRoute string ClientDNS string ClientServerEndpoint string MTU int ClientPersistentKeepalive int // contains filtered or unexported fields }
func NewServerWithBlueprint ¶
func NewServerWithBlueprint(b ServerBlueprint) *Server
func (*Server) GetInterfaceString ¶
func (*Server) WriteInterfaceBlock ¶
type ServerBlueprint ¶
type State ¶
type State struct { Server *Server Clients map[int]*Client // contains filtered or unexported fields }
func (*State) DeletePeer ¶
func (*State) GenerateWireguardFile ¶
Click to show internal directories.
Click to hide internal directories.