storage

package
v0.0.0-...-e27df27 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStorage

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

func NewFileStorage

func NewFileStorage(configPath string) *FileStorage

func (*FileStorage) Delete

func (f *FileStorage) Delete(key string)

func (*FileStorage) GetReloadChannel

func (f *FileStorage) GetReloadChannel() <-chan bool

func (*FileStorage) Put

func (f *FileStorage) Put(key string, target string)

Put appends a new entry to the link config. If the entry already exists, it will be duplicated in the file.

func (*FileStorage) Read

func (f *FileStorage) Read() map[string]string

func (*FileStorage) Update

func (f *FileStorage) Update(key string, target string)

type NoneStorage

type NoneStorage struct{}

func NewNoneStorage

func NewNoneStorage() *NoneStorage

func (*NoneStorage) Delete

func (s *NoneStorage) Delete(key string)

func (*NoneStorage) GetReloadChannel

func (s *NoneStorage) GetReloadChannel() <-chan bool

func (*NoneStorage) Put

func (s *NoneStorage) Put(key string, target string)

func (*NoneStorage) Read

func (s *NoneStorage) Read() map[string]string

func (*NoneStorage) Update

func (s *NoneStorage) Update(key string, value string)

type ParseError

type ParseError struct{}

func (*ParseError) Error

func (e *ParseError) Error() string

type Storage

type Storage interface {
	Read() map[string]string
	Put(key string, target string)
	Delete(key string)
	Update(key string, target string)
	GetReloadChannel() <-chan bool
}

type StorageType

type StorageType int
const (
	NONE StorageType = iota
	FILE
)

func FromString

func FromString(s string) StorageType

func (StorageType) String

func (st StorageType) String() string

Jump to

Keyboard shortcuts

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