gateway

package
v0.0.0-...-2ba887c Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventMapper

type EventMapper struct {
}

EventMapper -

type EventProcessor

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

EventProcessor - represents the processor for received event to generate event(s) for AMPLIFY Central The event processing can be done either when the beat input receives the log entry or before the beat transport publishes the event to transport. When processing the received log entry on input, the log entry is mapped to structure expected for AMPLIFY Central Observer and then beat.Event is published to beat output that produces the event over the configured transport. When processing the log entry on output, the log entry is published to output as beat.Event. The output transport invokes the Process(events []publisher.Event) method which is set as output event processor. The Process() method processes the received log entry and performs the mapping to structure expected for AMPLIFY Central Observer. The method returns the converted Events to transport publisher which then produces the events over the transport.

func NewEventProcessor

func NewEventProcessor(gateway *config.GatewayConfig) *EventProcessor

NewEventProcessor - return a new EventProcessor

func (*EventProcessor) Process

func (p *EventProcessor) Process(events []publisher.Event) []publisher.Event

Process - callback set as output event processor that gets invoked by transport publisher to process the received events

func (*EventProcessor) ProcessRaw

func (p *EventProcessor) ProcessRaw(rawEventData []byte) []beat.Event

ProcessRaw - process the received log entry and returns the event to be published to AMPLIFY ingestion service

type GwTrafficLogEntry

type GwTrafficLogEntry struct {
	TraceID             string        `json:"traceId"`
	APIName             string        `json:"apiName"`
	ResponseTime        int           `json:"respTime"`
	StartTime           int64         `json:"startTime,string"`
	InboundTransaction  GwTransaction `json:"inbound"`
	OutboundTransaction GwTransaction `json:"outbound"`
}

GwTrafficLogEntry - Represents the structure of log entry the agent will receive

type GwTransaction

type GwTransaction struct {
	ID              string  `json:"id"`
	SourceHost      string  `json:"srcHost"`
	SourcePort      int     `json:"srcPort,string"`
	DesHost         string  `json:"destHost"`
	DestPort        int     `json:"destPort,string"`
	URI             string  `json:"uri"`
	Method          string  `json:"method"`
	StatusCode      int     `json:"statusCode,string"`
	RequestHeaders  Headers `json:"requestHeaders"`
	ResponseHeaders Headers `json:"responseHeaders"`
	RequestBytes    int     `json:"requestByte"`
	ResponseBytes   int     `json:"responseByte"`
	BackendLatency  int     `json:"backendLatency"`
}

GwTransaction - Type for gateway transaction detail

type Headers

type Headers map[string]string

Headers - Type for request/response headers

type LogReader

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

LogReader - Represents the Gateway client

func NewLogReader

func NewLogReader(gatewayCfg *config.GatewayConfig, eventChannel chan string) (*LogReader, error)

NewLogReader - Creates a new Gateway Client

func (*LogReader) Start

func (r *LogReader) Start()

Start - Starts reading log file

type RestReader

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

RestReader - Represents the Gateway client

func NewRestReader

func NewRestReader(gatewayCfg *config.GatewayConfig, eventChannel chan string) (*RestReader, error)

NewRestReader - Creates a new Gateway Client

func (*RestReader) Start

func (r *RestReader) Start()

Start - Starts reading log file

Jump to

Keyboard shortcuts

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