config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 12 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 {
	*viper.Viper
	Log   *logrus.Logger
	Cache *sync.Map

	Site            Site
	OutputDir       string
	ContentDir      string
	DefaultLanguage string

	Languages map[string]*Config
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) GetHighlightStyle

func (conf *Config) GetHighlightStyle() string

func (*Config) GetRelURL

func (conf *Config) GetRelURL(path string) string

func (*Config) GetSlug

func (conf *Config) GetSlug(name string) string

func (*Config) GetSummary

func (conf *Config) GetSummary(text string) string

func (*Config) GetURL

func (conf *Config) GetURL(path string) string

func (*Config) Init

func (conf *Config) Init()

func (*Config) IsDefaultLanguage added in v0.1.2

func (conf *Config) IsDefaultLanguage(lang string) bool

func (*Config) IsValidLanguage added in v0.1.2

func (conf *Config) IsValidLanguage(lang string) bool

func (*Config) Load

func (conf *Config) Load(path string) error

func (*Config) Reset

func (conf *Config) Reset(m map[string]interface{})

func (*Config) ResetByFile added in v0.1.2

func (conf *Config) ResetByFile(file string, r io.Reader)

func (*Config) SetDebug

func (conf *Config) SetDebug()

func (*Config) SetFilter

func (conf *Config) SetFilter(filter string)

func (*Config) SetMode

func (conf *Config) SetMode(mode string)

func (*Config) SetOutput

func (conf *Config) SetOutput(output string)

func (*Config) Unmarshal

func (conf *Config) Unmarshal(key string, val interface{}) error

func (*Config) Watch

func (conf *Config) Watch(file string) error

func (*Config) With

func (conf *Config) With(lang string) Config

func (*Config) WithWriter added in v0.1.2

func (conf *Config) WithWriter(w Writer) Config

func (*Config) Write

func (conf *Config) Write(file string, r io.Reader) error

type Site

type Site struct {
	URL      string
	Title    string
	SubTitle string
	Language string
}

type Writer

type Writer interface {
	Write(string, io.Reader) error
	Watch(string) error
}

Jump to

Keyboard shortcuts

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