server

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Publisher is the service(s) publisher
	Publisher = "example"
	// ServiceEcho is the echo service
	ServiceEcho = "echo.v1.0"
)

Variables

This section is empty.

Functions

func Run

func Run(opts []as.Option)

Run runs the server.

Types

type MessageReply

type MessageReply struct {
	*MessageRequest
	Signature string
}

MessageReply is the message replied by server, with Num+1 and a signature of "yours echo.v1.0".

type MessageRequest

type MessageRequest struct {
	Msg string
	Num int32
}

MessageRequest is the message sent by client. Return MessageReply.

func (*MessageRequest) Handle

func (msg *MessageRequest) Handle(stream as.ContextStream) (reply interface{})

Handle handles msg.

type MessageTimeout added in v0.9.17

type MessageTimeout struct{}

MessageTimeout is for timeout test

func (MessageTimeout) Handle added in v0.9.17

func (msg MessageTimeout) Handle(stream as.ContextStream) (reply interface{})

Handle handles msg.

type SubWhoElseEvent

type SubWhoElseEvent struct{}

SubWhoElseEvent is used for clients to subscribe who else event which reports new incoming connection to the server. Return string.

func (SubWhoElseEvent) Handle

func (msg SubWhoElseEvent) Handle(stream as.ContextStream) (reply interface{})

Handle handles msg.

type WhoElse

type WhoElse struct{}

WhoElse reports all client addresses the server has so far. Return string.

func (WhoElse) Handle

func (msg WhoElse) Handle(stream as.ContextStream) (reply interface{})

Handle handles msg.

Jump to

Keyboard shortcuts

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