Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WatchEntitiesWithRetry ¶
func WatchEntitiesWithRetry(ctx context.Context, client proto.WorldServiceClient, req *proto.ListEntitiesRequest) (proto.WorldService_WatchEntitiesClient, error)
Types ¶
type Connection ¶
type Connection struct {
*grpc.ClientConn
Tunnel *WireGuardTunnel // nil for non-WireGuard connections
}
Connection wraps a gRPC connection with optional WireGuard tunnel
func Connect ¶
func Connect(serverURL string) (*Connection, error)
Connect establishes a gRPC connection to the server. serverURL can be "host:port", "https://host", or "https://user:pass@host".
func ConnectWithWireGuard ¶
func ConnectWithWireGuard(serverAddr string, wgConfigPath string) (*Connection, error)
ConnectWithWireGuard establishes a gRPC connection through a WireGuard tunnel
func (*Connection) Close ¶
func (c *Connection) Close() error
Close closes the connection and tunnel if present
type WireGuardConfig ¶
type WireGuardConfig struct {
PrivateKey string // client's WireGuard private key (base64)
Address netip.Addr // client's IP in the WireGuard network
PeerPublicKey string // server's WireGuard public key (base64)
Endpoint string // WireGuard endpoint (host:port)
}
WireGuardConfig holds the configuration for a WireGuard tunnel
func ParseWireGuardConfig ¶
func ParseWireGuardConfig(path string) (*WireGuardConfig, error)
ParseWireGuardConfig parses a standard WireGuard config file
type WireGuardTunnel ¶
type WireGuardTunnel struct {
// contains filtered or unexported fields
}
WireGuardTunnel represents an active userspace WireGuard tunnel
func ConnectViaWireGuard ¶
func ConnectViaWireGuard(serverAddr string, wgCfg *WireGuardConfig) (*grpc.ClientConn, *WireGuardTunnel, error)
ConnectViaWireGuard creates a gRPC connection through a WireGuard tunnel
func NewWireGuardTunnel ¶
func NewWireGuardTunnel(cfg *WireGuardConfig) (*WireGuardTunnel, error)
NewWireGuardTunnel creates a new userspace WireGuard tunnel
func (*WireGuardTunnel) Close ¶
func (t *WireGuardTunnel) Close() error
Close shuts down the WireGuard tunnel