wh

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package wh is the webhook manager writer. The goal of this package is to manage an input (webhook of any kind), send it to a parser, and write to an output.

Index

Constants

This section is empty.

Variables

View Source
var ErrSourceNotSupported = errors.New("source not supported")

ErrSourceNotSupported is returned when the source is not supported.

Functions

This section is empty.

Types

type Connector

type Connector interface {
	Write(ctx context.Context, payload []byte, headers map[string][]string) error
}

Connector holds all connector methods.

type MessageContainer

type MessageContainer struct {
	Source  string              `json:"source"`
	Payload []byte              `json:"payload"`
	Headers map[string][]string `json:"headers"`
}

MessageContainer is a container for the message that will be sent to the publisher.

type PublisherConnector

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

PublisherConnector is a connector for the publisher.

func NewPublisherConnector

func NewPublisherConnector(ctx context.Context, p publisher.Publisher, topicPrefix string) *PublisherConnector

NewPublisherConnector creates a new instance of PublisherConnector.

func (*PublisherConnector) Write

func (w *PublisherConnector) Write(ctx context.Context, payload []byte, headers map[string][]string) error

Write sends the payload to the publisher.

Jump to

Keyboard shortcuts

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