module

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS = iota
	STATUS_REGISTERED
	STATUS_INITIALIZED
	STATUS_STARTED
	STATUS_TERMINATED
)

Variables

This section is empty.

Functions

func Init

func Init()

func RegisterModule

func RegisterModule(mod *Module)

func Start

func Start()

func Terminate

func Terminate()

Types

type IModule

type IModule interface {
	// Call when register
	Register()

	// Call when initializing, after init config
	Init()

	// Call when start, after root router initialized
	Start()

	// Call before exit
	Terminate()
}

type Module

type Module struct {
	IModule
	Name        string
	Description string
	Initializor func(m *Module)
	Starter     func(m *Module)
	Terminater  func(m *Module)
	Priority    int
	Status      int
}

func (*Module) Init

func (m *Module) Init()

func (*Module) Register

func (*Module) Register()

func (*Module) Start

func (m *Module) Start()

func (*Module) Terminate

func (m *Module) Terminate()

Jump to

Keyboard shortcuts

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