module

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName_Net      string = "net-module"
	ModuleName_Transact        = "dtc-module"
)
View Source
const (
	///module state
	ModuleStateInvalid int = iota
	ModuleStateInit
	ModuleStateRun
	ModuleStateShutdown
	ModuleStateWaitShutdown
	ModuleStateFini
	///other
	ModuleMaxCount = 1024
)

Variables

View Source
var (
	AppModule = newModuleMgr()
)
View Source
var Config = Configuration{}

Functions

func RegisteModule

func RegisteModule(m Module, tickInterval time.Duration, priority int)

func RegistePreloadModule

func RegistePreloadModule(m PreloadModule, priority int)

func Start

func Start() *utils.Waitor

func Stop

func Stop()

func UnregisteModule

func UnregisteModule(m Module)

Types

type Configuration

type Configuration struct {
	Options basic.Options
}

func (*Configuration) Close

func (c *Configuration) Close() error

func (*Configuration) Init

func (c *Configuration) Init() error

func (*Configuration) Name

func (c *Configuration) Name() string

type Module

type Module interface {
	ModuleName() string
	Init()
	Update()
	Shutdown()
}

type ModuleEntity

type ModuleEntity struct {
	// contains filtered or unexported fields
}

type ModuleMgr

type ModuleMgr struct {
	*basic.Object
	// contains filtered or unexported fields
}

func (*ModuleMgr) Close

func (this *ModuleMgr) Close()

func (*ModuleMgr) GetCurrTime

func (this *ModuleMgr) GetCurrTime() time.Time

func (*ModuleMgr) GetCurrTimeNano

func (this *ModuleMgr) GetCurrTimeNano() int64

func (*ModuleMgr) GetCurrTimeSec

func (this *ModuleMgr) GetCurrTimeSec() int64

func (*ModuleMgr) GetModuleByName

func (this *ModuleMgr) GetModuleByName(name string) Module

func (*ModuleMgr) OnStart

func (this *ModuleMgr) OnStart()

func (*ModuleMgr) OnStop

func (this *ModuleMgr) OnStop()

func (*ModuleMgr) OnTick

func (this *ModuleMgr) OnTick()

func (*ModuleMgr) RegisteModule

func (this *ModuleMgr) RegisteModule(m Module, tickInterval time.Duration, priority int)

func (*ModuleMgr) RegistePreloadModule

func (this *ModuleMgr) RegistePreloadModule(m PreloadModule, priority int)

func (*ModuleMgr) Start

func (this *ModuleMgr) Start() *utils.Waitor

func (*ModuleMgr) UnregisteModule

func (this *ModuleMgr) UnregisteModule(m Module)

func (*ModuleMgr) UnregistePreloadModule

func (this *ModuleMgr) UnregistePreloadModule(m PreloadModule)

type PreloadModule

type PreloadModule interface {
	Start()
}

type PreloadModuleEntity

type PreloadModuleEntity struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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