config

package
v0.0.0-...-86cf879 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// C Global configuration (Must Load first, otherwise the configuration will not be available)
	C = new(Config)
)

Functions

func MustLoad

func MustLoad(fpaths ...string) error

MustLoad load config

func ParseConfigByEnv

func ParseConfigByEnv() error

func PrintWithJSON

func PrintWithJSON()

Types

type Cfssl

type Cfssl struct {
	ConfigFile string
	OCSPHost   string
	Config     *cfssl_config.Config
}

type Config

type Config struct {
	RunMode      string
	PrintConfig  bool
	TLS          TLS
	OCSP         OCSP
	Log          Log
	LogRedisHook LogRedisHook
	Cfssl        Cfssl
	Storage      Storage
	Ipfs         Ipfs
	Web3Storage  Web3Storage
	Contract     Contract
}

func (*Config) IsDebugMode

func (c *Config) IsDebugMode() bool

func (*Config) IsReleaseMode

func (c *Config) IsReleaseMode() bool

type Contract

type Contract struct {
	Address    string
	PrivateKey string
	RpcUrl     string
}

type Ipfs

type Ipfs struct {
	Host string
	Port int
}

type Log

type Log struct {
	Level         int
	Format        string
	Output        string
	OutputFile    string
	EnableHook    bool
	HookLevels    []string
	Hook          LogHook
	HookMaxThread int
	HookMaxBuffer int
}

type LogGormHook

type LogGormHook struct {
	DBType       string
	MaxLifetime  int
	MaxOpenConns int
	MaxIdleConns int
	Table        string
}

type LogHook

type LogHook string

func (LogHook) IsRedis

func (h LogHook) IsRedis() bool

type LogRedisHook

type LogRedisHook struct {
	Addr string
	Key  string
}

type OCSP

type OCSP struct {
	Host               string
	Port               int
	ShutdownTimeout    int
	MaxContentLength   int64
	MaxReqLoggerLength int `default:"1024"`
	MaxResLoggerLength int
}

OCSP Configuration parameters

type Redis

type Redis struct {
	Addr     string
	Password string
}

type Storage

type Storage struct {
	Type string
}

func (Storage) IsIpfs

func (h Storage) IsIpfs() bool

func (Storage) IsWeb3Storage

func (h Storage) IsWeb3Storage() bool

type TLS

type TLS struct {
	Host               string
	Port               int
	CertFile           string
	KeyFile            string
	Cert               []byte
	Key                []byte
	ShutdownTimeout    int
	MaxContentLength   int64
	MaxReqLoggerLength int `default:"1024"`
	MaxResLoggerLength int
}

TLS Configuration parameters

type Web3Storage

type Web3Storage struct {
	Token      string
	EncryptKey string
	Timeout    int
	RetryCount int
}

Jump to

Keyboard shortcuts

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