lib

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func NewDB

func NewDB(file string) DB

func NewDefaultDB

func NewDefaultDB() DB

func NewOrDefaultDB

func NewOrDefaultDB(file string) DB

func (DB) All

func (db DB) All() (items Items, err error)

func (DB) Store

func (db DB) Store(items Items, replaceTags bool) error

type Item

type Item struct {
	FullPath string `json:"full-path"`
	Tags     Tags   `json:"tags,omitempty"`
}

func NewItemFromFile

func NewItemFromFile(path string) (*Item, error)

func (*Item) AutoTag

func (i *Item) AutoTag() error

func (*Item) FullPathMatches

func (i *Item) FullPathMatches(glob string) bool

func (*Item) HasTag

func (i *Item) HasTag(tag Tag) bool

func (*Item) HasTagWithName

func (i *Item) HasTagWithName(name string) bool

func (*Item) HasTagWithValue

func (i *Item) HasTagWithValue(value string) bool

func (*Item) Tag

func (i *Item) Tag(tags ...Tag)

func (*Item) Untag

func (i *Item) Untag(tags ...Tag)

func (*Item) UntagAuto

func (i *Item) UntagAuto()

type Items

type Items map[string]*Item

func NewItemsFromGlob

func NewItemsFromGlob(glob string) (Items, error)

func (Items) AutoTag

func (is Items) AutoTag() error

func (Items) FilterByMatchingGlob

func (is Items) FilterByMatchingGlob(glob string) Items

func (Items) FilterByNotMatchingGlob

func (is Items) FilterByNotMatchingGlob(glob string) Items

func (Items) FilterByTagWithName

func (is Items) FilterByTagWithName(name string) Items

func (Items) FilterByTagWithValue

func (is Items) FilterByTagWithValue(value string) Items

func (Items) FilterByTags

func (is Items) FilterByTags(tags ...Tag) Items

func (Items) Tag

func (is Items) Tag(tags ...Tag)

func (Items) Untag

func (is Items) Untag(tags ...Tag)

func (Items) UntagAuto

func (is Items) UntagAuto()

type Tag

type Tag string

func NewTagWithValue

func NewTagWithValue(name, value string) Tag

func (Tag) IsDmsdTag

func (t Tag) IsDmsdTag() bool

func (Tag) Name

func (t Tag) Name() string

func (Tag) String

func (t Tag) String() string

func (Tag) Value

func (t Tag) Value() string

type Tags

type Tags []Tag

func NewTagsFromFile

func NewTagsFromFile(path string) (Tags, error)

func (Tags) AutoTags

func (ts Tags) AutoTags() (tags Tags)

func (Tags) Contains

func (ts Tags) Contains(tag Tag) bool

func (Tags) ContainsWithName

func (ts Tags) ContainsWithName(name string) bool

func (Tags) ContainsWithValue

func (ts Tags) ContainsWithValue(value string) bool

func (Tags) Remove

func (ts Tags) Remove(tags ...Tag) (tgs Tags)

func (Tags) Strings

func (ts Tags) Strings() []string

Jump to

Keyboard shortcuts

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