brian

package module
v1.0.1-0...-e52dcc8 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 34 Imported by: 0

README

hugo-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Name                 string `properties:"brian.application.name"`                  //应用名称
	LogLevel             string `properties:"brian.application.log.level"`             // 日志级别
	EnableRpcServer      bool   `properties:"brian.application.enable.RpcServer"`      //是否开启rpc服务
	EnableRegistryCenter bool   `properties:"brian.application.enable.RegistryCenter"` //是否启用注册中心
	EnableServerClient   bool   `properties:"brian.application.enable.ServerClient"`   //是否开启客户端链接
	RefreshTime          int    `properties:"brian.application.servers.refresh.time"`  //本地服务列表刷新时间
	// contains filtered or unexported fields
}

Application is the framework's instance, it contains the servers, workers, client and configuration settings. Create an instance of Application, by using &Application{}

func DefaultApplication

func DefaultApplication() *Application

获取默认的应用

func RewConfigApplication

func RewConfigApplication() *Application

创建一个读取配置文件的application

func (*Application) GracefulStop

func (app *Application) GracefulStop(ctx context.Context) (err error)

GracefulStop 完成必要的清理后停止应用程序

func (*Application) RegisterController

func (app *Application) RegisterController(con xhttp.Controller)

RegisterController 注册controller

func (*Application) RegisterRpcServer

func (app *Application) RegisterRpcServer(in interface{}, srv interface{})

RegisterRpcServer 注册rpc服务

func (*Application) Run

func (app *Application) Run() error

Run run application

func (*Application) Serve

func (app *Application) Serve(s server.Server) error

注册服务

func (*Application) Startup

func (app *Application) Startup(fns ...func() error) error

提供外部启动应用执行

func (*Application) Stop

func (app *Application) Stop() (err error)

Stop 完成必要的清理后立即停止程序

func (*Application) Work

func (app *Application) Work(w worker.Worker) error

注册工作刘

Jump to

Keyboard shortcuts

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