base

package
v1.0.58 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//Server
	EnvHost           *utils.EnvGetter = utils.GetterDefault("HOST", "0.0.0.0")
	EnvPort           *utils.EnvGetter = utils.GetterDefault("PORT", 8888)
	EnvNode           *utils.EnvGetter = utils.GetterDefault("Node", 1)
	EnvServerEndpoint *utils.EnvGetter = utils.GetterDefault("SERVER_ENDPOINT", "")

	// IP
	EnvIPUseCwd   *utils.EnvGetter = utils.GetterDefault("IP_USE_CWD", false)
	EnvIPDatabase *utils.EnvGetter = utils.GetterDefault("IP_DATABASE", "./GeoLite2-City.mmdb")
)

Functions

func GetOrmLogger added in v1.0.32

func GetOrmLogger() *xorm.SimpleLogger

func MustBoot

func MustBoot(features BootFeature) *common.BootContext

Types

type BootFeature

type BootFeature int
const (
	// 不使用
	BootWithNone BootFeature = 0
	// 使用dotenv
	BootWithEnv BootFeature = 1 << 1
	// 使用session
	BootWithSession BootFeature = 1 << 1
	// 使用redis
	BootWithRedis BootFeature = 1 << 2
	// 使用orm, mysql
	BootWithOrm BootFeature = 1 << 3
	// 使用Logger
	BootWithLogger BootFeature = 1 << 4
	// 使用Ip
	BootWithIp BootFeature = 1 << 5
	// 默认全部开启
	BootWithDefault BootFeature = BootWithEnv |
		BootWithSession |
		BootWithRedis |
		BootWithOrm |
		BootWithLogger
)

Jump to

Keyboard shortcuts

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