go-api-boilerplate: github.com/vardius/go-api-boilerplate/pkg/eventbus Index | Files | Directories

package eventbus

import "github.com/vardius/go-api-boilerplate/pkg/eventbus"

Package eventbus provides interfaces along with helper functions


Package Files

doc.go event_bus.go register.go

func RegisterGRPCHandlers Uses

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

type EventBus Uses

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 Uses

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

EventHandler function



Package eventbus imports 9 packages (graph) and is imported by 7 packages. Updated 2020-08-04. Refresh now. Tools for package owners.