...

Package diarkis

import "github.com/Diarkis/diarkis"
Overview
Index
Subdirectories

Overview ▾

Constants

const (
    // Version This is the version of diarkis
    Version = "0.2.28"
    // Author This is the author of diarkis
    Author = "Diarkis"
)

func GetCPUNumUsed

func GetCPUNumUsed() int

GetCPUNumUsed returns the number of CPU the process is using

func GetDiarkisPath

func GetDiarkisPath() string

GetDiarkisPath Returns the absolute path to diarkis

func GetVer

func GetVer() string

GetVer Returns the version of diarkis

func IsRunning

func IsRunning() bool

IsRunning returns true if diarkis process is running

func IsTerminating

func IsTerminating() bool

IsTerminating returns true when the process is shutting down

func OnReady

func OnReady(task func(func(error)))

OnReady Registers a callback on diarkis ready (This will be invoked before OnStarted while the server is being started) This event is raised after all OnStart tasks have completed their operations.

task func(next func(error)) - Callback to be invoked while Diarkis server process is being started.
Must call next function at the end of the callback to make sure the process moves on to the next task.

func OnReadyLast

func OnReadyLast(lastTask func(func()))

OnReadyLast it is used by ONLY mesh internally

func OnSIGHUP

func OnSIGHUP(task func())

OnSIGHUP Registers a callback on SIGHUP signal

task func() - Callback to be invoked when the server receives the signal.

func OnSIGUSR1

func OnSIGUSR1(task func())

OnSIGUSR1 Registers a callback on SIGUSR1 signal

task func() - Callback to be invoked when the server receives the signal.

func OnSIGUSR2

func OnSIGUSR2(task func())

OnSIGUSR2 Registers a callback on SIGUSR1 signal

task func() - Callback to be invoked when the server receives the signal.

func OnStart

func OnStart(task func())

OnStart Registers a callback on diarkis process start.

task func() - Callback to be invoked when Diarkis server is started.

func OnStarted

func OnStarted(callback func())

OnStarted registers a callback to be invoked when diarkis server process completed all starting operations. This event is raised after all OnReady tasks have completed their operations.

callback func() - Callback to be invoked when Diarkis server finishes all pre-start operations and ready.

func OnTerminate

func OnTerminate(task func(func(error)))

OnTerminate Registers a callback on diarkis process terminate

task func(next func(error)) - Callback to be invoked when the server receives SIGTERM.
next function must be called at the end of the callback to move on to the next callbacks.

func Run

func Run()

Run Starts diarkis process and stops when all operations are done

func Start

func Start()

Start Starts diarkis process and stays running until it is instructed to stop. This function will block until the process is terminated. It will raise OnReady event.

func Stop

func Stop()

Stop Stops diarkis process exit code is 0

func StopWithError

func StopWithError(err error)

StopWithError Stops diarkis process with an error exit code is 1

Subdirectories

Name Synopsis
..
buffpool
build
connector
findport
health-check
mars
mars-stats
client
cpp
tools
nx64
go
bot
modules
group
room
tcp
test
payload
udp
config
datacapsule
debug
dm
encryption
error
eventemitter
field Package field ▷ Field - Unified MMO Allows the users to connect in the same world MMO-style without server separation.
group Package group ▷ Group - Distributed MO Suited for building chat and similar functionalities.
groupSupport
log Package log ▷ Log Diarkis logger.
lib
colorize
msg
std
mars
matching Package matching ▷ Match Maker - Distributed in-memory match making Highly scalable and extremely fast match-making based on application defined match making conditions.
mesh Package mesh ▷ Mesh - Server to server internal communications Mesh manages and controls all internal server to server communications.
lib
announcer
msg
packet
reliable
udp
metrics
mutex
net
packet
process
room
mapping Package mapping ▷ Room Mapping - MMO Style Mapping For Room Allows the room members to "see" each other based on positions (x, y).
roomSupport
scripts
server Package server ▷ Server - UDP/RUDP TCP WebSocket Server Sets up a server as either UDP/RUDP, TCP, or WebSocket server.
connector
http Package http ▷ HTTP - Client entry point and router Routes clients to UDP/RUDP, TCP, and/or, WebSocket servers.
tcp
udp
ws
test
bot
tester
tests
cloud_services
azure
datacapsule
field
http
mapping
mars
matching
mesh
packet
servers
tcp
timed
udp
util
vault
timed
user
util
uuid
v4
vault
wsEncryption