extapp

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatal

func Fatal(msgs ...interface{})

Fatal log fatal and exit with code 1.

func FatalOnError

func FatalOnError(err error)

FatalOnError log fatal and exit with code 1.

func FatalOnErrorf

func FatalOnErrorf(err error, format string, args ...interface{})

FatalOnErrorf call fatal with format.

Types

type App

type App struct {
	// App app name.
	App string
	// Logger is zap logger instance.
	Logger *log.Logger
	// Reg is prometheus Registerer.
	Reg prometheus.Registerer
	// G is run.Group handle goroutines exit.
	G *run.Group
	// contains filtered or unexported fields
}

App is kit core application.

func NewApp

func NewApp() *App

NewApp create new App instance.

func (*App) AddProber added in v0.2.0

func (a *App) AddProber(p prober.Probe)

AddProber can combine your prober.

func (*App) GetInnerHTTPServer added in v0.2.0

func (a *App) GetInnerHTTPServer() *exthttp.MuxServer

GetInnerHTTPServer get inner metrice pprof health http server should call after InitFromCmd.

func (*App) GinServer

func (a *App) GinServer(opts ...exthttp.OptionFunc) *gin.Engine

GinServer create a gin server with many components controlled by commandline options.

func (*App) GrpcServer

func (a *App) GrpcServer(opts ...extgrpc.Option) *extgrpc.Server

GrpcServer create a grpc server with many components controlled by commandline options.

func (*App) InitFromCmd

func (a *App) InitFromCmd(cmd *cobra.Command, name string)

InitFromCmd init components which depend commandline options should always be called at first of cobra.Command.Run.

func (*App) Run

func (a *App) Run(cmd *cobra.Command)

Run register all the commandline flags should be called in main function.

func (*App) Start

func (a *App) Start() error

Start start our application.

Jump to

Keyboard shortcuts

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