event

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	ID        string `json:"id"`
	MachineID string `json:"machineId"`
	LocalID   string `json:"localId"`
}

func NewAddressFromID

func NewAddressFromID(id string) (*Address, error)

func (*Address) Equal

func (a *Address) Equal(compare *Address) bool

func (*Address) GetMachineID

func (a *Address) GetMachineID() string

func (*Address) MarshalJSON

func (a *Address) MarshalJSON() ([]byte, error)

func (*Address) ToString

func (a *Address) ToString() string

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(data []byte) error

type EventEmitter

type EventEmitter interface {
	Emit(ctx context.Context, address *Address, pkg *Package) error
	EmitLocal(ctx context.Context, address *Address, pkg *Package) error
	Listen(address *Address, listener Listener)
	RemoveListener(address *Address, listener Listener)
	Close() error
}

type Listener

type Listener interface {
	Listen(ctx context.Context, pkg *Package)
	IsClose() bool
	Close(ctx context.Context, code string) error
}

type Package

type Package struct {
	From       *Address        `json:"from"`
	CreatedAt  int64           `json:"createdAt"`
	RequestId  string          `json:"requestId"`
	RoutingKey string          `json:"routingKey"`
	Content    json.RawMessage `json:"content"`
}

Jump to

Keyboard shortcuts

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