json

package
v0.0.65 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package json provides a single-file JSON implementation of the store repositories. All data (streams, recordings, hooks, global config) is stored in one file with top-level keys, e.g.:

{
  "streams":    { "<code>": {...}, ... },
  "recordings": { "<id>":   {...}, ... },
  "hooks":      { "<id>":   {...}, ... },
  "global":     {}
}

Writes are atomic: data is marshalled to a .tmp file then renamed into place. Intended for development and lightweight single-node deployments.

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 is a JSON-backed implementation of all repositories.

func New

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

New creates a Store that persists data to a single file inside dir. The directory is created if it does not exist.

func (*Store) GlobalConfig

func (s *Store) GlobalConfig() store.GlobalConfigRepository

GlobalConfig returns a GlobalConfigRepository backed by this Store.

func (*Store) Hooks

func (s *Store) Hooks() store.HookRepository

Hooks returns a HookRepository backed by this Store.

func (*Store) Recordings

func (s *Store) Recordings() store.RecordingRepository

Recordings returns a RecordingRepository backed by this Store.

func (*Store) Streams

func (s *Store) Streams() store.StreamRepository

Streams returns a StreamRepository backed by this Store.

func (*Store) VOD

func (s *Store) VOD() store.VODMountRepository

VOD returns a VODMountRepository backed by this Store.

Jump to

Keyboard shortcuts

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