event

package
v1.0.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 44

Documentation

Overview

Package event provides a basic API for app modules to emit events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute added in v0.6.0

type Attribute = appdata.EventAttribute

Attribute is a kv-pair event attribute.

func NewAttribute

func NewAttribute(key, value string) Attribute

type Event

type Event = appdata.Event

Event defines how an event will emitted

func NewEvent

func NewEvent(ty string, attrs ...Attribute) Event

type Events

type Events = appdata.EventData

Events represents a list of events.

func NewEvents

func NewEvents(events ...Event) Events

type Manager added in v0.6.0

type Manager interface {
	// Emit emits events represented as a protobuf message (as described in ADR 032).
	//
	// Callers SHOULD assume that these events will not be included in consensus.
	Emit(event transaction.Msg) error

	// EmitKV emits an event based on an event and kv-pair attributes.
	//
	// These events will not be part of consensus and adding, removing or changing these events is
	// not a state-machine breaking change.
	EmitKV(eventType string, attrs ...Attribute) error
}

Manager represents an event manager which can emit events.

type Service

type Service interface {
	EventManager(context.Context) Manager
}

Service represents an event service which can retrieve and set an event manager in a context. event.Service is a core API type that should be provided by the runtime module being used to build an app via depinject.

Jump to

Keyboard shortcuts

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