Options
All
  • Public
  • Public/Protected
  • All
Menu

Kalix metadata.

Metadata is treated as case insensitive on lookup, and case sensitive on set. Multiple values per key are supported, setting a value will add it to the current values for that key. You should delete first if you wish to replace a value.

Values can either be strings or byte buffers. If a non string or byte buffer value is set, it will be converted to a string using toString.

param entries

the list of entries

Hierarchy

  • Metadata

Index

Properties

entries: MetadataEntry[]
asMap: MetadataMap = ...

The metadata expressed as an object/map.

remarks

The map is backed by the this Metadata object - changes to this map will be reflected in this metadata object and changes to this object will be reflected in the map.

The map will return the first metadata entry that matches the key, case insensitive, when properties are looked up. When setting properties, it will replace all entries that match the key, case insensitive.

cloudevent: Cloudevent = ...

The Cloudevent data from this Metadata.

remarks

This object is backed by this Metadata, changes to the Cloudevent will be reflected in the Metadata.

jwtClaims: JwtClaims = ...

The JWT claims, if there was a validated bearer token with this request.

Constructors

Methods

  • setHttpStatusCode(code: number): void
  • Set the HTTP status code for the response when sending a successful response using HTTP transcoding.

    remarks

    This will only apply to responses that are being transcoded to plain HTTP from gRPC using the protobuf HTTP annotations. When gRPC is being used, calling this has no effect.

    Parameters

    • code: number

      The HTTP status code to set

    Returns void

  • Get all the values for the given key.

    remarks

    The key is case insensitive.

    Parameters

    • key: string

      the key to get

    Returns MetadataValue[]

    all the values, or an empty array if no values exist for the key

  • Set a given key value.

    remarks

    This will append the key value to the metadata, it won't replace any existing values for existing keys.

    Parameters

    • key: string

      the key to set

    • value: any

      the value to set

    Returns Metadata

    this updated metadata

  • Delete all values with the given key.

    remarks

    The key is case insensitive.

    Parameters

    • key: string

      the key to delete

    Returns Metadata

    this updated metadata

  • has(key: string): boolean
  • Whether there exists a metadata value for the given key.

    remarks

    The key is case insensitive.

    Parameters

    • key: string

      the key to check

    Returns boolean

    whether values exist for the given key

Generated using TypeDoc