selenoid

package
v0.0.0-...-243f47c Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SelenoidDefaultPort   = 4444
	SelenoidUIDefaultPort = 8080
	DefaultRegistryUrl    = "https://index.docker.io"
	DefaultDriversInfoURL = "https://raw.githubusercontent.com/aerokube/cm/master/browsers.json"
)
View Source
const (
	Latest = "latest"
)

Variables

This section is empty.

Functions

func GetSelenoidConfigDir

func GetSelenoidConfigDir() string

func GetSelenoidUIConfigDir

func GetSelenoidUIConfigDir() string

Types

type Architectures

type Architectures map[string]Driver

type ArgsAware

type ArgsAware struct {
	Args string
}

type ArgsProvider

type ArgsProvider interface {
	PrintArgs() error
	PrintUIArgs() error
}

type Browser

type Browser struct {
	Command string `json:"command"`
	Files   Files  `json:"files"`
}

type BrowserEnvAware

type BrowserEnvAware struct {
	BrowserEnv string
}

type Browsers

type Browsers map[string]Browser

type ConfigDirAware

type ConfigDirAware struct {
	ConfigDir string
}

type Configurable

type Configurable interface {
	IsConfigured() bool
	Configure() (*SelenoidConfig, error)
}

type DockerConfigurator

type DockerConfigurator struct {
	Logger
	ConfigDirAware
	VersionAware
	DownloadAware
	RequestedBrowsersAware
	ArgsAware
	EnvAware
	BrowserEnvAware
	PortAware
	UserNSAware
	LogsAware
	GracefulAware
	LastVersions int
	Pull         bool
	RegistryUrl  string
	BrowsersJson string
	ShmSize      int
	Tmpfs        int
	VNC          bool
	// contains filtered or unexported fields
}

func NewDockerConfigurator

func NewDockerConfigurator(config *LifecycleConfig) (*DockerConfigurator, error)

func (*DockerConfigurator) Close

func (c *DockerConfigurator) Close() error

func (*DockerConfigurator) Configure

func (c *DockerConfigurator) Configure() (*SelenoidConfig, error)

func (*DockerConfigurator) Download

func (c *DockerConfigurator) Download() (string, error)

func (*DockerConfigurator) DownloadUI

func (c *DockerConfigurator) DownloadUI() (string, error)

func (*DockerConfigurator) IsConfigured

func (c *DockerConfigurator) IsConfigured() bool

func (*DockerConfigurator) IsDownloaded

func (c *DockerConfigurator) IsDownloaded() bool

func (*DockerConfigurator) IsRunning

func (c *DockerConfigurator) IsRunning() bool

func (*DockerConfigurator) IsUIDownloaded

func (c *DockerConfigurator) IsUIDownloaded() bool

func (*DockerConfigurator) IsUIRunning

func (c *DockerConfigurator) IsUIRunning() bool

func (*DockerConfigurator) PrintArgs

func (c *DockerConfigurator) PrintArgs() error

func (*DockerConfigurator) PrintUIArgs

func (c *DockerConfigurator) PrintUIArgs() error

func (*DockerConfigurator) Start

func (c *DockerConfigurator) Start() error

func (*DockerConfigurator) StartUI

func (c *DockerConfigurator) StartUI() error

func (*DockerConfigurator) Status

func (c *DockerConfigurator) Status()

func (*DockerConfigurator) Stop

func (c *DockerConfigurator) Stop() error

func (*DockerConfigurator) StopUI

func (c *DockerConfigurator) StopUI() error

func (*DockerConfigurator) UIStatus

func (c *DockerConfigurator) UIStatus()

type DownloadAware

type DownloadAware struct {
	DownloadNeeded bool
}

type Downloadable

type Downloadable interface {
	IsDownloaded() bool
	Download() (string, error)
	IsUIDownloaded() bool
	DownloadUI() (string, error)
}

type Driver

type Driver struct {
	URL      string `json:"url"`
	Filename string `json:"filename"`
}

type DriversConfigurator

func NewDriversConfigurator

func NewDriversConfigurator(config *LifecycleConfig) *DriversConfigurator

func (*DriversConfigurator) Close

func (d *DriversConfigurator) Close() error

func (*DriversConfigurator) Configure

func (d *DriversConfigurator) Configure() (*SelenoidConfig, error)

func (*DriversConfigurator) Download

func (d *DriversConfigurator) Download() (string, error)

func (*DriversConfigurator) DownloadUI

func (d *DriversConfigurator) DownloadUI() (string, error)

func (*DriversConfigurator) IsConfigured

func (d *DriversConfigurator) IsConfigured() bool

func (*DriversConfigurator) IsDownloaded

func (d *DriversConfigurator) IsDownloaded() bool

func (*DriversConfigurator) IsRunning

func (d *DriversConfigurator) IsRunning() bool

func (*DriversConfigurator) IsUIDownloaded

func (d *DriversConfigurator) IsUIDownloaded() bool

func (*DriversConfigurator) IsUIRunning

func (d *DriversConfigurator) IsUIRunning() bool

