messenger

package
v0.13.7 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorDone = newError("DONE")
)

Functions

This section is empty.

Types

type Messenger

type Messenger interface {
	ReceiveMessage(context.Context) (*MixinMessage, error)
	SendMessage(ctx context.Context, receiver string, b []byte) error
	QueueMessage(ctx context.Context, receiver string, b []byte) error
	BroadcastMessage(ctx context.Context, b []byte) error
	BroadcastPlainMessage(ctx context.Context, text string) error
}

type MixinConfiguration

type MixinConfiguration struct {
	UserId         string `toml:"user"`
	SessionId      string `toml:"session"`
	Key            string `toml:"key"`
	SendBuffer     int    `toml:"send-buffer"`
	ReceiveBuffer  int    `toml:"receive-buffer"`
	ConversationId string `toml:"conversation"`
}

type MixinMessage added in v0.9.8

type MixinMessage struct {
	Peer      string
	Data      []byte
	CreatedAt time.Time
}

type MixinMessenger

type MixinMessenger struct {
	// contains filtered or unexported fields
}

func NewMixinMessenger

func NewMixinMessenger(ctx context.Context, conf *MixinConfiguration) (*MixinMessenger, error)

func (*MixinMessenger) BroadcastMessage

func (mm *MixinMessenger) BroadcastMessage(ctx context.Context, b []byte) error

func (*MixinMessenger) BroadcastPlainMessage

func (mm *MixinMessenger) BroadcastPlainMessage(ctx context.Context, data string) error

func (*MixinMessenger) OnAckReceipt

func (mm *MixinMessenger) OnAckReceipt(ctx context.Context, msg bot.MessageView, userId string) error

func (*MixinMessenger) OnMessage

func (mm *MixinMessenger) OnMessage(ctx context.Context, msg bot.MessageView, userId string) error

func (*MixinMessenger) QueueMessage

func (mm *MixinMessenger) QueueMessage(ctx context.Context, receiver string, b []byte) error

func (*MixinMessenger) ReceiveMessage

func (mm *MixinMessenger) ReceiveMessage(ctx context.Context) (*MixinMessage, error)

func (*MixinMessenger) SendMessage

func (mm *MixinMessenger) SendMessage(ctx context.Context, receiver string, b []byte) error

func (*MixinMessenger) SyncAck

func (mm *MixinMessenger) SyncAck() bool

Jump to

Keyboard shortcuts

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