configs

package
v0.0.0-...-536543f Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHostIP = "0.0.0.0"
	DefaultPort   = "14119"
)

Variables

This section is empty.

Functions

func GetEnvConfig

func GetEnvConfig(envName, defaultValue string) string

Types

type Config

type Config struct {
	HostIP   string `yaml:"host_ip"`
	HostPort string `yaml:"host_port"`
	Files    []File `yaml:"files"`
}

func LoadConfigFile

func LoadConfigFile(filePath string) (*Config, error)

type File

type File struct {
	FilePath        string `yaml:"file_path"`
	URLReplacedName string `yaml:"api_replaced_name"`
	CacheInSecond   int64  `yaml:"cache_in_second"` // <=0 means disabled
}

func (*File) IsEnableCache

func (f *File) IsEnableCache() bool

Jump to

Keyboard shortcuts

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