traceability

package
v1.1.81 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 39 Imported by: 12

Documentation

Index

Constants

View Source
const (
	// TransactionFlow - the transaction flow used for events
	TransactionFlow = "api-central-v8"
	// FlowHeader - the header key for the flow value
	FlowHeader = "axway-target-flow"
)
View Source
const (
	HealthCheckEndpoint = traceabilityStr
)

Variables

View Source
var (
	ErrHTTPNotConnected = errors.New(1503, "http transport is not connected")
	ErrJSONEncodeFailed = errors.New(1504, "failed to encode the json content")
	ErrInvalidConfig    = errors.Newf(1505, "invalid traceability config. Config error: %s")
	ErrInvalidRegex     = errors.Newf(1506, "could not compile the %s regex value (%v): %v")
)

Config errors

View Source
var GetClient = getClient

GetClient - returns a random client from the clients array

Functions

func GetCacheDirPath

func GetCacheDirPath() string

GetCacheDirPath - Returns the path of the cache directory

func GetDataDirPath

func GetDataDirPath() string

GetDataDirPath - Returns the path of the data directory

func GetMaxRetries

func GetMaxRetries() int

GetMaxRetries - Returns the max retries configured for transport

func GetReportsDirPath

func GetReportsDirPath() string

GetReportsDirPath - Returns the path of the reports directory

func IsHTTPTransport

func IsHTTPTransport() bool

IsHTTPTransport - Returns true if the protocol is set to http/https

func SetDataDirPath

func SetDataDirPath(path string)

SetDataDirPath - Sets the path of the data directory

func SetOutputEventProcessor

func SetOutputEventProcessor(eventProcessor OutputEventProcessor)

SetOutputEventProcessor -

func ShouldIgnoreEvent

func ShouldIgnoreEvent(uriRaw string) bool

ShouldIgnoreEvent - check to see if the uri exists in exception list

Types

type Backoff

type Backoff struct {
	Init time.Duration
	Max  time.Duration
}

Backoff -

type Client

type Client struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Client - struct

func (*Client) Close

func (client *Client) Close() error

Close publish a single event to output.

func (*Client) Connect

func (client *Client) Connect() error

Connect establishes a connection to the clients sink.

func (*Client) Publish

func (client *Client) Publish(ctx context.Context, batch publisher.Batch) error

Publish sends events to the clients sink.

func (*Client) SetLogger

func (client *Client) SetLogger(logger log.FieldLogger)

SetLogger - set the logger

func (*Client) SetTransportClient

func (client *Client) SetTransportClient(outputClient outputs.Client)

SetTransportClient - set the transport client

func (*Client) String

func (client *Client) String() string

type Config

type Config struct {
	Index             string            `config:"index"`
	LoadBalance       bool              `config:"loadbalance"`
	BulkMaxSize       int               `config:"bulk_max_size"`
	SlowStart         bool              `config:"slow_start"`
	Timeout           time.Duration     `config:"client_timeout"    validate:"min=0"`
	TTL               time.Duration     `config:"ttl"               validate:"min=0"`
	Pipelining        int               `config:"pipelining"        validate:"min=0"`
	CompressionLevel  int               `config:"compression_level" validate:"min=0, max=9"`
	MaxRetries        int               `config:"max_retries"       validate:"min=-1"`
	TLS               *tlscommon.Config `config:"ssl"`
	Proxy             ProxyConfig       `config:",inline"`
	Backoff           Backoff           `config:"backoff"`
	EscapeHTML        bool              `config:"escape_html"`
	Protocol          string            `config:"protocol"`
	Hosts             []string          `config:"hosts"`
	Redaction         redaction.Config  `config:"redaction" yaml:"redaction"`
	Sampling          sampling.Sampling `config:"sampling" yaml:"sampling"`
	APIExceptionsList []string          `config:"apiExceptionsList"`
}

Config -

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig -

type Connection

type Connection struct {
	sync.Mutex
	URL string
	// contains filtered or unexported fields
}

Connection struct

type HTTPClient

type HTTPClient struct {
	Connection
	// contains filtered or unexported fields
}

HTTPClient struct

func NewHTTPClient

func NewHTTPClient(s HTTPClientSettings) (*HTTPClient, error)

NewHTTPClient instantiate a client.

func (*HTTPClient) Clone

func (client *HTTPClient) Clone() *HTTPClient

Clone clones a client.

func (*HTTPClient) Close

func (client *HTTPClient) Close() error

Close publish a single event to output.

func (*HTTPClient) Connect

func (client *HTTPClient) Connect() error

Connect establishes a connection to the clients sink.

func (*HTTPClient) Publish

func (client *HTTPClient) Publish(_ context.Context, batch publisher.Batch) error

Publish sends events to the clients sink.

func (*HTTPClient) String

func (client *HTTPClient) String() string

type HTTPClientSettings

type HTTPClientSettings struct {
	BeatInfo         beat.Info
	URL              string
	Proxy            *url.URL
	TLS              *transport.TLSConfig
	Index            outil.Selector
	Pipeline         *outil.Selector
	Timeout          time.Duration
	CompressionLevel int
	Observer         outputs.Observer
	Headers          map[string]string
}

HTTPClientSettings struct

type OutputEventProcessor

type OutputEventProcessor interface {
	Process(events []publisher.Event) []publisher.Event
}

OutputEventProcessor - P

type ProxyConfig

type ProxyConfig struct {
	// URL of the SOCKS proxy. Scheme must be socks5. Username and password can be
	// embedded in the URL.
	URL string `config:"proxy_url"`

	// Resolve names locally instead of on the SOCKS server.
	LocalResolve bool `config:"proxy_use_local_resolver"`
}

ProxyConfig holds the configuration information required to proxy connections through a SOCKS5 proxy server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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