xnotice

package
v0.0.0-...-e7f7af0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: AGPL-3.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHandler

func MakeHandler(msgGetter NSender, msgSetter NReceiver) func(c *websocket.Conn, ctx echo.Context) error

func MemoryNoticeSender

func MemoryNoticeSender(ctx context.Context, customer *dbschema.OfficialCustomer) (func(), <-chan *notice.Message, error)

func OnlineStatusDBUpdater

func OnlineStatusDBUpdater(ctx context.Context, customer *dbschema.OfficialCustomer) (func(), <-chan *notice.Message, error)

func OnlineStatusQueueUpdater

func OnlineStatusQueueUpdater(ctx context.Context, customer *dbschema.OfficialCustomer) (func(), <-chan *notice.Message, error)

func RegisterRoute

func RegisterRoute(r echo.RouteRegister)

func RegsterCmder

func RegsterCmder()

./webx --config ./config/config.yaml --type queue:worker

func ResetClientCount

func ResetClientCount()

func SendOnlineStatusToQueue

func SendOnlineStatusToQueue(sessionId string, customerID uint64, online bool) error

Types

type CustomerOnline

type CustomerOnline struct {
	SessionID  string `json:"sessID"`
	CustomerID uint64 `json:"custID"`
	Online     bool   `json:"online"`
}

func (*CustomerOnline) Apply

func (c *CustomerOnline) Apply() error

type NReceiver

type NReceiver func(context.Context, *dbschema.OfficialCustomer, []byte) ([]byte, error)
var (
	DefaultSender   = MemoryNoticeSender
	DefaultReceiver NReceiver
)

type NSender

type NSender func(context.Context, *dbschema.OfficialCustomer) (close func(), msg <-chan *notice.Message, err error)

func GetNSenderFromConfig

func GetNSenderFromConfig(cfg echo.H) NSender

Jump to

Keyboard shortcuts

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