store

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReplaceFlag = os.O_TRUNC | os.O_WRONLY
	AppendFlag  = os.O_APPEND | os.O_WRONLY
	ReadFlag    = os.O_RDONLY
	Perm        = 0o666
)

Variables

This section is empty.

Functions

func NewMark

func NewMark(r Record) domain.Mark

Types

type FS

type FS interface {
	Stat(path string) (fs.FileInfo, error)
	Abs(path string) (string, error)
	OpenFile(path string, flag int, perm fs.FileMode) (*os.File, error)
	Cwd() (string, error)
}

type Filestore

type Filestore struct {
	FS
	// contains filtered or unexported fields
}

func New

func New(sys FS, file string, log logger.Logger) Filestore

func (Filestore) Cwd

func (f Filestore) Cwd() (string, error)

func (Filestore) Load

func (f Filestore) Load() (*config.Config, error)

func (Filestore) Save

func (f Filestore) Save(cfg config.Config) error

type Record

type Record struct {
	Alias     string `json:"alias"`
	Path      string `json:"path"`
	TimesUsed int    `json:"timesUsed"`
	LastUsed  int64  `json:"lastUsed,omitempty"`
	Created   int64  `json:"created"`
}

func NewRecord

func NewRecord(m domain.Mark) Record

func ParseRecord

func ParseRecord(row []byte) (r Record, err error)

func (Record) Write

func (r Record) Write(w io.Writer) error

Directories

Path Synopsis
Package filesystem contains store.FS interface implementation
Package filesystem contains store.FS interface implementation

Jump to

Keyboard shortcuts

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