apps

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultWait

func DefaultWait()

func Start

func Start(app App)

Types

type Api

type Api struct {
	// dependencies
	interfaces.WithConfigPath
	// contains filtered or unexported fields
}

func GetApi

func GetApi() *Api

func NewApi

func NewApi() *Api

func (*Api) GetGinEngine

func (app *Api) GetGinEngine() *gin.Engine

func (*Api) GetHttpServer

func (app *Api) GetHttpServer() *http.Server

func (*Api) Init

func (app *Api) Init()

func (*Api) Start

func (app *Api) Start()

func (*Api) Stop

func (app *Api) Stop()

func (*Api) Wait

func (app *Api) Wait()

type App

type App interface {
	Init()
	Start()
	Wait()
	Stop()
}

type Master

type Master struct {

	// dependencies
	interfaces.WithConfigPath
	// contains filtered or unexported fields
}

func (*Master) GetApi

func (app *Master) GetApi() (api *Api)

func (*Master) GetMasterService

func (app *Master) GetMasterService() (masterSvc interfaces.NodeMasterService)

func (*Master) Init

func (app *Master) Init()

func (*Master) SetGrpcAddress

func (app *Master) SetGrpcAddress(address interfaces.Address)

func (*Master) SetRunOnMaster

func (app *Master) SetRunOnMaster(ok bool)

func (*Master) Start

func (app *Master) Start()

func (*Master) Stop

func (app *Master) Stop()

func (*Master) Wait

func (app *Master) Wait()

type MasterApp

type MasterApp interface {
	NodeApp
	SetRunOnMaster(ok bool)
	GetApi() (api *Api)
	GetMasterService() (masterSvc interfaces.NodeMasterService)
}

func GetMaster

func GetMaster(opts ...MasterOption) MasterApp

func NewMaster

func NewMaster(opts ...MasterOption) (app MasterApp)

type MasterOption

type MasterOption func(app MasterApp)

func WithMasterConfigPath

func WithMasterConfigPath(path string) MasterOption

func WithMasterGrpcAddress

func WithMasterGrpcAddress(address interfaces.Address) MasterOption

func WithRunOnMaster

func WithRunOnMaster(ok bool) MasterOption

type NodeApp

type NodeApp interface {
	App
	interfaces.WithConfigPath
	SetGrpcAddress(address interfaces.Address)
}

type Worker

type Worker struct {

	// dependencies
	interfaces.WithConfigPath
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(opts ...WorkerOption) (app *Worker)

func (*Worker) Init

func (app *Worker) Init()

func (*Worker) SetGrpcAddress

func (app *Worker) SetGrpcAddress(address interfaces.Address)

func (*Worker) Start

func (app *Worker) Start()

func (*Worker) Stop

func (app *Worker) Stop()

func (*Worker) Wait

func (app *Worker) Wait()

type WorkerApp

type WorkerApp interface {
	NodeApp
}

type WorkerOption

type WorkerOption func(app WorkerApp)

func WithWorkerConfigPath

func WithWorkerConfigPath(path string) WorkerOption

func WithWorkerGrpcAddress

func WithWorkerGrpcAddress(address interfaces.Address) WorkerOption

Jump to

Keyboard shortcuts

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