appengine

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cron = "0 */10 * * * *"
)

Variables

This section is empty.

Functions

func AppGetName

func AppGetName() string

获取app名

func ExitApplication

func ExitApplication(appInstance Application)

系统退出的释放操作

func Heartbeat

func Heartbeat(c *gin.Context)

心跳包

func InitAppframe

func InitAppframe(appInstance Application)

初始化服务层app框架

func InitApplication

func InitApplication(appName string)

初始化整个系统

func InitRouter

func InitRouter() *gin.Engine

初始化Router

func QuitServer

func QuitServer(server *http.Server)

退出 http Server

func RunApplication

func RunApplication(appInstance Application)

RunApplication

func RunCustomProgram

func RunCustomProgram(program ...func(*sync.WaitGroup, chan struct{}))

启动自定义程序

func StartCronTask

func StartCronTask(taskList []CronTask) error

开启定时任务

func StartServer

func StartServer(router *gin.Engine, appPort int)

启动 http Server

func StopCronTask

func StopCronTask()

Types

type AccessErrLogger

type AccessErrLogger struct{}

func (*AccessErrLogger) Write

func (a *AccessErrLogger) Write(p []byte) (n int, err error)

gin Write

type AccessInfoLogger

type AccessInfoLogger struct{}

func (*AccessInfoLogger) Write

func (a *AccessInfoLogger) Write(p []byte) (n int, err error)

gin Write

type Application

type Application interface {
	/*路由相關配置初始化*/
	RegisterHttpRoute(r *gin.Engine) error

	/*應用程序初始化方法*/
	Init() error

	/*應用程序退出*/
	Exit() error
}

type CronLog

type CronLog struct{}

func (CronLog) Error

func (c CronLog) Error(err error, msg string, keysAndValues ...interface{})

Error logs an error condition.

func (CronLog) Info

func (c CronLog) Info(msg string, keysAndValues ...interface{})

Info logs routine messages about cron's operation.

type CronTask

type CronTask struct {
	Cron     string // 定时参数的格式 Second | Minute | Hour | Dom | Month | Week
	TaskFunc func()
}

type WebAppEngine

type WebAppEngine struct {
	Name    string
	AppPort int
	// contains filtered or unexported fields
}

ListenerApplication ...

Jump to

Keyboard shortcuts

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