http

package
v0.0.145 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const SinkType = "http"

Variables

This section is empty.

Functions

This section is empty.

Types

type CompressionStrategy

type CompressionStrategy string
var (
	CompressionStrategyNone CompressionStrategy = "none"
	CompressionStrategyGzip CompressionStrategy = "gzip"
)

type Config

type Config struct {
	Address            string              `yaml:"address"`
	Headers            map[string]string   `yaml:"headers"`
	MaxQueueSize       int                 `yaml:"maxQueueSize" default:"51200"`
	BatchTimeout       time.Duration       `yaml:"batchTimeout" default:"5s"`
	ExportTimeout      time.Duration       `yaml:"exportTimeout" default:"30s"`
	MaxExportBatchSize int                 `yaml:"maxExportBatchSize" default:"512"`
	Compression        CompressionStrategy `yaml:"compression" default:"none"`
	KeepAlive          *bool               `yaml:"keepAlive" default:"true"`
	Workers            int                 `yaml:"workers" default:"1"`
}

func (*Config) Validate

func (c *Config) Validate() error

type HTTP

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

func New

func New(name string, config *Config, log logrus.FieldLogger, filterConfig *xatu.EventFilterConfig, shippingMethod processor.ShippingMethod) (*HTTP, error)

func (*HTTP) HandleNewDecoratedEvent

func (h *HTTP) HandleNewDecoratedEvent(ctx context.Context, event *xatu.DecoratedEvent) error

func (*HTTP) HandleNewDecoratedEvents

func (h *HTTP) HandleNewDecoratedEvents(ctx context.Context, events []*xatu.DecoratedEvent) error

func (*HTTP) Name

func (h *HTTP) Name() string

func (*HTTP) Start

func (h *HTTP) Start(ctx context.Context) error

func (*HTTP) Stop

func (h *HTTP) Stop(ctx context.Context) error

func (*HTTP) Type

func (h *HTTP) Type() string

type ItemExporter

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

func NewItemExporter

func NewItemExporter(name string, config *Config, log logrus.FieldLogger) (ItemExporter, error)

func (ItemExporter) ExportItems

func (e ItemExporter) ExportItems(ctx context.Context, items []*xatu.DecoratedEvent) error

func (ItemExporter) Shutdown

func (e ItemExporter) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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