einx

package module
v0.0.0-...-372ebbf Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: Apache-2.0 Imports: 13 Imported by: 12

README

einx

a framework in golang for game server or app server.

a example server for einx (https://github.com/Cyinx/game_server_einx)

Features

  • User-Friendly
  • Flexible
  • Modularity
  • High-Precision Timer Support
  • Simple RPC

Getting Started

Installation
   go get github.com/go-sql-driver/mysql
   go get github.com/yuin/gopher-lua
   go get github.com/Cyinx/einx
Brief
  • Agent - Basic Interface
  • Module - Service worker
  • Network - Network Unit for Module.Implement of Component.
  • Timer - Timer wheel.
Document and Example
License
buy me a coffee

wx ali

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NetworkOption networkOpt = networkOpt{
	Name: network.Name,
	Module: func(s string) Option {
		m := GetModule(s)
		return network.Module(m.(event.EventReceiver))
	},
	ListenAddr:         network.ListenAddr,
	ServeHandler:       network.ServeHandler,
	TransportMaxCount:  network.TransportMaxCount,
	TransportMaxLength: network.TransportMaxLength,
	TransportKeepAlive: network.TransportKeepAlive,
}

Functions

func AddModuleComponent

func AddModuleComponent(m module.Module, c Component, mgr interface{})

func AddTcpServerMgr

func AddTcpServerMgr(m module.Module, addr string, mgr interface{}, opts ...Option)

func Close

func Close()

func ContinueClose

func ContinueClose()

func Init

func Init(opts ...Option)

func NewLuaStae

func NewLuaStae() *lua_state.LuaRuntime

func Run

func Run()

func StartTcpClientMgr

func StartTcpClientMgr(m module.Module, name string, mgr interface{}, opts ...Option)

Types

type Agent

type Agent = agent.Agent

type AgentID

type AgentID = agent.AgentID

type ArgsVar

type ArgsVar = module.ArgsVar

type Component

type Component = component.Component

type ComponentID

type ComponentID = component.ComponentID

type ComponentMgr

type ComponentMgr = module.ComponentMgr

type Context

type Context = context.Context

type EventMsg

type EventMsg = event.EventMsg

type EventReceiver

type EventReceiver = event.EventReceiver

type EventType

type EventType = event.EventType

type ITcpClientMgr

type ITcpClientMgr = network.ITcpClientMgr

type ITcpServerMgr

type ITcpServerMgr = network.ITcpServerMgr

type ITranMsgMultiple

type ITranMsgMultiple = network.ITranMsgMultiple

type LuaRuntime

type LuaRuntime = lua_state.LuaRuntime

type Module

type Module = context.Module

func GetModule

func GetModule(name string) Module

type ModuleRouter

type ModuleRouter = module.ModuleRouter

type MsgHandler

type MsgHandler = module.MsgHandler

type NetLinker

type NetLinker = network.NetLinker

type Option

type Option = func(...interface{})

func LogPath

func LogPath(p string) Option

func OnClosing

func OnClosing(f func()) Option

func Perfomance

func Perfomance(b bool) Option

type ProtoTypeID

type ProtoTypeID = network.ProtoTypeID

type RpcHandler

type RpcHandler = module.RpcHandler

type SessionEventMsg

type SessionEventMsg = event.SessionEventMsg

type SessionHandler

type SessionHandler = network.SessionHandler

type SessionMgr

type SessionMgr = network.SessionMgr

type TimerHandler

type TimerHandler = timer.TimerHandler

type WorkerPool

type WorkerPool = module.WorkerPool

func CreateModuleWorkers

func CreateModuleWorkers(name string, size int) WorkerPool

func GetWorkerPool

func GetWorkerPool(name string) WorkerPool

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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