app

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destroy

func Destroy()

func Init

func Init()

func Register

func Register(s Server)

func RegisterCreateServerFunc

func RegisterCreateServerFunc(serverName string, createFunc CreateServerFunc)

func Run

func Run(servers ...Server)

Types

type CreateServerFunc

type CreateServerFunc func(serverId string) Server

func GetCreateServerFunc

func GetCreateServerFunc(serverName string) CreateServerFunc

type Server

type Server interface {
	OnStart()
	Run(closeSig chan bool)
	OnStop()
}

type ServerDefault

type ServerDefault struct {
	ServerId string
	//component
	Components map[string]component.Component
}

func NewServerDefault

func NewServerDefault(serverId string) *ServerDefault

func (*ServerDefault) GetComponent

func (s *ServerDefault) GetComponent(name string) component.Component

func (*ServerDefault) GetServerId

func (s *ServerDefault) GetServerId() string

func (*ServerDefault) OnDestroy

func (s *ServerDefault) OnDestroy()

Destroy components

func (*ServerDefault) OnInit

func (s *ServerDefault) OnInit()

Initialize components

func (*ServerDefault) OnRun

func (s *ServerDefault) OnRun(closeSig chan bool)

Run components

Jump to

Keyboard shortcuts

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