app

package
v0.0.0-...-ff80121 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	EnvProd = "prod"
	EnvPre  = "pre"
	EnvTest = "test"
	EnvDev  = "dev"
)

allowed app env name

View Source
const (
	Timezone = "PRC"
	BaseDate = "2006-01-02 15:04:05"

	Timeout     = 10
	PageSize    = 20
	PageSizeStr = "20"
	MaxPageSize = 100

	ConfigSuffix = ".toml"
)

for application

View Source
const RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00"
View Source
const RFC3339Normal = "2006-01-02 15:04:05"
View Source
const RFC3339Shorted = "2006/01/02 15:04:05"

Variables

View Source
var (
	EnvName = "dev"
	Name    = "go-web-skeleton"

	Debug bool

	Hostname string
	RootPath string
	GitInfo  model.GitInfo

	HttpPort = 9440
	// AbsPath always return abs path.
	AbsPath = helper.GetRootPath()
)

application info

View Source
var WorkDir, _ = os.Getwd()

the app work dir path

Functions

func FormatPageAndSize

func FormatPageAndSize(page int, size int) (int, int)

FormatPageAndSize

func InitLogger

func InitLogger() error

initLog init log setting

func IsEnv

func IsEnv(env string) bool

IsEnv current env name check

func LocUnixTime

func LocUnixTime() int64

LocUnixTime get local unix time

func PRCTime

func PRCTime() time.Time

PRCTime get PRC local time

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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