forwarder

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(name string, err error) error

Error creates a new forwarder error

Types

type AWSConfig

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

type AWSOption

type AWSOption func(*AWSConfig)

func AWSWithEndpoint

func AWSWithEndpoint(value string) AWSOption

func AWSWithKeyID

func AWSWithKeyID(value string) AWSOption

func AWSWithProfile

func AWSWithProfile(value string) AWSOption

func AWSWithRegion

func AWSWithRegion(value string) AWSOption

func AWSWithResourceARN

func AWSWithResourceARN(value string) AWSOption

func AWSWithResourceEndpoint

func AWSWithResourceEndpoint(value string) AWSOption

func AWSWithResourceName

func AWSWithResourceName(value string) AWSOption

func AWSWithSecret

func AWSWithSecret(value string) AWSOption

type ErrForwarder

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

ErrForwarder is the error type to be returned by forwarders

func (*ErrForwarder) Error

func (e *ErrForwarder) Error() string

Error returns the stringified error

func (*ErrForwarder) Unwrap

func (e *ErrForwarder) Unwrap() error

type Forwarder

type Forwarder interface {
	Publish(context.Context, []byte) error
}

Forwarder defines a forwarder

func NewDummy

func NewDummy() Forwarder

NewDummy for testing

func NewHTTP

func NewHTTP(endpoint string, opts ...HTTPOption) Forwarder

NewHTTP creates a new HTTP forwarder

func NewKinesis

func NewKinesis(ctx context.Context, streamName string, opts ...AWSOption) (Forwarder, error)

NewKinesis creates a new Kinesis Datastream forwarder

func NewSNS

func NewSNS(ctx context.Context, topicARN string, opts ...AWSOption) (Forwarder, error)

NewSNS creates a new SNS forwarder

func NewSQS

func NewSQS(ctx context.Context, name string, opts ...AWSOption) (Forwarder, error)

NewSQS creates a new forwarder implementing AWS SQS Queues

type HTTPConfig

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

HTTPConfig holds the options to configure the http forwarder

type HTTPOption

type HTTPOption func(*HTTPConfig)

HTTPOption config option

func HTTPWithExpectedStatus

func HTTPWithExpectedStatus(value int) HTTPOption

HTTPWithExpectedStatus defines the expected response http status as valid

func HTTPWithHeaderAuth

func HTTPWithHeaderAuth(value string) HTTPOption

HTTPWithHeaderAuth Adds a header auth for HTTP requests

func HTTPWithMethod

func HTTPWithMethod(value string) HTTPOption

HTTPWithMethod defines the method to be userd GET, POST ...

func HTTPWithTimeOut

func HTTPWithTimeOut(value time.Duration) HTTPOption

HTTPWithTimeOut defines the timeout for HTTP connections

Jump to

Keyboard shortcuts

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