storage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package storage provides feed subscription file management.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFeedNotFound  = errors.New("feed not found")
	ErrFeedExists    = errors.New("feed already exists")
	ErrInvalidFormat = errors.New("invalid feed format: expected 'name src'")
	ErrEmptyName     = errors.New("feed name cannot be empty")
	ErrEmptySrc      = errors.New("feed source cannot be empty")
	ErrNameHasSpace  = errors.New("feed name cannot contain whitespace")
)

Functions

This section is empty.

Types

type Store

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

Store manages feed subscriptions in a text file.

func New

func New(path string) *Store

New creates a new Store with the given file path.

func (*Store) Add

func (s *Store) Add(name, src string) error

Add adds a new feed subscription.

func (*Store) Get

func (s *Store) Get(name string) (model.Feed, error)

Get retrieves a single feed by name.

func (*Store) List

func (s *Store) List() ([]model.Feed, error)

List returns all feeds from the subscription file.

func (*Store) Path

func (s *Store) Path() string

Path returns the file path used by this store.

func (*Store) Remove

func (s *Store) Remove(name string) error

Remove deletes a feed by name.

func (*Store) Update

func (s *Store) Update(name string, newName, newSrc *string) error

Update modifies an existing feed.

Jump to

Keyboard shortcuts

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