templates

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed Dockerfile
	Dockerfile string
	//go:embed client_modules.json
	ClientConfig []byte
	//go:embed server_modules.json
	ServerConfig []byte
	//go:embed Caddyfile.client
	CaddyfileClient string
	//go:embed Caddyfile.server
	CaddyfileServer string
)

Functions

func ApplyTemplate

func ApplyTemplate(t errs2.Testing, tmpl string, dot any) []byte

func DeJSON

func DeJSON[T any](t errs2.Testing, b []byte) (v T)

func NewDotPair

func NewDotPair(t errs2.Testing) (DotServer, DotClient)

Types

type Dot

type Dot interface {
	ApplyTemplate(errs2.Testing) []byte
}

type DotClient

type DotClient struct {
	NetworkName  string
	IP           net.IP
	Endpoint     string
	EndpointPort uint16
	Private      wgapi.PrivateKey
	Public       wgapi.PublicKey
	Shared       wgapi.PresharedKey
}

func (DotClient) ApplyTemplate

func (dc DotClient) ApplyTemplate(t errs2.Testing) []byte

type DotDockerfile

type DotDockerfile struct {
	Caddy string   `json:"caddy"`
	Mods  []string `json:"mods"`
}

func (DotDockerfile) ApplyTemplate

func (dd DotDockerfile) ApplyTemplate(t errs2.Testing) []byte

type DotServer

type DotServer struct {
	NetworkName    string
	FwdNetworkName string
	IP             net.IP
	Port           uint16
	Private        wgapi.PrivateKey
	Peers          []DotServerPeer
}

func (DotServer) ApplyTemplate

func (ds DotServer) ApplyTemplate(t errs2.Testing) []byte

type DotServerPeer

type DotServerPeer struct {
	NetworkName string
	IP          net.IP
	Public      wgapi.PublicKey
	Shared      wgapi.PresharedKey
}

Jump to

Keyboard shortcuts

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