metadata

package
v1.18.17 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package metadata defines Metadata of the DataFrame.

Index

Constants

View Source
const (
	// the keys for yomo working.
	SourceIDKey = "yomo-source-id"
	TIDKey      = "yomo-tid"

	// the keys for tracing.
	TraceIDKey = "yomo-trace-id"
	SpanIDKey  = "yomo-span-id"

	// the keys for target system working.
	TargetKey       = "yomo-target"
	WantedTargetKey = "yomo-wanted-target"
)

yomo reserved metadata keys.

Variables

This section is empty.

Functions

This section is empty.

Types

type M added in v1.13.1

type M map[string]string

M stores additional information about the application.

There are two types of metadata in yomo:
 1. Metadata from `Authentication.Authenticate()`, This is connection-level metadata.
 2. Metadata from the DataFrame, This is frame-level metadata.

the main responsibility of Metadata is to route messages to connection handler.

func Decode added in v1.13.1

func Decode(data []byte) (M, error)

Decode decodes a byte array to M.

func New added in v1.13.1

func New(mds ...map[string]string) M

New creates an M from a given key-values map.

func (M) Clone added in v1.13.1

func (m M) Clone() M

Clone clones the metadata.

func (M) Encode added in v1.13.1

func (m M) Encode() ([]byte, error)

Encode encodes the metadata to byte array.

func (M) Get added in v1.13.1

func (m M) Get(k string) (string, bool)

Get returns the value of the given key.

func (M) Range added in v1.13.1

func (m M) Range(f func(k, v string) bool)

Range iterates over all keys and values.

func (M) Set added in v1.13.1

func (m M) Set(k, v string)

Set sets the value of the given key. if the key is empty, it will do nothing.

Jump to

Keyboard shortcuts

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