outputs

package
v0.0.0-...-b3aaee5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultContentType          = "application/json; charset=utf-8"
	ContentTypeHeaderKey        = "Content-Type"
	AuthorizationHeaderKey      = "Authorization"
	UserAgentHeaderKey          = "User-Agent"
	UserAgentHeaderValue        = "Narrows"
	MutualTLSFilesPath          = "/tmp/NarrowsTlsFiles"
	MutualTLSClientCertFilename = "/client.crt"
	MutualTLSClientKeyFilename  = "/client.key"
	MutualTLSCaCertFilename     = "/ca.crt"
)

Variables

View Source
var ErrClientCreation = errors.New("client creation error")

ErrClientCreation is returned if client can't be created

Functions

This section is empty.

Types

type Client

type Client struct {
	EndpointURL      *url.URL
	MutualTLSEnabled bool
	CheckCert        bool
	HeaderList       []Header
	ContentType      string
	Config           *v1alpha1.ExportConfig
}

Client communicates with the different API.

func NewClient

func NewClient(defaultEndpointURL string, mutualTLSEnabled bool, checkCert bool, config *v1alpha1.ExportConfig) (*Client, error)

NewClient returns a new output.Client

func (*Client) AddHeader

func (c *Client) AddHeader(key, value string)

AddHeader adds an HTTP Header to the Client.

func (*Client) BasicAuth

func (c *Client) BasicAuth(username, password string)

BasicAuth adds an HTTP Basic Authentication compliant header to the Client.

func (*Client) OpenSearchPost

func (c *Client) OpenSearchPost(payloadStr string)

OpenSearchPost posts event to OpenSearch

func (*Client) Post

func (c *Client) Post(payload string) error

Post sends payload by the client object

type Governor

type Governor struct {
	Payload string
	Config  v1alpha1.ExportConfig
}

func IntializeGovernor

func IntializeGovernor(payload string, config v1alpha1.ExportConfig) Governor

func (*Governor) Post

func (g *Governor) Post()

Post posts event to GovernorAPI

type Header struct {
	Key   string
	Value string
}

Header to add to the client before sending the request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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