Documentation
¶
Index ¶
- Variables
- type ControlServer
- type Namespace
- type Scenario
- func (s *Scenario) CountTailscale() int
- func (s *Scenario) CreateHeadscaleEnv(namespaces map[string]int, tsOpts []tsic.Option, opts ...hsic.Option) error
- func (s *Scenario) CreateNamespace(namespace string) error
- func (s *Scenario) CreatePreAuthKey(namespace string) (*v1.PreAuthKey, error)
- func (s *Scenario) CreateTailscaleNodesInNamespace(namespaceStr string, requestedVersion string, count int, opts ...tsic.Option) error
- func (s *Scenario) GetClients(namespace string) ([]TailscaleClient, error)
- func (s *Scenario) GetIPs(namespace string) ([]netip.Addr, error)
- func (s *Scenario) Headscale(opts ...hsic.Option) (ControlServer, error)
- func (s *Scenario) ListTailscaleClients(namespaces ...string) ([]TailscaleClient, error)
- func (s *Scenario) ListTailscaleClientsFQDNs(namespaces ...string) ([]string, error)
- func (s *Scenario) ListTailscaleClientsIPs(namespaces ...string) ([]netip.Addr, error)
- func (s *Scenario) Namespaces() []string
- func (s *Scenario) RunTailscaleUp(namespaceStr, loginServer, authKey string) error
- func (s *Scenario) Shutdown() error
- func (s *Scenario) WaitForTailscaleSync() error
- type TailscaleClient
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TailscaleVersions = append(
tailscaleVersions2021,
tailscaleVersions2019...,
)
)
Functions ¶
This section is empty.
Types ¶
type ControlServer ¶
type ControlServer interface { Shutdown() error Execute(command []string) (string, error) GetHealthEndpoint() string GetEndpoint() string WaitForReady() error CreateNamespace(namespace string) error CreateAuthKey(namespace string) (*v1.PreAuthKey, error) ListMachinesInNamespace(namespace string) ([]*v1.Machine, error) GetCert() []byte GetHostname() string GetIP() string }
type Namespace ¶
type Namespace struct { Clients map[string]TailscaleClient // contains filtered or unexported fields }
type Scenario ¶
type Scenario struct {
// contains filtered or unexported fields
}
TODO(kradalby): make control server configurable, test correctness with Tailscale SaaS.
func NewScenario ¶
func (*Scenario) CountTailscale ¶
func (*Scenario) CreateHeadscaleEnv ¶
func (s *Scenario) CreateHeadscaleEnv( namespaces map[string]int, tsOpts []tsic.Option, opts ...hsic.Option, ) error
CreateHeadscaleEnv is a conventient method returning a set up Headcale test environment with nodes of all versions, joined to the server with X namespaces.
func (*Scenario) CreateNamespace ¶
func (*Scenario) CreatePreAuthKey ¶
func (s *Scenario) CreatePreAuthKey(namespace string) (*v1.PreAuthKey, error)
func (*Scenario) CreateTailscaleNodesInNamespace ¶
func (*Scenario) GetClients ¶
func (s *Scenario) GetClients(namespace string) ([]TailscaleClient, error)
func (*Scenario) Headscale ¶
func (s *Scenario) Headscale(opts ...hsic.Option) (ControlServer, error)
TODO(kradalby): make port and headscale configurable, multiple instances support?
func (*Scenario) ListTailscaleClients ¶
func (s *Scenario) ListTailscaleClients(namespaces ...string) ([]TailscaleClient, error)
func (*Scenario) ListTailscaleClientsFQDNs ¶
func (*Scenario) ListTailscaleClientsIPs ¶
func (*Scenario) Namespaces ¶
func (*Scenario) RunTailscaleUp ¶
func (*Scenario) WaitForTailscaleSync ¶
type TailscaleClient ¶
type TailscaleClient interface { Hostname() string Shutdown() error Version() string Execute(command []string) (string, string, error) Up(loginServer, authKey string) error UpWithLoginURL(loginServer string) (*url.URL, error) IPs() ([]netip.Addr, error) FQDN() (string, error) Status() (*ipnstate.Status, error) WaitForReady() error WaitForPeers(expected int) error Ping(hostnameOrIP string) error ID() string }
nolint
Click to show internal directories.
Click to hide internal directories.