martian

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 0 Imported by: 0

README

martian-components

A collection of martian modifiers, filters and validators

Using it as a lib

Import the required packages into your project and start using them as any other martian component

import(
	_ "github.com/kpacha/martian-components/body/elastic-search"
	_ "github.com/kpacha/martian-components/body/json-schema"
)

Using the modules as KrakenD plugins

Compile the desired package with the plugin flag

$ go build -buildmode=plugin -o krakend-martian_json-schema.so ./krakend-plugin/json-schema
$ go build -buildmode=plugin -o krakend-martian_es.so ./krakend-plugin/elastic-search

And place the plugins into your plugin folder, so the KrakenD can load them in runtime.

List of components:

ElasticSearch query modifier

Sample DSL:

{
    "body.ESQuery": {
        "keys" : ["foo", "bar", "x"]
    }
}
JSON-Schema request and response verifiers

Sample DSL:

{
    "body.JSON-SCHEMA.Request": {
        "title": "Person",
        "type": "object",
        "properties": {
            "firstName": {
                "type": "string"
            },
            "lastName": {
                "type": "string"
            },
            "age": {
                "description": "Age in years",
                "type": "integer",
                "minimum": 0
            }
        },
        "required": ["firstName", "lastName"]
    }
}

Check the json-schema site for more about schema definitions

Documentation

Overview

Package martian provides a collection of configurable HTTP request and response modifiers, filters and verifiers.

Directories

Path Synopsis
Package body allows for the replacement of message body on requests and responses.
Package body allows for the replacement of message body on requests and responses.
elastic-search
Package elastic registers a request modifier for generating parametrized queries to an elastic search service
Package elastic registers a request modifier for generating parametrized queries to an elastic search service
elastic-search/modifier
Package modifier exposes a request modifier for generating parametrized queries to an elastic search service
Package modifier exposes a request modifier for generating parametrized queries to an elastic search service
json-schema
Package json_schema registers a couple of body request and response modifiers for validating the json messages using json-schema (http://json-schema.org/)
Package json_schema registers a couple of body request and response modifiers for validating the json messages using json-schema (http://json-schema.org/)
json-schema/verifier
Package verifier exposes a json-schema verifier for http request and response bodies
Package verifier exposes a json-schema verifier for http request and response bodies
querystring2body
Package querystring2body registers a request modifier for generating bodies from the querystring params
Package querystring2body registers a request modifier for generating bodies from the querystring params
querystring2body/modifier
Package modifier exposes a request modifier for generating bodies from the querystring params
Package modifier exposes a request modifier for generating bodies from the querystring params
request-body
Package requestbody registers a request modifier for modify request bodies
Package requestbody registers a request modifier for modify request bodies
header
host
Package host registers a request modifier for setting a custom Host header
Package host registers a request modifier for setting a custom Host header
host/modifier
Package modifier exposes a request modifier for setting a custom Host header
Package modifier exposes a request modifier for setting a custom Host header
krakend-plugin

Jump to

Keyboard shortcuts

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