package
0.10.6
Repository: https://github.com/goto/meteor.git
Documentation: pkg.go.dev

# README

Http

Compass is a search and discovery engine built for querying application deployments, datasets and meta resources. It can also optionally track data flow relationships between these resources and allow the user to view a representation of the data flow graph.

Usage

sinks:
  name: http
  config:
    method: POST
    success_code: 200
    url: https://compass.requestcatcher.com/v1beta2/asset/{{ .Type }}/{{ .Urn }}
    headers:
      Header-1: value11,value12
    script:
      engine: tengo
      source: |
        payload := {
          details: {
            some_key: asset.urn,
            another_key: asset.name
          }
        }
        sink(payload)

Config Defination

KeyValueExampleDescription
urlstringhttps://compass.requestcatcher.com/v1beta2/asset/{{ .Type }}/{{ .Urn }}URL to the http server, contains all the info needed to make the request, like port and route, support go text/template (see the properties in v1beta2.Asset)required
methodstringPOSTthe method string of by which the request is to be made, e.g. POST/PATCH/GETrequired
success_codeinteger200to identify the expected success code the http server returns, defult is 200optional
headersmap"Content-Type": "application/json"to add any header/headers that may be required for making the requestoptional
scriptObjectsee ScriptScript for building custom payload*optional

Script

KeyValueExampleDescription
enginestringtengoScript engine. Only "tengo" is supported currentlyrequired
sourcestringsee Usage.[Tengo][tengo] script used to map the request into custom payload to be sent to url.required

Script Globals

asset

The asset record emitted by the extractor and processors is made available in the script environment as asset. The field names will be as per the Asset proto definition.

sink(Payload)

Send http request to url with payload.

exit()

Terminates the script execution.

Contributing

Refer to the contribution guidelines for information on contributing to this module.

# Functions

No description provided by the author

# Structs

No description provided by the author
No description provided by the author