Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Concatenate

The Concatenate filter’s job is to add a byte packet to either the beginning or end of each UDP packet that passes through. This is commonly used to provide an auth token to each packet, so they can be routed appropriately.

Filter name

quilkin.filters.concatenate.v1alpha1.Concatenate

Configuration Examples

#![allow(unused)]
fn main() {
let yaml = "
version: v1alpha1
filters:
  - name: quilkin.filters.concatenate.v1alpha1.Concatenate
    config:
        on_read: APPEND
        on_write: DO_NOTHING
        bytes: MXg3aWp5Ng==
clusters:
  - endpoints:
      - address: 127.0.0.1:7001
";
let config = quilkin::config::Config::from_reader(yaml.as_bytes()).unwrap();
assert_eq!(config.filters.load().len(), 1);
}

Configuration Options (Rust Doc)

$schema: https://json-schema.org/draft/2020-12/schema
title: Config
description: Config represents a `Concatenate` filter configuration.
type: object
properties:
  bytes:
    type: array
    items:
      type: integer
      format: uint8
      maximum: 255
      minimum: 0
  on_read:
    description: Whether or not to `append` or `prepend` or `do nothing` on Filter `Read`
    $ref: '#/$defs/Strategy'
    default: DO_NOTHING
  on_write:
    description: Whether or not to `append` or `prepend` or `do nothing` on Filter `Write`
    $ref: '#/$defs/Strategy'
    default: DO_NOTHING
required:
- bytes
$defs:
  Strategy:
    type: string
    enum:
    - APPEND
    - PREPEND
    - DO_NOTHING