store

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

func NewFile

func NewFile(file string) (*File, error)

func (*File) GetPreset

func (f *File) GetPreset(ctx context.Context, url string) (*model.Preset, error)

func (*File) ListPresets

func (f *File) ListPresets(ctx context.Context) ([]model.Preset, error)

func (*File) UpdatePreset

func (f *File) UpdatePreset(ctx context.Context, p *model.Preset) error

type FileConfig

type FileConfig struct {
	Presets []FilePreset `json:"presets"`
}

type FilePreset

type FilePreset struct {
	URL      string `json:"url"`
	TitleNew string `json:"newName"`
	URLNew   string `json:"newUrl"`
}

type Mock

type Mock struct{}

func NewMock

func NewMock() Mock

func (Mock) Get

func (Mock) List

func (Mock) List(context.Context) ([]model.Preset, error)

func (Mock) Update

func (Mock) Update(context.Context, *model.Preset) error

type Store

type Store interface {
	ListPresets(ctx context.Context) ([]model.Preset, error)
	GetPreset(ctx context.Context, url string) (*model.Preset, error)
	UpdatePreset(ctx context.Context, p *model.Preset) error
}

func Must

func Must(store Store, err error) Store

Jump to

Keyboard shortcuts

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