metadata

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalMetaData = Metadata{
	// contains filtered or unexported fields
}

GlobalMetaData stores global metadata, load before use

Functions

func ApplyDefaultsSubs

func ApplyDefaultsSubs(str string) (string, error)

ApplyDefaultSubs applies the default subs rules to string, note that it does not include special hd subs

func ApplySubsReplacer

func ApplySubsReplacer(str string, repler *strings.Replacer) string

ApplySubsReplacer applies a set of subs rules to string

func GetGlobalMetadata

func GetGlobalMetadata(ddirpath string) error

func IsExcluded

func IsExcluded(fname []byte) (bool, error)

func SubsApply

func SubsApply(s string) (string, error)

SubsApply applies subs to string

Types

type Metadata

type Metadata struct {
	Version string   `toml:"version"`
	Exclude []string `toml:"exclude"`
	SubsDef `toml:"subs"`
	// contains filtered or unexported fields
}

func (*Metadata) Load

func (m *Metadata) Load(data []byte) error

type SubsDef

type SubsDef struct {
	SpecialHDDisable bool      `toml:"disable_homedir_subs"`
	CustomRules      SubsRules `toml:"rules"`
}

type SubsRules

type SubsRules map[string]string

func (SubsRules) ToReplacer

func (r SubsRules) ToReplacer() strings.Replacer

ToReplacer turns SubsRules to Replacer

Jump to

Keyboard shortcuts

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