config

package
v3.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfigFile

func CreateConfigFile(filepath string)

CreateConfigFile 生成配置文件

func LoadConfig

func LoadConfig(filepath string) string

LoadConfig 加载配置文件 返回使用的配置文件

func RegisterDefaultConfig

func RegisterDefaultConfig(data []byte)

func WriteConfig

func WriteConfig(write func(config *Config))

WriteConfig 写入配置

Types

type BaseConfig

type BaseConfig struct {
	Path    string `json:"path"`
	Output  string `json:"out"`
	LogFile string `json:"log"`
}

type Config

type Config struct {
	BaseConfig
	Optional OptionalConfig `json:"optional"`
	Repo     RepoConfig     `json:"repo"`
	Origin   OriginConfig   `json:"origin"`
}

func Conf

func Conf() *Config

type OptionalConfig

type OptionalConfig struct {
	UI          bool   `json:"ui"`
	Dedup       bool   `json:"dedup"`
	DirOnly     bool   `json:"dir"`
	VulnOnly    bool   `json:"vuln"`
	SaveDev     bool   `json:"dev"`
	ProgressBar bool   `json:"progress"`
	TLSVerify   bool   `json:"tls"`
	Proxy       string `json:"proxy"`
}

type OriginConfig

type OriginConfig struct {
	Url    string    `json:"url"`
	Token  string    `json:"token"`
	Proj   *string   `json:"proj"`
	Json   string    `json:"json"`
	Mysql  SqlOrigin `json:"mysql"`
	Sqlite SqlOrigin `json:"sqlite"`
}

type RepoConfig

type RepoConfig struct {
	Maven    []common.RepoConfig `json:"maven"`
	Npm      []common.RepoConfig `json:"npm"`
	Composer []common.RepoConfig `json:"composer"`
}

type SqlOrigin

type SqlOrigin struct {
	Dsn   string `json:"dsn"`
	Table string `json:"table"`
}

Jump to

Keyboard shortcuts

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