shared

package
v0.0.0-...-5bc2b8c Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractID

func ExtractID(v any, possibleIDFieldNames ...string) string

ExtractID extracts `possibleIDFieldNames` from `v` - an arbitrary struct.

NOTE: Only exported fields are considered.

func GenerateIDBasedOnContent

func GenerateIDBasedOnContent(ct string) string

GenerateIDBasedOnContent generates MD5 hash (content-based) for message ID. Good to be used to avoid duplicated messages.

func GenerateUUID

func GenerateUUID() string

GenerateUUID generates a RFC4122 UUID and DCE 1.1: Authentication and Security Services.

Types

type IMeta

type IMeta[C any] interface {
	// GetDescription returns the `Description` of the processor.
	GetDescription() string

	// GetName returns the `Name` of the processor.
	GetName() string

	// GetState returns the `State` of the processor.
	GetState() status.Status

	// SetState sets the `State` of the processor.
	SetState(state status.Status)
}

IMeta defines what a `Processor` must do.

type Run

type Run[In any, Out any] func(ctx context.Context, in []In) (out []Out, err error)

Run is a function that transforms the data (`in`). It returns the transformed data and any errors that occurred during processing.

Jump to

Keyboard shortcuts

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