Documentation ¶
Index ¶
- type Config
- func (c *Config) AddPathsToTag(tag string, paths ...string)
- func (c Config) GetPathsOfTagSorted(tag string) []string
- func (c Config) GetPathsOfTagsSorted(tags ...string) []string
- func (c Config) GetTagsOfPathSorted(path string) []string
- func (c Config) GetTagsSorted() []string
- func (c *Config) ReWriteConfig() (string, error)
- func (c *Config) RemovePathsFromTag(tag string, paths ...string)
- func (c *Config) WriteConfig(path string) (string, error)
- type ReadSource
- type Tags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Source ReadSource `json:"-" yaml:"-"` LoadedFrom string `json:"-" yaml:"-"` Tags Tags `json:"tags" yaml:"tags"` }
Config contains all runtime configuration for ew, such as available tags.
func ParseConfigFromFolder ¶
ParseConfigFromFolder parses the given folder for a valid ew config, or returns the default (empty) config if none can be found.
func (*Config) AddPathsToTag ¶ added in v1.0.0
AddPathsToTag adds a list of paths to a tag.
func (Config) GetPathsOfTagSorted ¶
GetPathsOfTagSorted returns a sorted list of paths of the given tag.
func (Config) GetPathsOfTagsSorted ¶
GetPathsOfTagSorted returns a sorted list of paths of the given tags. Note, paths are sorted tag agnostic, so mixing up might occur. Duplicates are also filtered out.
func (Config) GetTagsOfPathSorted ¶
GetTagsOfPathSorted returns a sorted list of tags by which the given path is tagged with.
func (Config) GetTagsSorted ¶
GetTagsSorted returns a sorted list of configured tags.
func (*Config) ReWriteConfig ¶ added in v1.0.0
ReWriteConfig re-writes the config from the path it was loaded from.
func (*Config) RemovePathsFromTag ¶ added in v1.0.0
RemovePathsFromTag removes a list of paths from a tag.
type ReadSource ¶
type ReadSource int
ReadSource determinate from which source a given config was read, and/or in which format it should be persisted.
const ( JsonSrc ReadSource = iota YamlSrc )