dsic

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DERPerCertRoot = "/usr/local/share/derper-certs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DERPServerInContainer

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

DERPServerInContainer represents DERP Server in Container (DSIC).

func New

func New(
	pool *dockertest.Pool,
	version string,
	networks []*dockertest.Network,
	opts ...Option,
) (*DERPServerInContainer, error)

New returns a new TailscaleInContainer instance.

func (*DERPServerInContainer) ConnectToNetwork

func (t *DERPServerInContainer) ConnectToNetwork(network *dockertest.Network) error

ConnectToNetwork connects the DERPer instance to a network.

func (*DERPServerInContainer) GetCert

func (t *DERPServerInContainer) GetCert() []byte

GetCert returns the TLS certificate of the DERPer instance.

func (*DERPServerInContainer) GetDERPPort

func (t *DERPServerInContainer) GetDERPPort() int

GetDERPPort returns the DERP port of the DERPer instance.

func (*DERPServerInContainer) GetHostname

func (t *DERPServerInContainer) GetHostname() string

func (*DERPServerInContainer) GetSTUNPort

func (t *DERPServerInContainer) GetSTUNPort() int

GetSTUNPort returns the STUN port of the DERPer instance.

func (*DERPServerInContainer) Hostname

func (t *DERPServerInContainer) Hostname() string

Hostname returns the hostname of the DERPer instance.

func (*DERPServerInContainer) ID

func (t *DERPServerInContainer) ID() string

ID returns the Docker container ID of the DERPServerInContainer instance.

func (*DERPServerInContainer) SaveLog

func (t *DERPServerInContainer) SaveLog(path string) error

SaveLog saves the current stdout log of the container to a path on the host system.

func (*DERPServerInContainer) Shutdown

func (t *DERPServerInContainer) Shutdown() error

Shutdown stops and cleans up the DERPer container.

func (*DERPServerInContainer) Version

func (t *DERPServerInContainer) Version() string

Version returns the running DERPer version of the instance.

func (*DERPServerInContainer) WaitForRunning

func (t *DERPServerInContainer) WaitForRunning() error

WaitForRunning blocks until the DERPer instance is ready to be used.

func (*DERPServerInContainer) WriteFile

func (t *DERPServerInContainer) WriteFile(path string, data []byte) error

WriteFile save file inside the container.

type Option

type Option = func(c *DERPServerInContainer)

Option represent optional settings that can be given to a DERPer instance.

func WithCACert

func WithCACert(cert []byte) Option

WithCACert adds it to the trusted surtificate of the Tailscale container.

func WithDockerWorkdir

func WithDockerWorkdir(dir string) Option

WithDockerWorkdir allows the docker working directory to be set.

func WithExtraHosts

func WithExtraHosts(hosts []string) Option

WithExtraHosts adds extra hosts to the container.

func WithOrCreateNetwork

func WithOrCreateNetwork(network *dockertest.Network) Option

WithOrCreateNetwork sets the Docker container network to use with the DERPer instance, if the parameter is nil, a new network, isolating the DERPer, will be created. If a network is passed, the DERPer instance will join the given network.

func WithVerifyClientURL

func WithVerifyClientURL(url string) Option

WithVerifyClientURL sets the URL to verify the client.

Jump to

Keyboard shortcuts

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