Help us shape the future of Go! Take the 2026 Go Developer Survey

flow

package
v1.49.16 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleSeven = "seven"
	RoleExtra = "extra"
)
View Source
const DefaultPage = "https://seven.sliccy.ai/"
View Source
const FallbackNotice = "" /* 131-byte string literal not displayed */
View Source
const KindPair browser.Kind = "default-browser"
View Source
const PairID = "default-browser"
View Source
const RelinkReason = "slicc is relinking"
View Source
const Schema = 1

Variables

View Source
var ErrNoBrowser = errors.New("no browser to control: run `slicc open` to link seven in your everyday browser")

Functions

func CanExtra

func CanExtra(e browser.Entry) error

func CanHost

func CanHost(e browser.Entry) error

func Check

func Check(sel []browser.Entry) error

func Default

func Default(entries []browser.Entry) (browser.Entry, error)

func Demoted added in v1.45.0

func Demoted(entries []browser.Entry) []browser.Entry

func Fallback added in v1.39.0

func Fallback(o browser.Options, entries []browser.Entry) bool

func Find

func Find(entries []browser.Entry, id string) (browser.Entry, bool)

func Go

func Go(ctx context.Context, cfg Config, sel []browser.Entry) error

func IsHeadless added in v1.45.0

func IsHeadless(e browser.Entry) bool

func IsPair added in v1.47.0

func IsPair(e browser.Entry) bool

func IsSix added in v1.30.0

func IsSix(e browser.Entry) bool

func PageOrigins

func PageOrigins(page string, extra []string) ([]string, error)

func PairEntry added in v1.47.0

func PairEntry() browser.Entry

func ProfileLabel added in v1.29.3

func ProfileLabel(ep browser.Endpoint) string

func Profiles

func Profiles(o browser.Options, in browser.Installed) []string

func Resolve

func Resolve(entries []browser.Entry, ids []string) ([]browser.Entry, error)

func ResolveSix added in v1.30.0

func ResolveSix(o browser.Options, port int, entries []browser.Entry, ids []string) ([]browser.Entry, error)

func SixLabel added in v1.30.0

func SixLabel(e browser.Entry) string

func SlowLine added in v1.41.2

func SlowLine(name string, elapsed int) string

func WithPair added in v1.47.0

func WithPair(o browser.Options, entries []browser.Entry) []browser.Entry

func WithSixRows added in v1.30.0

func WithSixRows(o browser.Options, entries []browser.Entry) []browser.Entry

Types

type Browser

type Browser struct {
	ID           string
	Name         string
	Version      string
	CDP          string
	WebSocketURL string
	Seven        bool
	Launched     bool
}

type Caps added in v1.22.0

type Caps struct {
	Release func()
	Live    func() map[string]bool
}

type Config

type Config struct {
	Page     string
	Origins  []string
	Profile  string
	Profiles map[string]string
	Headless bool
	Kernel   int
	Name     string
	Version  string
	Allow    policy.Rules
	Deny     policy.Rules
	Expose   []uint16
	Browser  browser.Options
	Chosen   bool
	Register func(ctx context.Context, n *node.Node, pol *policy.Policy, browsers []Browser) (Caps, error)
	Compute  string
	Relink   <-chan Relink
	Emit     func(Event)
	Logf     func(format string, args ...any)
}

type Event

type Event struct {
	Schema       int             `json:"schema"`
	Event        Kind            `json:"event"`
	Entries      []browser.Entry `json:"entries,omitempty"`
	Browser      string          `json:"browser,omitempty"`
	Name         string          `json:"name,omitempty"`
	Version      string          `json:"version,omitempty"`
	Role         string          `json:"role,omitempty"`
	Launched     bool            `json:"launched,omitempty"`
	PID          int             `json:"pid,omitempty"`
	Profile      string          `json:"profile,omitempty"`
	ProfileDir   string          `json:"profileDir,omitempty"`
	CDP          string          `json:"cdp,omitempty"`
	WebSocketURL string          `json:"webSocketDebuggerUrl,omitempty"`
	Tab          string          `json:"tab,omitempty"`
	Peer         string          `json:"peer,omitempty"`
	Caps         []string        `json:"caps,omitempty"`
	Policy       string          `json:"policy,omitempty"`
	Reason       string          `json:"reason,omitempty"`
	Message      string          `json:"message,omitempty"`
	Browsers     []string        `json:"browsers,omitempty"`
	Stream       string          `json:"stream,omitempty"`
	Count        int             `json:"count,omitempty"`
	Kernel       string          `json:"kernel,omitempty"`
	Compute      string          `json:"compute,omitempty"`
	OpenedTab    *bool           `json:"openedTab,omitempty"`
	Elapsed      int             `json:"elapsed,omitempty"`
	URL          string          `json:"url,omitempty"`
	Time         time.Time       `json:"-"`
}

func (Event) MarshalJSON

func (e Event) MarshalJSON() ([]byte, error)

type Kind

type Kind string
const (
	Discovered  Kind = "discovered"
	Launched    Kind = "launched"
	Attached    Kind = "attached"
	Serving     Kind = "serving"
	Connecting  Kind = "connecting"
	Linked      Kind = "linked"
	LinkLost    Kind = "link-lost"
	StreamOpen  Kind = "stream-open"
	StreamDone  Kind = "stream-close"
	Dropped     Kind = "dropped"
	Status      Kind = "status"
	Kernel      Kind = "kernel"
	BrowserGone Kind = "browser-gone"
	BrowserBack Kind = "browser-back"
	BrowserSlow Kind = "browser-slow"
	Closed      Kind = "closed"
	Error       Kind = "error"
	Pairing     Kind = "pairing"

	ForeignBrowser Kind = "foreign-browser"
)
type Relink struct {
	Kernel  int
	Compute string
}

Jump to

Keyboard shortcuts

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