service

package
v0.0.0-...-c6895b7 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: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultContainerNetwork = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CpuLimit

type CpuLimit int64

CpuLimit - CPU limit for Docker container

func (*CpuLimit) Set

func (limit *CpuLimit) Set(s string) error

func (*CpuLimit) String

func (limit *CpuLimit) String() string

type DefaultManager

type DefaultManager struct {
	Environment *Environment
	Client      *client.Client
	Config      *config.Config
}

DefaultManager - struct for default implementation

func (*DefaultManager) Find

func (m *DefaultManager) Find(caps session.Caps, requestId uint64) (Starter, bool)

Find - default implementation Manager interface

type Docker

type Docker struct {
	ServiceBase
	Environment
	session.Caps
	LogConfig *ctr.LogConfig
	Client    *client.Client
}

Docker - docker container manager

func (*Docker) StartWithCancel

func (d *Docker) StartWithCancel() (*StartedService, error)

StartWithCancel - Starter interface implementation

type Driver

type Driver struct {
	ServiceBase
	Environment
	session.Caps
}

Driver - driver processes manager

func (*Driver) StartWithCancel

func (d *Driver) StartWithCancel() (*StartedService, error)

StartWithCancel - Starter interface implementation

type Environment

type Environment struct {
	IP                   string
	InDocker             bool
	CPU                  int64
	Memory               int64
	Network              string
	Hostname             string
	StartupTimeout       time.Duration
	SessionDeleteTimeout time.Duration
	CaptureDriverLogs    bool
	VideoOutputDir       string
	VideoContainerImage  string
	LogOutputDir         string
	SaveAllLogs          bool
	Privileged           bool
}

Environment - all settings that influence browser startup

type Manager

type Manager interface {
	Find(caps session.Caps, requestId uint64) (Starter, bool)
}

Manager - interface to choose appropriate starter

type MemLimit

type MemLimit int64

MemLimit - memory limit for Docker container

func (*MemLimit) Set

func (limit *MemLimit) Set(s string) error

func (*MemLimit) String

func (limit *MemLimit) String() string

type ServiceBase

type ServiceBase struct {
	RequestId uint64
	Service   *config.Browser
}

ServiceBase - stores fields required by all services

type StartedService

type StartedService struct {
	Url       *url.URL
	Container *session.Container
	HostPort  session.HostPort
	Origin    string
	Cancel    func()
}

StartedService - all started service properties

type Starter

type Starter interface {
	StartWithCancel() (*StartedService, error)
}

Starter - interface to create session with cancellation ability

Jump to

Keyboard shortcuts

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