Documentation ¶
Index ¶
- Constants
- func BuildBinary(name string) (string, []any, error)
- func CleanupBinary()
- func GracefullyTerminate(cmd *g.Cmd) error
- type Agent
- func (a *Agent) Close() error
- func (a *Agent) ConfigureWireGuardInterfaces() error
- func (a *Agent) OnEvent(e *rpcproto.Event)
- func (a *Agent) Shadowed(path string) string
- func (a *Agent) Start(_, dir string, args ...any) (err error)
- func (a *Agent) Stop() error
- func (a *Agent) WaitBackendReady(ctx context.Context) error
- type AgentConfigOption
- type AgentList
- func (al AgentList) Close() error
- func (al AgentList) ForEachAgent(cb func(a *Agent) error) error
- func (al AgentList) ForEachAgentPair(cb func(a, b *Agent) error) error
- func (al AgentList) ForEachInterface(cb func(i *WireGuardInterface) error) error
- func (al AgentList) ForEachInterfacePair(cb func(a, b *WireGuardInterface) error) error
- func (al AgentList) ForEachInterfacePairOneDir(cb func(a, b *WireGuardInterface) error) error
- func (al AgentList) PingPeers(ctx context.Context) error
- func (al AgentList) Start(dir string, args ...any) error
- func (al AgentList) WaitConnectionsReady(ctx context.Context) error
- type AgentOption
- type CoturnNode
- type GrpcSignalingNode
- type IncrementingDebugPort
- type Node
- type RelayList
- type RelayNode
- type SignalingList
- type SignalingNode
- type WireGuardInterface
- func (i *WireGuardInterface) AddPeer(peer *WireGuardInterface)
- func (i *WireGuardInterface) Apply(a *Agent)
- func (i *WireGuardInterface) Configure(cfg wgtypes.Config) error
- func (i *WireGuardInterface) Create() error
- func (i *WireGuardInterface) GetConfig() *wg.Config
- func (i *WireGuardInterface) PingPeer(ctx context.Context, peer *WireGuardInterface) error
- func (i *WireGuardInterface) SetupKernel() error
- func (i *WireGuardInterface) String() string
- func (i *WireGuardInterface) WaitConnectionEstablished(ctx context.Context, p *WireGuardInterface) error
- func (i *WireGuardInterface) WriteConfig() error
- type WireGuardInterfaceOption
- type WireGuardPeer
- type WireGuardPeerOption
- type WireGuardPeerSelectorFunc
Constants ¶
View Source
const (
KillTimeout = 30 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func CleanupBinary ¶
func CleanupBinary()
You should call CleanupBinary before your test ends to clean up any temporary artifacts.
func GracefullyTerminate ¶
Types ¶
type Agent ¶
type Agent struct { *g.Host Config *koanf.Koanf Command *g.Cmd Client *rpc.Client WireGuardClient *wgctrl.Client WireGuardInterfaces []*WireGuardInterface // contains filtered or unexported fields }
Agent is a host running the cunīcu daemon.
Each agent can have one or more WireGuard interfaces configured which are managed by a single daemon.
func (*Agent) ConfigureWireGuardInterfaces ¶
type AgentConfigOption ¶
type AgentConfigOption interface {
Apply(k *koanf.Koanf)
}
type AgentList ¶
type AgentList []*Agent
func (AgentList) ForEachAgentPair ¶
func (AgentList) ForEachInterface ¶
func (al AgentList) ForEachInterface(cb func(i *WireGuardInterface) error) error
func (AgentList) ForEachInterfacePair ¶
func (al AgentList) ForEachInterfacePair(cb func(a, b *WireGuardInterface) error) error
func (AgentList) ForEachInterfacePairOneDir ¶
func (al AgentList) ForEachInterfacePairOneDir(cb func(a, b *WireGuardInterface) error) error
type AgentOption ¶
type AgentOption interface {
Apply(a *Agent)
}
type CoturnNode ¶
type CoturnNode struct { *g.Host Command *g.Cmd Config map[string]string // contains filtered or unexported fields }
func NewCoturnNode ¶
func (*CoturnNode) Close ¶
func (c *CoturnNode) Close() error
func (*CoturnNode) Stop ¶
func (c *CoturnNode) Stop() error
func (*CoturnNode) URLs ¶
func (c *CoturnNode) URLs() []url.URL
func (*CoturnNode) WaitReady ¶
func (c *CoturnNode) WaitReady() error
type GrpcSignalingNode ¶
func NewGrpcSignalingNode ¶
func (*GrpcSignalingNode) Close ¶
func (s *GrpcSignalingNode) Close() error
func (*GrpcSignalingNode) Start ¶
func (s *GrpcSignalingNode) Start(_, dir string, extraArgs ...any) error
func (*GrpcSignalingNode) Stop ¶
func (s *GrpcSignalingNode) Stop() error
func (*GrpcSignalingNode) URL ¶
func (s *GrpcSignalingNode) URL() url.URL
func (*GrpcSignalingNode) WaitReady ¶
func (s *GrpcSignalingNode) WaitReady() error
type IncrementingDebugPort ¶
type IncrementingDebugPort struct {
Port int
}
type SignalingList ¶
type SignalingList []SignalingNode
func AddSignalingNodes ¶
func (SignalingList) Close ¶
func (l SignalingList) Close() error
type SignalingNode ¶
type WireGuardInterface ¶
type WireGuardInterface struct { wgtypes.Config // Name of the WireGuard interface Name string // List of addresses which will be assigned to the interface Addresses []net.IPNet WriteConfigFile bool SetupKernelInterface bool PeerSelector WireGuardPeerSelectorFunc Agent *Agent // contains filtered or unexported fields }
func NewWireGuardInterface ¶
func NewWireGuardInterface(name string) (*WireGuardInterface, error)
func (*WireGuardInterface) AddPeer ¶
func (i *WireGuardInterface) AddPeer(peer *WireGuardInterface)
func (*WireGuardInterface) Apply ¶
func (i *WireGuardInterface) Apply(a *Agent)
func (*WireGuardInterface) Configure ¶
func (i *WireGuardInterface) Configure(cfg wgtypes.Config) error
func (*WireGuardInterface) Create ¶
func (i *WireGuardInterface) Create() error
func (*WireGuardInterface) GetConfig ¶
func (i *WireGuardInterface) GetConfig() *wg.Config
func (*WireGuardInterface) PingPeer ¶
func (i *WireGuardInterface) PingPeer(ctx context.Context, peer *WireGuardInterface) error
func (*WireGuardInterface) SetupKernel ¶
func (i *WireGuardInterface) SetupKernel() error
func (*WireGuardInterface) String ¶
func (i *WireGuardInterface) String() string
func (*WireGuardInterface) WaitConnectionEstablished ¶
func (i *WireGuardInterface) WaitConnectionEstablished(ctx context.Context, p *WireGuardInterface) error
func (*WireGuardInterface) WriteConfig ¶
func (i *WireGuardInterface) WriteConfig() error
type WireGuardInterfaceOption ¶
type WireGuardInterfaceOption interface {
Apply(i *WireGuardInterface)
}
type WireGuardPeer ¶
type WireGuardPeer struct {
wgtypes.PeerConfig
}
func (*WireGuardPeer) Apply ¶
func (p *WireGuardPeer) Apply(i *WireGuardInterface)
type WireGuardPeerOption ¶
type WireGuardPeerOption interface {
Apply(i *WireGuardPeer)
}
type WireGuardPeerSelectorFunc ¶
type WireGuardPeerSelectorFunc func(i, j *WireGuardInterface) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.