config

package
v0.0.0-...-8877296 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Outputfile        string   `yaml:"outputfile"`
	Ignores           []string `yaml:"ignores"`
	SortOrder         string   `yaml:"sortOrder"` // 排序规则
	IsSort            bool     `yaml:"isSort"`
	IsisSortDesc      bool     `yaml:"isisSortDesc"`
	SortBy            string   `yaml:"sortBy"`
	IsFileNameToTitle bool     `yaml:"isFileNameToTitle"`
}

type Option

type Option func(*OptionCfg)

func WithConfigPath

func WithConfigPath(path string) Option

func WithRootDir

func WithRootDir(dir string) Option

type OptionCfg

type OptionCfg struct {
	ConfigPath string
	RootDir    string
}

type SugaredConfig

type SugaredConfig struct {
	*Config
	*OptionCfg
}

SugaredConfig 将配置文件的参数解析,比如解析时间为 time.Ticker

var Global *SugaredConfig

func Init

func Init(opts ...Option) *SugaredConfig

Jump to

Keyboard shortcuts

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