state

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager handles named state snapshots.

func NewManager

func NewManager(dir string) (*Manager, error)

NewManager creates a new state manager. If dir is empty, uses ~/.w3pilot/states/

func (*Manager) Delete

func (m *Manager) Delete(name string) error

Delete removes a saved state by name.

func (*Manager) Exists

func (m *Manager) Exists(name string) bool

Exists checks if a state with the given name exists.

func (*Manager) List

func (m *Manager) List() ([]StateInfo, error)

List returns information about all saved states.

func (*Manager) Load

func (m *Manager) Load(name string) (*w3pilot.StorageState, error)

Load loads a storage state by name.

func (*Manager) Save

func (m *Manager) Save(name string, state *w3pilot.StorageState) error

Save saves a storage state with the given name.

type StateInfo

type StateInfo struct {
	Name       string    `json:"name"`
	CreatedAt  time.Time `json:"created_at"`
	Size       int64     `json:"size"`
	Origins    []string  `json:"origins,omitempty"` // List of origin domains
	NumCookies int       `json:"num_cookies"`
}

StateInfo contains metadata about a saved state.

Jump to

Keyboard shortcuts

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