message

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultNamespace = "minecraft"

Variables

View Source
var ValidIdentifierRegex = regexp.MustCompile(`[a-z0-9\\-_]*`)

Functions

This section is empty.

Types

type ChannelIdentifier

type ChannelIdentifier interface {
	// Returns the channel identifier.
	Id() string
}

ChannelIdentifier is a channel identifier for use with plugin messaging.

func NewChannelIdentifier

func NewChannelIdentifier(namespace, name string) (ChannelIdentifier, error)

NewChannelIdentifier returns a new validated channel identifier.

func NewDefaultNamespace

func NewDefaultNamespace(name string) (ChannelIdentifier, error)

func NewLegacyChannelIdentifier

func NewLegacyChannelIdentifier(name string) ChannelIdentifier

type ChannelMessageSink

type ChannelMessageSink interface {
	// Sends a plugin message to the channel with id.
	SendPluginMessage(id ChannelIdentifier, data []byte) error
}

ChannelMessageSink can receive plugin messages.

type ChannelMessageSource

type ChannelMessageSource interface{}

ChannelMessageSource is a source of plugin messages.

type ChannelRegistrar

type ChannelRegistrar interface {
	// Registers the specified message identifiers to listen on so you can
	// intercept plugin messages on the channel using the PluginMessageEvent.
	Register(ids ...ChannelIdentifier)
	// Removes the intent to listen for the specified channels.
	Unregister(ids ...ChannelIdentifier)
}

ChannelRegistrar is an interface to register and unregister ChannelIdentifiers for the proxy to listen on.

type LegacyChannelIdentifier

type LegacyChannelIdentifier string // Has just a name field, no namespace and value.

LegacyChannelIdentifier is a legacy channel identifier (for Minecraft 1.12 and below). For modern 1.13 plugin messages, please see MinecraftChannelIdentifier.

func (LegacyChannelIdentifier) Id

type MinecraftChannelIdentifier

type MinecraftChannelIdentifier struct {
	key.Key
}

MinecraftChannelIdentifier is a Minecraft 1.13+ channel identifier.

func (*MinecraftChannelIdentifier) Id

Jump to

Keyboard shortcuts

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