state

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package state persists the sticky "current target" across CLI invocations, keyed per browser endpoint, under $XDG_STATE_HOME.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store holds per-endpoint CLI state under an XDG state directory.

func New

func New(key string) (*Store, error)

New returns a Store rooted at $XDG_STATE_HOME/chrome-cdp (or ~/.local/state), keyed by an endpoint identity (e.g. host:port of the debug endpoint) so distinct Chrome instances don't share a sticky target.

func (*Store) CurrentTarget

func (s *Store) CurrentTarget() string

CurrentTarget returns the sticky target spec, or "" if none is set.

func (*Store) SetCurrentTarget

func (s *Store) SetCurrentTarget(spec string) error

SetCurrentTarget persists the sticky target spec.

Jump to

Keyboard shortcuts

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