store

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: AGPL-3.0-or-later Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Destination

type Destination struct {
	ID   uuid.UUID `json:"id"`
	Name string    `json:"name"`
	URL  string    `json:"url"`
}

Destination represents a destination for a stream.

type FileStore

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

FileStore is a file-based store for persistent application state. It will probably be replaced with sqlite3 at some point.

FileStore is not thread-safe and should always be used from a single goroutine.

func New

func New(path string) (*FileStore, error)

New creates a new FileStore with the provided config file, creating it if it does not exist.

func (*FileStore) Get

func (s *FileStore) Get() State

Get returns the current state of the store.

func (*FileStore) Set

func (s *FileStore) Set(state State) error

Set sets the state of the store to the provided state.

type State

type State struct {
	Destinations []Destination `json:"destinations"`
}

State is the storable persistent state.

Jump to

Keyboard shortcuts

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