app

package
v0.0.0-...-6ed6c48 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvProd = "prod"
	EnvTest = "test"
	EnvDev  = "dev"
)
View Source
const (
	BaseConfigFile = "app.toml"
	DefaultAppName = "omni-repository"
)

Variables

View Source
var (
	// App name
	Name string
	//Debug mode
	Debug bool
	//Current host name
	Hostname string
	//App port listen to
	//Env name
	EnvName = EnvDev
	//App git info
	Info ApplicationInfo
)
View Source
var (
	AppConfig appconfig.Config
)
View Source
var Logger *zap.Logger

Functions

func Bootstrap

func Bootstrap(configDir, tag, commitID, releaseAt string)

func LocTime

func LocTime() time.Time

LocTime get local time

Types

type ApplicationInfo

type ApplicationInfo struct {
	Tag       string `json:"tag" description:"get tag name"`
	CommitID  string `json:"commitID" description:"git commit ID."`
	ReleaseAt string `json:"releaseAt" description:"build date"`
}

type JsonData

type JsonData struct {
	Code   int         `json:"code"`
	Title  interface{} `json:"title"`
	Attach interface{} `json:"attach,omitempty"`
	Data   interface{} `json:"data"`
	Other  interface{} `json:"other,omitempty"`
}

JsonData export to clent

func ExportData

func ExportData(code int, title interface{}, data ...interface{}) *JsonData

ExportData ExportData

Jump to

Keyboard shortcuts

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