Documentation
¶
Index ¶
- type Config
- type IPNet
- type PrivateKey
- type PublicKey
- type Tunnel
- func (t *Tunnel) Close() error
- func (t *Tunnel) DialContext(ctx context.Context, network, addr string) (net.Conn, error)
- func (t *Tunnel) ListenPing() (*netstack.PingConn, error)
- func (t *Tunnel) LookupAAAA(ctx context.Context, name string) ([]net.IP, error)
- func (t *Tunnel) LookupTXT(ctx context.Context, name string) ([]string, error)
- func (t *Tunnel) Resolver() *net.Resolver
- type WireGuardState
- type WsWgProxy
- Bugs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
LocalPrivateKey PrivateKey `toml:"local_private_key"`
LocalNetwork *IPNet `toml:"local_network"`
RemotePublicKey PublicKey `toml:"remote_public_key"`
RemoteNetwork *IPNet `toml:"remote_network"`
Endpoint string `toml:"endpoint"`
DNS net.IP `toml:"dns"`
KeepAlive int `toml:"keepalive"`
MTU int `toml:"mtu"`
LogLevel int `toml:"log_level"`
}
type IPNet ¶
type IPNet net.IPNet
func (*IPNet) MarshalText ¶
func (n *IPNet) MarshalText() ([]byte, error)
func (*IPNet) UnmarshalText ¶
func (n *IPNet) UnmarshalText(text []byte) error
type PrivateKey ¶
type PrivateKey device.NoisePrivateKey
func (PrivateKey) MarshalText ¶
func (pk PrivateKey) MarshalText() ([]byte, error)
func (*PrivateKey) UnmarshalText ¶
func (pk *PrivateKey) UnmarshalText(text []byte) error
type PublicKey ¶
type PublicKey device.NoisePublicKey
func (PublicKey) MarshalText ¶
func (pk PublicKey) MarshalText() ([]byte, error)
func (*PublicKey) UnmarshalText ¶
func (pk *PublicKey) UnmarshalText(text []byte) error
type Tunnel ¶
type Tunnel struct {
State *WireGuardState
Config *Config
// contains filtered or unexported fields
}
func ConnectWS ¶ added in v0.0.320
func ConnectWS(ctx context.Context, state *WireGuardState) (*Tunnel, error)
func (*Tunnel) DialContext ¶
func (t *Tunnel) DialContext(ctx context.Context, network, addr string) (net.Conn, error)
func (*Tunnel) ListenPing ¶ added in v0.0.296
func (t *Tunnel) ListenPing() (*netstack.PingConn, error)
func (*Tunnel) LookupAAAA ¶ added in v0.0.233
func (t *Tunnel) LookupAAAA(ctx context.Context, name string) ([]net.IP, error)
type WireGuardState ¶ added in v0.0.216
type WireGuardState struct {
Org string `json:"org"`
Name string `json:"name"`
Region string `json:"region"`
LocalPublic string `json:"localprivate"`
LocalPrivate string `json:"localpublic"`
DNS string `json:"dns"`
Peer api.CreatedWireGuardPeer `json:"peer"`
}
func (*WireGuardState) TunnelConfig ¶ added in v0.0.216
func (s *WireGuardState) TunnelConfig() *Config
BUG(tqbf): Obviously all this needs to go, and I should just make my code conform to the marshal/unmarshal protocol wireguard-go uses, but in the service of landing this feature, I'm just going to apply a layer of spackle for now.
type WsWgProxy ¶ added in v0.0.320
type WsWgProxy struct {
// contains filtered or unexported fields
}
func NewWsWgProxy ¶ added in v0.0.320
func NewWsWgProxy() (*WsWgProxy, error)
Notes ¶
Bugs ¶
Obviously all this needs to go, and I should just make my code conform to the marshal/unmarshal protocol wireguard-go uses, but in the service of landing this feature, I'm just going to apply a layer of spackle for now.
for now, we never manage tunnels for different organizations, and while this comment is eating more space than the code I'd need to do this right, it's more fun to type, so we just hardcode.
I think this dance just because these needed to parse for Ben's TOML code.