chatservice

package
v0.0.0-...-9508e94 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(
	ctx context.Context,
	createService func(ctx context.Context, appConfig interface{}) (*ServiceInterface, error),
) error

Serve starts the server.

appConfig is a type defined by the application programmer to hold application-level configuration.

Types

type Service

type Service interface {
	OnChatClientSendMessage(ctx context.Context) error
	OnChatServiceConnect(ctx context.Context) error
}

Service is the interface for ChatService clients.

type ServiceInterface

type ServiceInterface struct {
	OnChatClientSendMessage func(ctx context.Context, msg map[string]interface{}, relayChatServiceSendMessage func(args ...interface{})) error
	OnChatServiceConnect    func(ctx context.Context, msg map[string]interface{}, emitMOTD func(args ...interface{})) error
}

ServiceInterface for ChatService. Implementations of these methods must be provided.

Jump to

Keyboard shortcuts

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