event

package
v0.0.0-...-ca35f81 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emitter

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

Emitter event emitter

func (*Emitter) Publish

func (e *Emitter) Publish(event Event, value interface{})

Publish 이벤트 발행

func (*Emitter) Subscribe

func (e *Emitter) Subscribe(subscription Subscription, option Option) func()

Subscribe is subscribe event

type Event

type Event int

Event is operation event

const (
	// EventCreate is create entity
	EventCreate Event = iota + 1
	// EventUpdate is update entity
	EventUpdate
	// EventDelete is delete entity
	EventDelete
)

func (Event) String

func (i Event) String() string

type Option

type Option func(event Event) bool

Option is subscribe option

func WithEvent

func WithEvent(evt Event) Option

WithEvent is subscribe specific event

type Subscription

type Subscription func(event Event, value interface{})

Subscription is subscribe handler

Jump to

Keyboard shortcuts

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