application

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 8 Imported by: 2

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
	Version string
	// contains filtered or unexported fields
}

Application is the application service. It contains all the services and configurations.

func New

func New(name, version string, logger *zap.Logger, opts ...Option) (*Application, error)

New returns a new Application.

func (*Application) AwaitSignal

func (a *Application) AwaitSignal()

AwaitSignal await the signal to stop the server

func (*Application) Start

func (a *Application) Start() error

Start Application.

func (*Application) Stop

func (a *Application) Stop() error

Stop Application.

type Option

type Option func(app *Application) error

Option is the option of application.

func WithGrpcServer

func WithGrpcServer(s *grpc.Server) Option

WithGrpcServer sets the grpc server.

func WithHttpServer

func WithHttpServer(s *http.Server) Option

WithHttpServer sets the http server.

func WithMinioCli

func WithMinioCli(c *minio.Client) Option

WithMinioCli sets the minio client.

Jump to

Keyboard shortcuts

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