event

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 4 Imported by: 0

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