@numaproj/numaflow-js - v0.0.0-alpha.4
    Preparing search index...

    Interface UserMetadata

    User-defined metadata that can be attached to messages. Allows storing arbitrary key-value pairs organized by groups.

    const metadata = new map.UserMetadata();
    metadata.createGroup('tracking');
    metadata.addKv('tracking', 'source', Buffer.from('api'));
    metadata.addKv('tracking', 'version', Buffer.from('1.0'));
    interface UserMetadata {
        addKv(group: string, key: string, value: Buffer): void;
        createGroup(group: string): void;
        getGroups(): string[];
        getKeys(group: string): string[];
        getValue(group: string, key: string): Buffer;
        removeGroup(group: string): void;
        removeKey(group: string, key: string): void;
    }
    Index

    Methods

    • Add a key-value pair to a group.

      Parameters

      • group: string

        The group name

      • key: string

        The key name

      • value: Buffer

        The value as a Buffer

      Returns void

    • Create a new group in the metadata.

      Parameters

      • group: string

        The group name to create

      Returns void

    • Get all group names in the metadata.

      Returns string[]

      Array of group names

    • Get all keys within a specific group.

      Parameters

      • group: string

        The group name

      Returns string[]

      Array of key names in the group

    • Get the value for a specific key within a group.

      Parameters

      • group: string

        The group name

      • key: string

        The key name

      Returns Buffer

      The value as a Buffer

    • Remove an entire group from the metadata.

      Parameters

      • group: string

        The group name to remove

      Returns void

    • Remove a key from a group.

      Parameters

      • group: string

        The group name

      • key: string

        The key to remove

      Returns void