odogoron

package module
v0.0.0-...-819b0cd Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: MIT Imports: 4 Imported by: 0

README

Odogoron

goreportcard badge

Odogoron framework for simple creation of event-driven applications.

⚡️Event way in EDA infrastructure with 🐲

Event way

Documentation

Index

Constants

View Source
const DefaultConcurrency = 256 * 1024

Variables

View Source
var DefaultErrorHandler = func(err error, event EventCtx) {
	log.Println(err)
}

Functions

This section is empty.

Types

type App

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

func New

func New(source EventSource, config ...Config) *App

func (*App) RegisterHandler

func (app *App) RegisterHandler(eventName string, function HandlerFunction)

func (*App) Run

func (app *App) Run()

func (*App) Shutdown

func (app *App) Shutdown()

type Config

type Config struct {
	AppName      string
	ErrorHandler ErrorHandler
	Concurrency  int
}

type ErrorHandler

type ErrorHandler func(error, EventCtx)

type EventCtx

type EventCtx interface {
	GetName() string
	GetBody() any
}

type EventSource

type EventSource interface {
	GetChannel() chan EventCtx
	GetMapper() func(context.Context, interface{}) (interface{}, error)
	Shutdown()
}

type HandlerFunction

type HandlerFunction func(ctx EventCtx)

Jump to

Keyboard shortcuts

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