relay

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientKey

type ClientKey struct {
	Endpoint model.Endpoint `json:"endpoint"`
	Role     model.Role     `json:"role"`
	Key      model.Key      `json:"key"`
}

type ClientValue

type ClientValue struct {
	Cert *x509.Certificate `json:"cert"`
}

func (ClientValue) MarshalJSON

func (v ClientValue) MarshalJSON() ([]byte, error)

func (*ClientValue) UnmarshalJSON

func (v *ClientValue) UnmarshalJSON(b []byte) error

type Config

type Config struct {
	Metadata string

	ControlAddr  *net.UDPAddr
	ControlHost  string
	ControlToken string
	ControlCAs   *x509.CertPool

	HandshakeIdleTimeout time.Duration

	Ingress []Ingress

	Stores Stores

	Logger *slog.Logger
}

type ConfigKey

type ConfigKey string

type ConfigValue

type ConfigValue struct {
	Int64  int64  `json:"int64,omitempty"`
	String string `json:"string,omitempty"`
	Bytes  []byte `json:"bytes,omitempty"`
}

type EndpointPeerStatus added in v0.13.0

type EndpointPeerStatus struct {
	Key      model.Key `json:"key"`
	Metadata string    `json:"metadata"`
}

type EndpointStatus

type EndpointStatus struct {
	Endpoint     model.Endpoint                   `json:"endpoint"`
	Destinations map[model.Key]EndpointPeerStatus `json:"destinations"`
	Sources      map[model.Key]EndpointPeerStatus `json:"sources"`
}

type Ingress

type Ingress struct {
	Addr      *net.UDPAddr
	Hostports []model.HostPort
	Restr     restr.IP
}

type IngressBuilder

type IngressBuilder struct {
	// contains filtered or unexported fields
}

func NewIngressBuilder

func NewIngressBuilder() *IngressBuilder

func (*IngressBuilder) Error

func (b *IngressBuilder) Error() error

func (*IngressBuilder) Ingress

func (b *IngressBuilder) Ingress() (Ingress, error)

func (*IngressBuilder) WithAddr

func (b *IngressBuilder) WithAddr(addr *net.UDPAddr) *IngressBuilder

func (*IngressBuilder) WithAddrFrom

func (b *IngressBuilder) WithAddrFrom(addrStr string) *IngressBuilder

func (*IngressBuilder) WithHostport

func (b *IngressBuilder) WithHostport(hp model.HostPort) *IngressBuilder

func (*IngressBuilder) WithHostportFrom

func (b *IngressBuilder) WithHostportFrom(hostport string) *IngressBuilder

func (*IngressBuilder) WithHostports

func (b *IngressBuilder) WithHostports(hps []model.HostPort) *IngressBuilder

func (*IngressBuilder) WithRestr

func (b *IngressBuilder) WithRestr(iprestr restr.IP) *IngressBuilder

func (*IngressBuilder) WithRestrFrom

func (b *IngressBuilder) WithRestrFrom(allows []string, denies []string) *IngressBuilder

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg Config) (*Server, error)

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

func (*Server) Status

func (s *Server) Status(ctx context.Context) (Status, error)

type ServerKey

type ServerKey struct {
	Endpoint model.Endpoint `json:"endpoint"`
}

type ServerValue

type ServerValue struct {
	Name    string                          `json:"name"`
	Cert    *certc.Cert                     `json:"cert"`
	Clients map[serverClientKey]ClientValue `json:"clients"`
}

func (ServerValue) MarshalJSON

func (v ServerValue) MarshalJSON() ([]byte, error)

func (*ServerValue) UnmarshalJSON

func (v *ServerValue) UnmarshalJSON(b []byte) error

type Status

type Status struct {
	Status       statusc.Status            `json:"status"`
	BuildVersion string                    `json:"build-version"`
	Hostports    []string                  `json:"hostports"`
	ServerAddr   string                    `json:"server-addrress"`
	ServerID     string                    `json:"server-id"`
	Endpoints    map[string]EndpointStatus `json:"endpoints"`
}

type Stores

type Stores interface {
	Config() (logc.KV[ConfigKey, ConfigValue], error)
	Clients() (logc.KV[ClientKey, ClientValue], error)
	Servers() (logc.KV[ServerKey, ServerValue], error)
}

func NewFileStores

func NewFileStores(dir string) Stores

type TransportsFn

type TransportsFn func(ctx context.Context) ([]*quic.Transport, error)

Jump to

Keyboard shortcuts

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