launch

package
v0.0.0-...-0124094 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Probe

func Probe(port int) bool

Probes chrome remote debugger to verify it's listening

func ProbeUntil

func ProbeUntil(port int, wait time.Duration) error

Probes chrome remote debugger until a connection is verified or wait expires

Types

type ChromeLogLevel

type ChromeLogLevel string
var (
	ChromeLogLevelInfo    ChromeLogLevel = "info"
	ChromeLogLevelWarning ChromeLogLevel = "warning"
	ChromeLogLevelError   ChromeLogLevel = "error"
	ChromeLogLevelFatal   ChromeLogLevel = "fatal"
)

func NormalizeChromeLogLevel

func NormalizeChromeLogLevel(level ChromeLogLevel) ChromeLogLevel

type Config

type Config struct {
	StartingUrl          string
	RequestedPort        int
	ChromePath           string
	ChromeFlags          []string
	LogLevel             ChromeLogLevel
	EnvironmentVariables map[string]string
	UserDataDir          string
	IgnoreDefaultFlags   bool
	IsLambdaEnv          bool
}

func (Config) Env

func (c Config) Env() []string

func (Config) LogFlags

func (c Config) LogFlags() []string

func (Config) Normalize

func (c Config) Normalize() Config

type Launcher

type Launcher interface {
	// Launches chrome
	// If a debugger port is requested and chrome is listening on that port,
	//   this will not create any resources or launch chrome
	Launch() error

	// Stops chrome and destroys resources
	// This will do nothing if Launch did not launch a new chrome
	Kill() error

	// Chrome process id
	Pid() int

	// Chrome remote debugger port
	Port() int
}

func New

func New(cfg Config) Launcher

Jump to

Keyboard shortcuts

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