starter

package
v0.0.0-...-531eea5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StarterManager = new(starterManager)

StarterManager 全局的启动器

Functions

func Register

func Register(starter Starter)

Register 全局注册启动器的方法

Types

type BaseStarter

type BaseStarter struct{}

BaseStarter 基础启动器

func (*BaseStarter) Init

func (s *BaseStarter) Init(ctx StarterContext)

Init 初始化

func (*BaseStarter) SetUp

func (s *BaseStarter) SetUp(ctx StarterContext)

SetUp 建立环境

func (*BaseStarter) Start

func (s *BaseStarter) Start(ctx StarterContext)

Start 启动

func (*BaseStarter) StartBlocking

func (s *BaseStarter) StartBlocking() bool

StartBlocking 启动是否阻塞

func (*BaseStarter) Stop

func (s *BaseStarter) Stop(ctx StarterContext)

Stop 优雅的停止

type Starter

type Starter interface {
	Init(StarterContext)
	SetUp(StarterContext)
	Start(StarterContext)
	StartBlocking() bool
	Stop(StarterContext)
}

Starter 启动器接口

type StarterContext

type StarterContext map[string]interface{}

StarterContext 启动器的上下文

Jump to

Keyboard shortcuts

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