server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Handle(in *codec.Packet) (*codec.Packet, error)
}

Handler handles request from client

type Option

type Option func(o *Options)

func WithCodec

func WithCodec(c codec.Codec) Option

func WithHandler

func WithHandler(handler Handler) Option

func WithHost

func WithHost(host string) Option

func WithPort

func WithPort(port string) Option

type Options

type Options struct {
	Port    string
	Host    string
	Handler Handler
	Codec   codec.Codec
}

type Server

type Server interface {
	Init(opts ...Option) error
	Options() Options
	Start() error
	Stop() error
	Closed() bool
	String() string
}

Server

func NewServer

func NewServer(opts ...Option) Server

func NewTcpServer

func NewTcpServer(opts ...Option) Server

Jump to

Keyboard shortcuts

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