server

package
v0.0.0-...-3b1ec4e Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// service name
	Name string

	// net type
	Net string
	// addr type
	Addr string

	// for etcd, like an uniqie id
	Id string
	// contains filtered or unexported fields
}

Service represents a server instance (a server process), Any server can include more than one service, i.e, any server can be plugged into multile modules, like TcpServerTransport, UdpServerTransport, Broker, etc. By this way, we can implement more modules to extend server's abilities.

func NewService

func NewService(name string, net, addr, codec string, c clientv3.Config) *Service

create a new server with option

func (*Service) ListenAndServe

func (r *Service) ListenAndServe(ctx context.Context, router *router.Router) error

block func

Jump to

Keyboard shortcuts

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