wg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package wg is a point-c network for a WireGuard tunnel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Name      configvalues.Hostname     `json:"name"`
	Endpoint  configvalues.UDPAddr      `json:"endpoint"`
	IP        configvalues.IP           `json:"ip"`
	Private   configvalues.PrivateKey   `json:"private"`
	Public    configvalues.PublicKey    `json:"public"`
	Preshared configvalues.PresharedKey `json:"preshared"`
	// contains filtered or unexported fields
}

Client is a basic wireguard client.

func (*Client) CaddyModule

func (*Client) CaddyModule() caddy.ModuleInfo

func (*Client) Cleanup

func (c *Client) Cleanup() error

func (*Client) Provision

func (c *Client) Provision(ctx caddy.Context) error

func (*Client) Start

func (c *Client) Start(fn pointc.RegisterFunc) error

func (*Client) UnmarshalCaddyfile

func (c *Client) UnmarshalCaddyfile(d *caddyfile.Dispenser) (err error)

UnmarshalCaddyfile unmarshals a config in caddyfile form.

{
  point-c {
    wgclient <name> {
      ip <tunnel ip>
      endpoint <server address/ip>
      private <client private key>
      public <server public key>
      shared <shared key>
  }
}

type Server

type Server struct {
	Name       configvalues.Hostname   `json:"hostname"`
	IP         configvalues.IP         `json:"ip"`
	ListenPort configvalues.Port       `json:"listen-port"`
	Private    configvalues.PrivateKey `json:"private"`
	Peers      []*ServerPeer           `json:"peers"`
	// contains filtered or unexported fields
}

Server is a basic wireguard server.

func (*Server) CaddyModule

func (*Server) CaddyModule() caddy.ModuleInfo

func (*Server) Cleanup

func (c *Server) Cleanup() error

func (*Server) Provision

func (c *Server) Provision(ctx caddy.Context) error

func (*Server) Start

func (c *Server) Start(fn pointc.RegisterFunc) error

func (*Server) UnmarshalCaddyfile

func (c *Server) UnmarshalCaddyfile(d *caddyfile.Dispenser) (err error)

UnmarshalCaddyfile unmarshals a config in caddyfile form.

	{
	  point-c {
	    wgserver <name> {
	      ip <server ip>
	      port <server port to listen on>
	      private <server private key>
          peer <name> {
              ip <client ip>
	          public <client public key>
	          shared <shared key>
            }
	    }
	}

type ServerPeer

type ServerPeer struct {
	Name         configvalues.Hostname     `json:"hostname"`
	Public       configvalues.PublicKey    `json:"public"`
	PresharedKey configvalues.PresharedKey `json:"preshared"`
	IP           configvalues.IP           `json:"ip"`
}

Server is a basic wireguard server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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