goo_event

package
v1.1.115 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Publish

func Publish(topic string, data interface{})

func Subscribe

func Subscribe(topic string, fn SubscribeFunc)

Types

type Event

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

func Default

func Default() *Event

func New

func New() *Event

func (*Event) Publish

func (ev *Event) Publish(topic string, data interface{})

发布

func (*Event) Subscribe

func (ev *Event) Subscribe(topic string, fn SubscribeFunc)

订阅

type Message

type Message struct {
	Topic string
	Data  interface{}
}

type MessageChan

type MessageChan chan Message

type SubscribeFunc

type SubscribeFunc func(msg Message)

Jump to

Keyboard shortcuts

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