uploader

package
v2.0.0-...-af00d2a Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Non200Response = "non 200 response"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Log                  logr.Logger
	DestURL              string
	DestHeader           map[string]string
	DestURLSuffixExpr    string
	AuthURL              string
	AuthHeader           map[string]string
	AuthDestHeader       string
	AuthDestHeaderPrefix string
	AuthTokenExpr        string
	AuthBodyData         []byte
}

Uploader config for construction

type Uploader

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

func NewUploader

func NewUploader(client *http.Client, config *Config, transformer *transformer.Transformer) (u *Uploader, err error)

Optional: Defines an endpoint to call to request an authorization token used when making the destURL request authURL: authorizataion endpoint authHeader: headers sent when sending the authorization request authDestHeader: the additional header map key to set on the destHeader ("Authorization") authDestPrefix: the additional prefix map string value to set on the destHeader ("Bearer ") parseResponse: optionally jsonpath parse the response for the authorization token

func (*Uploader) TransformAndUpload

func (u *Uploader) TransformAndUpload(eventMsg []byte) (int, error)

Jump to

Keyboard shortcuts

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