dispatcher

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher interface {
	Dispatch(event *ExternalEvent) error
}

Dispatcher is the event dispatcher interface

func NewDispatcher

func NewDispatcher(uri string) (Dispatcher, error)

NewDispatcher create new event dispatcher

type ExternalEvent

type ExternalEvent struct {
	Action  string      `json:"action"`
	Issue   Issue       `json:"issue"`
	Payload interface{} `json:"payload"`
}

ExternalEvent structure definition

func NewExternalEvent

func NewExternalEvent(action string, payload interface{}) *ExternalEvent

NewExternalEvent create an external event

func (*ExternalEvent) Marshal

func (ev *ExternalEvent) Marshal() *bytes.Buffer

Marshal event to JSON data

type HTTPDispatcher

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

HTTPDispatcher structure

func (*HTTPDispatcher) Dispatch

func (hb *HTTPDispatcher) Dispatch(event *ExternalEvent) error

Send the payload to the event broker

type Issue

type Issue struct {
	URL  *string   `json:"url,omitempty"`
	Date time.Time `json:"date"`
}

Issue event issue

Jump to

Keyboard shortcuts

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