Class: Metadata

akkaserverless. Metadata

Akka Serverless 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.


new Metadata(entries)

Parameters:
Name Type Description
entries Array.<module:akkaserverless.MetadataEntry>

The list of entries

Methods


clear()

Clear the metadata.

Returns:

This updated metadata.

Type
module:akkaserverless.Metadata

delete(key)

Delete all values with the given key.

The key is case insensitive.

Parameters:
Name Type Description
key string

The key to delete.

Returns:

This updated metadata.

Type
module:akkaserverless.Metadata

get(key)

Get all the values for the given key.

The key is case insensitive.

Parameters:
Name Type Description
key string

The key to get.

Returns:

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

Type
Array.<module:akkaserverless.MetadataValue>

getSubject()

Returns:

CloudEvent subject value.

Type
module:akkaserverless.MetadataValue | undefined

has(key)

Whether there exists a metadata value for the given key.

The key is case insensitive.

Parameters:
Name Type Description
key string

The key to check.

Returns:

Whether values exist for the given key.

Type
boolean

set(key, value)

Set a given key value.

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

Parameters:
Name Type Description
key string

The key to set.

value any

The value to set.

Returns:

This updated metadata.

Type
module:akkaserverless.Metadata