ppcserver

package module
v0.0.0-...-2bfb83d Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 7 Imported by: 0

README

ppcserver

Go Reference Go Report Card

A Go multiplayer game server framework featured real-time WebSocket communication, Stateful Room, and distributed scaling via NATS.

Documentation

Design Concept

  • Bound with minimal package dependencies so that you can choose the ones according to your actual needs.
  • Easy to connect through plain WebSocket API with no custom client library required.

Documentation

Overview

Package ppcserver is a Go multiplayer game server framework featured real-time WebSocket communication, Stateful Room, and distributed scaling via NATS. The package is under development, intending to release the first available version in 2022.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	Start(ctx context.Context) error
	Shutdown(ctx context.Context) error
}

type Server

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

func NewServer

func NewServer(opts ...ServerOption) *Server

func (*Server) Start

func (s *Server) Start()

type ServerOption

type ServerOption func(s *Server)

ServerOption is a function to apply various configurations to customize a Server.

func WithComponent

func WithComponent(c Component) ServerOption

WithComponent is a ServerOption to register a Component to Server.components.

func WithShutdownTimeout

func WithShutdownTimeout(d time.Duration) ServerOption

WithShutdownTimeout is a ServerOption to set the maximum time for each Component.Shutdown() to complete.

type ServerOptions

type ServerOptions struct {
	// ShutdownTimeout is the maximum time for Component.Shutdown() to complete.
	// Defaults to 1 minute if not set via WithShutdownTimeout.
	ShutdownTimeout time.Duration
}

ServerOptions defines the configurable opts of the Server.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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