config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENV_PANDA_PLATFORM_DOWNLOAD_QUERY    = "ENV_PANDA_PLATFORM_DOWNLOAD_QUERY"
	ENV_PANDA_PLATFORM_DOWNLOAD_CALLBACK = "ENV_PANDA_PLATFORM_DOWNLOAD_CALLBACK"
	ENV_PANDA_PLATFORM_DOWNLOAD          = "ENV_PANDA_PLATFORM_DOWNLOAD"
	ENV_PANDA_PLATFORM_HEART             = "ENV_PANDA_PLATFORM_HEART"
	ENV_PANDA_LOGDIR_DEFAULT             = "ENV_PANDA_LOGDIR_DEFAULT"
)

Variables

This section is empty.

Functions

func Init

func Init(ctx *cli.Context) error

Init parse the yaml configuration file

Types

type Config

type Config struct {
	ConfigDir   string `yaml:"-"`
	Env         string `yaml:"-"`
	Transformer struct {
		MaxDownloader            int    `yaml:"MaxParallelNumber"`
		MaxDownloadRetry         int    `yaml:"MaxRetryNumber"`
		TransformPartSize        int    `yaml:"SliceSize"`
		SingleDownloadMaxWorkers int    `yaml:"MaxSliceNumber"`
		WorkDir                  string `yaml:"WorkDir"`
	} `yaml:"Transmission"`
	Miner struct {
		SealedPath      string `yaml:"StoreSealedPath"`
		SealedCachePath string `yaml:"StoreCachePath"`
		APIToken        string `yaml:"APIToken"`
		ID              string `yaml:"ID"`
		StorageID       string `yaml:"StorageID"`
		Address         string `yaml:"Address"`
	} `yaml:"Miner"`
	Log struct {
		Level string `yaml:"Level"`
		Dir   string `yaml:"Dir"`
	} `yaml:"Log"`
	GH struct {
		QueryURL       string        `yaml:"QueryURL"`
		CallBack       string        `yaml:"CallBack"`
		DownloadURL    string        `yaml:"DownloadURL"`
		Timeout        int           `yaml:"Timeout"`
		PingURL        string        `yaml:"HeartURL"`
		CheckFrequency time.Duration `yaml:"CheckFrequency"`
		HeartFrequency time.Duration `yaml:"HeartFrequency"`
		Token          string        `yaml:"Token"`
	} `yaml:"Platform"`
}
var (
	AppConfig Config
)

global app config variable

func GetConfig

func GetConfig() Config

GetConfig return the config

Jump to

Keyboard shortcuts

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