eventbus

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 9 Imported by: 0

README

eventbus GoDoc

Package eventbus provides event bus interfaces

Download:

go get -u github.com/vardius/go-api-boilerplate/pkg/eventbus

Package eventbus provides event bus interfaces

Documentation

Overview

Package eventbus provides interfaces along with helper functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGRPCHandlers

func RegisterGRPCHandlers(serviceName string, conn *grpc.ClientConn, eventBus EventBus, topicToHandlerMap map[string]EventHandler, timeout time.Duration)

RegisterGRPCHandlers registers event handlers for topics will panic after timeout if unable to register handlers

Types

type EventBus

type EventBus interface {
	Publish(ctx context.Context, event domain.Event)
	Subscribe(ctx context.Context, eventType string, fn EventHandler) error
	Unsubscribe(ctx context.Context, eventType string, fn EventHandler) error
}

EventBus intrface

type EventHandler

type EventHandler func(ctx context.Context, event domain.Event)

EventHandler function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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