consume

package
v0.0.0-...-ca61c3d Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnnotateModule = fx.Options(

	fx.Provide(

		fx.Annotate(
			NewEmitter,

			fx.ParamTags(`group:"watchers"`),
		),
	),
)

AnnotateModule is the module defined in this file.

View Source
var EmitterFromModule = fx.Options(
	fx.Provide(

		fx.Annotate(
			EmitterFrom,
			fx.ParamTags(`group:"watchers"`),
		),
	),
)

EmitterFromModule is a module that holds EmitterFrom.

View Source
var ParamsModule = fx.Options(

	fx.Provide(New),
)

ParamsModule is the module defined in this file.

View Source
var PlainModule = fx.Options(

	fx.Provide(
		NewEmitter,
	),
)

PlainModule is an unannotated NewEmitter.

Functions

This section is empty.

Types

type Emitter

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

Emitter emits events

func EmitterFrom

func EmitterFrom(watchers ...Watcher) (*Emitter, error)

EmitterFrom builds an Emitter from the list of watchers. --8<-- [start:new-variadic]

func NewEmitter

func NewEmitter(watchers []Watcher) (*Emitter, error)

NewEmitter builds an emitter. --8<-- [start:new-init] --8<-- [start:new-consume]

type Params

type Params struct {
	fx.In

	// ...
	// --8<-- [end:param-init-1]
	Watchers []Watcher `group:"watchers"`
}

Params is a parameter object. --8<-- [start:param-tagged] --8<-- [start:param-init-1]

type Result

type Result struct {
	fx.Out

	Emitter *Emitter
}

Result is a list of watchers.

func New

func New(p Params) (Result, error)

New consumes a value group. --8<-- [start:new-init] --8<-- [start:new-consume]

type Watcher

type Watcher interface{}

Watcher watches for events.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