store

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewID

func NewID() string

Types

type Disk

type Disk struct{ Dir string }

Disk reads and writes subscriptions.yaml and configuration.yaml

func (Disk) Active

func (d Disk) Active() (string, error)

func (Disk) Last

func (d Disk) Last() (string, error)

func (Disk) Save

func (d Disk) Save(subs []Subscription) error

func (Disk) SetActive

func (d Disk) SetActive(id string) error

SetActive persists the node to restore on start; connecting also records it as Last

func (Disk) SetLast

func (d Disk) SetLast(id string) error

func (Disk) SetSettings

func (d Disk) SetSettings(in domain.Settings) error

func (Disk) SetTun

func (d Disk) SetTun(on bool) error

func (Disk) State

func (d Disk) State() (State, error)

func (Disk) Subscriptions

func (d Disk) Subscriptions() ([]Subscription, error)

type State

type State struct {
	Active   string          `yaml:"active"`
	Last     string          `yaml:"last,omitempty"`
	Tun      bool            `yaml:"tun,omitempty"`
	Settings domain.Settings `yaml:"settings,omitempty"`
}

type Subscription

type Subscription struct {
	ID        string         `yaml:"id"`
	Name      string         `yaml:"name"`
	URL       string         `yaml:"url"`
	Nodes     []domain.Node  `yaml:"nodes"`
	UpdatedAt time.Time      `yaml:"updated_at"`
	Traffic   domain.Traffic `yaml:"traffic,omitempty"`
}

Jump to

Keyboard shortcuts

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