message

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 5 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 {
	// ID returns the channel identifier.
	ID() string
}

ChannelIdentifier is a channel identifier for use with plugin messaging.

func ChannelIdentifierFrom added in v0.19.0

func ChannelIdentifierFrom(identifier string) (ChannelIdentifier, error)

ChannelIdentifierFrom creates a channel identifier from the specified Minecraft identifier string.

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 {
	// SendPluginMessage sends a plugin message to the channel with id.
	SendPluginMessage(id ChannelIdentifier, data []byte) error
}

ChannelMessageSink can receive plugin messages.

type ChannelMessageSource

type ChannelMessageSource any

ChannelMessageSource is a source of plugin messages.

type ChannelRegistrar

type ChannelRegistrar interface {
	// Register registers the specified message identifiers to listen on so you can
	// intercept plugin messages on the channel using the PluginMessageEvent.
	Register(ids ...ChannelIdentifier)
	// Unregister 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