dockerimpl

package
v1.10.41 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 30 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientFromEnv

func NewClientFromEnv() (*client.Client, error)

Types

type Backend added in v0.18.0

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

func NewDockerBackend

func NewDockerBackend(
	c *client.Client,
	config Config,
	image builder.ImageConfig,
) (*Backend, error)

func (*Backend) AttachContainer added in v0.18.0

func (b *Backend) AttachContainer(ctx context.Context, appID string, stdin io.Reader, stdout, stderr io.Writer) error

func (*Backend) AvailableDomains added in v0.18.0

func (b *Backend) AvailableDomains() domain.AvailableDomainSlice

func (*Backend) AvailablePorts added in v0.18.0

func (b *Backend) AvailablePorts() domain.AvailablePortSlice

func (*Backend) Dispose added in v0.18.0

func (b *Backend) Dispose(_ context.Context) error

func (*Backend) ExecContainer added in v0.18.0

func (b *Backend) ExecContainer(ctx context.Context, appID string, cmd []string, stdin io.Reader, stdout, stderr io.Writer) error

func (*Backend) GetContainer added in v0.18.0

func (b *Backend) GetContainer(ctx context.Context, appID string) (*domain.Container, error)

func (*Backend) ListContainers added in v0.18.0

func (b *Backend) ListContainers(ctx context.Context) ([]*domain.Container, error)

func (*Backend) ListenContainerEvents added in v0.18.0

func (b *Backend) ListenContainerEvents() (sub <-chan *domain.ContainerEvent, unsub func())

func (*Backend) Start added in v0.18.0

func (b *Backend) Start(ctx context.Context) error

func (*Backend) Synchronize added in v0.18.0

func (b *Backend) Synchronize(ctx context.Context, s *domain.DesiredState) error

func (*Backend) SynchronizeShared added in v1.9.0

func (b *Backend) SynchronizeShared(_ context.Context, _ *domain.DesiredStateLeader) error

func (*Backend) TLSTargetDomain added in v1.9.0

func (b *Backend) TLSTargetDomain(website *domain.Website) (host string, ok bool)

type Config

type Config struct {
	// ServiceName is the hostname other components use to reach this controller.
	// Used for controller cluster discovery.
	ServiceName string `mapstructure:"serviceName" yaml:"serviceName"`

	// ConfDir is the directory to put all traefik configurations in.
	ConfDir string `mapstructure:"confDir" yaml:"confDir"`
	// Domains define available domains to be used by user apps.
	Domains []*domainConf `mapstructure:"domains" yaml:"domains"`
	// Ports define available port-forward ports to be used by user apps.
	Ports []*portConf `mapstructure:"ports" yaml:"ports"`

	// SS defines static-site server endpoint.
	SS struct {
		URL string `mapstructure:"url" yaml:"url"`
	} `mapstructure:"ss" yaml:"ss"`

	// Routing section defines ingress settings.
	Routing struct {
		// Type defines which ingress controller to use.
		// Possible values:
		// 	"traefik: Uses traefik ingress controller.
		Type    string `mapstructure:"type" yaml:"type"`
		Traefik struct {
			// PriorityOffset defines HTTP routes' priority offset for user apps.
			// This is optionally used to optimize routing performance.
			PriorityOffset int `mapstructure:"priorityOffset" yaml:"priorityOffset"`
		} `mapstructure:"traefik" yaml:"traefik"`
	} `mapstructure:"routing" yaml:"routing"`
	// Middleware section defines middleware settings.
	Middleware struct {
		// Sablier (https://github.com/acouvreur/sablier) starts user apps on demand and shuts them down after a certain time.
		Sablier struct {
			Enable     bool   `mapstructure:"enable" yaml:"enable"`
			SablierURL string `mapstructure:"url" yaml:"url"`
			// SessionDuration defines how long the session should last.
			//
			// Example: "10m"
			SessionDuration string `mapstructure:"sessionDuration" yaml:"sessionDuration"`
			Dynamic         struct {
				Theme string `mapstructure:"theme" yaml:"theme"`
			} `mapstructure:"dynamic" yaml:"dynamic"`
			Blocking struct {
				// Timeout defines how long the blocking should last.
				Timeout string `mapstructure:"timeout" yaml:"timeout"`
			} `mapstructure:"blocking" yaml:"blocking"`
		} `mapstructure:"sablier" yaml:"sablier"`
	}
	// TLS section defines tls setting for user app ingress.
	TLS struct {
		CertResolver string `mapstructure:"certResolver" yaml:"certResolver"`
		Wildcard     struct {
			// Domains define for which (wildcard) domains cert-manager supports configuring DNS records.
			Domains domain.WildcardDomains `mapstructure:"domains" yaml:"domains"`
		} `mapstructure:"wildcard" yaml:"wildcard"`
	} `mapstructure:"tls" yaml:"tls"`

	// Network defines which docker network to use with all user apps.
	Network string `mapstructure:"network" yaml:"network"`
	// Labels define common container labels to put to all user apps.
	Labels []*labelConf `mapstructure:"labels" yaml:"labels"`
	// Resources define user app container resource constraints.
	Resources struct {
		CPUs              float64 `mapstructure:"cpus" yaml:"cpus"`
		Memory            int64   `mapstructure:"memory" yaml:"memory"`
		MemorySwap        int64   `mapstructure:"memorySwap" yaml:"memorySwap"`
		MemoryReservation int64   `mapstructure:"memoryReservation" yaml:"memoryReservation"`
	} `mapstructure:"resources" yaml:"resources"`
}

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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