plugins

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func GetPlugins

func GetPlugins() map[string]contracts.PluginInterface

func RegisterPlugin

func RegisterPlugin(name string, pluginInterface contracts.PluginInterface)

Types

type EmptyPubSub

type EmptyPubSub struct{}

func (*EmptyPubSub) Close

func (e *EmptyPubSub) Close() error

func (*EmptyPubSub) ID

func (e *EmptyPubSub) ID() string

func (*EmptyPubSub) Info

func (e *EmptyPubSub) Info() any

func (*EmptyPubSub) Subscribe

func (e *EmptyPubSub) Subscribe() <-chan []byte

func (*EmptyPubSub) ToAll

func (e *EmptyPubSub) ToAll(message WebsocketMessage) error

func (*EmptyPubSub) ToOthers

func (e *EmptyPubSub) ToOthers(message WebsocketMessage) error

func (*EmptyPubSub) ToSelf

func (e *EmptyPubSub) ToSelf(message WebsocketMessage) error

func (*EmptyPubSub) Uid

func (e *EmptyPubSub) Uid() string

type Message

type Message struct {
	Data []byte
	To   websocket_pb.To
	ID   string
}

func DecodeMessage

func DecodeMessage(data []byte) (msg Message, err error)

func ProtoToMessage

func ProtoToMessage(m proto.Message, to websocket_pb.To, id string) Message

func (Message) Marshal

func (m Message) Marshal() []byte

type Picture

type Picture struct {
	Url       string
	Copyright string
}

type PictureInterface

type PictureInterface interface {
	Get(ctx context.Context, random bool) (*Picture, error)
}

func GetPicture

func GetPicture() PictureInterface

type PubSub

type PubSub interface {
	Info() any
	Uid() string
	ID() string
	ToSelf(WebsocketMessage) error
	ToAll(WebsocketMessage) error
	ToOthers(WebsocketMessage) error
	Subscribe() <-chan []byte
	Close() error
}

type WebsocketMessage

type WebsocketMessage interface {
	proto.Message
	GetMetadata() *websocket_pb.Metadata
}

type WsMetadataResponse

type WsMetadataResponse = websocket_pb.WsMetadataResponse

type WsSender

type WsSender interface {
	New(uid, id string) PubSub
}

func GetWsSender

func GetWsSender() WsSender

Jump to

Keyboard shortcuts

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