event

package
v0.0.0-...-1e02c65 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package event exposes a single exported `Context` type that may be used to influence the execution flow of events that occur on a server. Generally, the caller of `event.C()` calls `Context.Cancelled()` to check if the `Context` was cancelled (using `Context.Cancel()`) by whatever code it was passed to. who is then able to cancel it by calling `Context.Cancel()`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

Context represents the context of an event. Handlers of an event may call methods on the context to change the result of the event.

func C

func C() *Context

C returns a new event context.

func (*Context) Cancel

func (ctx *Context) Cancel()

Cancel cancels the context.

func (*Context) Cancelled

func (ctx *Context) Cancelled() bool

Cancelled returns whether the context has been cancelled.

type MessageContext

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

func MC

func MC(m string, f string) *MessageContext

func (*MessageContext) Cancel

func (ctx *MessageContext) Cancel()

func (*MessageContext) Cancelled

func (ctx *MessageContext) Cancelled() bool

func (*MessageContext) Format

func (ctx *MessageContext) Format() string

func (*MessageContext) Message

func (ctx *MessageContext) Message() string

func (*MessageContext) SetFormat

func (ctx *MessageContext) SetFormat(f string)

func (*MessageContext) SetMessage

func (ctx *MessageContext) SetMessage(m string)

Jump to

Keyboard shortcuts

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