func (*DriversConfigurator) PrintArgs

func (d *DriversConfigurator) PrintArgs() error

func (*DriversConfigurator) PrintUIArgs

func (d *DriversConfigurator) PrintUIArgs() error

func (*DriversConfigurator) Start

func (d *DriversConfigurator) Start() error

func (*DriversConfigurator) StartUI

func (d *DriversConfigurator) StartUI() error

func (*DriversConfigurator) Status

func (d *DriversConfigurator) Status()

func (*DriversConfigurator) Stop

func (d *DriversConfigurator) Stop() error

func (*DriversConfigurator) StopUI

func (d *DriversConfigurator) StopUI() error

func (*DriversConfigurator) UIStatus

func (d *DriversConfigurator) UIStatus()

type EnvAware

type EnvAware struct {
	Env string
}

type Files

type Files map[string]Architectures

type Forceable

type Forceable struct {
	Force bool
}

type GracefulAware

type GracefulAware struct {
	Graceful        bool
	GracefulTimeout time.Duration
}

type JSONMessage

type JSONMessage struct {
	Status          string        `json:"status,omitempty"`
	Progress        *JSONProgress `json:"progressDetail,omitempty"`
	ID              string        `json:"id,omitempty"`
	ProgressMessage string        `json:"progress,omitempty"` //deprecated
}

JSONMessage defines a message struct from docker.

type JSONProgress

type JSONProgress struct {
	Current int64 `json:"current,omitempty"`
	Total   int64 `json:"total,omitempty"`
	Start   int64 `json:"start,omitempty"`
	// If true, don't show xB/yB
	HideCounts bool   `json:"hidecounts,omitempty"`
	Units      string `json:"units,omitempty"`
	// contains filtered or unexported fields
}

JSONProgress describes a Progress. terminalFd is the fd of the current terminal, Start is the initial value for the operation. Current is the current status and value of the progress made towards Total. Total is the end value describing when we made 100% progress for an operation.

type Lifecycle

type Lifecycle struct {
	Logger
	Forceable
	Config *LifecycleConfig
	// contains filtered or unexported fields
}

func NewLifecycle

func NewLifecycle(config *LifecycleConfig) (*Lifecycle, error)

func (*Lifecycle) Close

func (l *Lifecycle) Close()

func (*Lifecycle) Configure

func (l *Lifecycle) Configure() error

func (*Lifecycle) Download

func (l *Lifecycle) Download() error

func (*Lifecycle) DownloadUI

func (l *Lifecycle) DownloadUI() error

func (*Lifecycle) PrintArgs

func (l *Lifecycle) PrintArgs() error

func (*Lifecycle) PrintUIArgs

func (l *Lifecycle) PrintUIArgs() error

func (*Lifecycle) Start

func (l *Lifecycle) Start() error

func (*Lifecycle) StartUI

func (l *Lifecycle) StartUI() error

func (*Lifecycle) Status

func (l *Lifecycle) Status()

func (*Lifecycle) Stop

func (l *Lifecycle) Stop() error

func (*Lifecycle) StopUI

func (l *Lifecycle) StopUI() error

func (*Lifecycle) UIStatus

func (l *Lifecycle) UIStatus()

type LifecycleConfig

type LifecycleConfig struct {
	Quiet           bool
	Force           bool
	Graceful        bool
	GracefulTimeout time.Duration
	ConfigDir       string
	Browsers        string
	BrowserEnv      string
	Download        bool
	Args            string
	Env             string
	Version         string
	Port            int
	DisableLogs     bool

	// Docker specific
	LastVersions int
	RegistryUrl  string
	BrowsersJson string
	ShmSize      int
	Tmpfs        int
	VNC          bool
	UserNS       string

	// Drivers specific
	UseDrivers     bool
	DriversInfoUrl string
	GithubBaseUrl  string
	OS             string
	Arch           string
}

type Logger

type Logger struct {
	Quiet bool
}

func (*Logger) Errorf

func (c *Logger) Errorf(format string, v ...interface{})

func (*Logger) Pointf

func (c *Logger) Pointf(format string, v ...interface{})

func (*Logger) Printf

func (c *Logger) Printf(format string, v ...interface{})

func (*Logger) Titlef

func (c *Logger) Titlef(format string, v ...interface{})

func (*Logger) Tracef

func (c *Logger) Tracef(format string, v ...interface{})

type LogsAware

type LogsAware struct {
	DisableLogs bool
}

type PortAware

type PortAware struct {
	Port int
}

type RequestedBrowsersAware

type RequestedBrowsersAware struct {
	Browsers string
}

type Runnable

type Runnable interface {
	IsRunning() bool
	Start() error
	Stop() error
	IsUIRunning() bool
	StartUI() error
	StopUI() error
}

type SelenoidConfig

type SelenoidConfig map[string]config.Versions

type StatusProvider

type StatusProvider interface {
	Status()
	UIStatus()
}

type UserNSAware

type UserNSAware struct {
	UserNS string
}

type VersionAware

type VersionAware struct {
	Version string
}

Jump to

Keyboard shortcuts

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