Documentation ¶
Overview ¶
Package point_c allows Caddy to manage networks.
Index ¶
- Constants
- type Dialer
- type Net
- type NetLookup
- type NetOp
- type Network
- type Pointc
- func (*Pointc) CaddyModule() caddy.ModuleInfo
- func (pc *Pointc) Cleanup() error
- func (pc *Pointc) Lookup(name string) (Net, bool)
- func (pc *Pointc) Provision(ctx caddy.Context) error
- func (pc *Pointc) Register(key string, n Net) error
- func (pc *Pointc) Start() error
- func (pc *Pointc) Stop() error
- func (pc *Pointc) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- type RegisterFunc
Constants ¶
const (
CaddyfilePointCName = "point-c"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Net ¶
type Net interface { // Listen listens on the given address with the TCP protocol. Listen(addr *net.TCPAddr) (net.Listener, error) // ListenPacket listens on the given address with the UDP protocol. ListenPacket(addr *net.UDPAddr) (net.PacketConn, error) // Dialer returns a [Dialer] with a given local address. If the network does not support arbitrary remote addresses this value can be ignored. Dialer(laddr net.IP, port uint16) Dialer // LocalAddr is the local address of the net interface. If it does not have one, return nil. LocalAddr() net.IP }
Net is a peer in the networking stack. If it has a local address [Net.LocalAddress] should return a non-nil value.
type NetOp ¶
type NetOp = lifecycler.LifeCyclable[NetLookup]
NetOp is implemented by modules in the "point-c.op" namespace.
type Network ¶
type Network = lifecycler.LifeCyclable[RegisterFunc]
Network is implemented by modules in the "point-c.net" namespace.
type Pointc ¶
type Pointc struct { NetworksRaw []json.RawMessage `json:"networks,omitempty" caddy:"namespace=point-c.net inline_key=type"` NetOps []json.RawMessage `json:"net-ops,omitempty" caddy:"namespace=point-c.op inline_key=op"` // contains filtered or unexported fields }
Pointc allows usage of networks through a net-ish interface.
func (*Pointc) CaddyModule ¶
func (*Pointc) CaddyModule() caddy.ModuleInfo
CaddyModule implements caddy.Module.
func (*Pointc) Provision ¶
Provision implements caddy.Provisioner.
type RegisterFunc ¶
RegisterFunc registers a unique name to a Net tunnel. Since ip addresses may be arbitrary depending on what the application is doing in the tunnel, names are used as lookup. This also helps with configuration, so that users don't need to remember ip addresses.