Back to godoc.org
github.com/douyu/jupiter

Package jupiter

v0.2.5
Latest Go to latest

The latest major version is .

Published: Sep 7, 2020 | License: Apache-2.0 | Module: github.com/douyu/jupiter

Index

Constants

const (
	//StageAfterStop after app stop
	StageAfterStop uint32 = iota + 1
	//StageBeforeStop before app stop
	StageBeforeStop
)

type Application

type Application struct {
	// 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 DefaultApp

func DefaultApp() *Application

func New

func New(fns ...func() error) (*Application, error)

New new a Application

func (*Application) GracefulStop

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

GracefulStop application after necessary cleanup

func (*Application) Job

func (app *Application) Job(runner job.Runner) error

Job ..

func (*Application) RegisterHooks

func (app *Application) RegisterHooks(k uint32, fns ...func() error) error

RegisterHooks register a stage Hook

func (*Application) Run

func (app *Application) Run(servers ...server.Server) error

Run run application

func (*Application) Schedule

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

Schedule ..

func (*Application) Serve

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

Serve start server

func (*Application) SetRegistry

func (app *Application) SetRegistry(reg registry.Registry)

SetRegistry set customize registry

func (*Application) Startup

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

Startup ..

func (*Application) Stop

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

Stop application immediately after necessary cleanup

func (*Application) WithOptions

func (a *Application) WithOptions(options ...Option)

type Disable

type Disable int
const (
	DisableParserFlag      Disable = 1
	DisableLoadConfig      Disable = 2
	DisableDefaultGovernor Disable = 3
)

type Option

type Option func(a *Application)

func WithConfigParser

func WithConfigParser(unmarshaller conf.Unmarshaller) Option

func WithDisable

func WithDisable(d Disable) Option

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier