config

package
v0.0.0-...-7f41b1e Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// EnvLogLevel
	//	env ENV_WEB_LOG_LEVEL default ""
	EnvLogLevel string = "LOG_LEVEL"
	// EnvHttpsEnable
	//	env ENV_WEB_HTTPS_ENABLE default false
	EnvHttpsEnable string = "HTTPS_ENABLE"
	// EnvHostName
	//	env ENV_WEB_HOSTNAME default ""
	EnvHostName string = "HOSTNAME"
	// EnvHostPort
	//	env ENV_WEB_HOST_PORT default ""
	EnvHostPort string = "HOST_PORT"
	// EnvAutoGetHost
	//	env ENV_AUTO_HOST default true, will use local ipv4
	EnvAutoGetHost string = "AUTO_HOST"
)

Variables

This section is empty.

Functions

func Addr

func Addr() string

Addr

get Addr

func BaseURL

func BaseURL() string

BaseURL

get base url

func GinRunMode

func GinRunMode() string

GinRunMode

get gin run mode

func Init

func Init(cfg string) error

Init read default config by conf/config.yaml can change by CLI by `-c` this config can config by ENV ENV_WEB_HTTPS_ENABLE=false ENV_AUTO_HOST=true ENV_WEB_HOST 127.0.0.1:8000

func MockInitSample

func MockInitSample(host string, baseUrl string, sslEnable bool) *gin.Engine

MockInitSample for unit test

Types

type BaseConf

type BaseConf struct {
	Addr      string
	BaseURL   string
	SSLEnable bool
}

type Config

type Config struct {
	Name string
}

Jump to

Keyboard shortcuts

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