metadata

package
v1.20.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: MIT Imports: 1 Imported by: 4

Documentation

Overview

Package metadata contains implementations of types.Metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LazyCopy

func LazyCopy(m types.Metadata) types.Metadata

LazyCopy takes an existing metadata object and returns a new implementation that lazily returns its values. If a call is made to edit the contents of the metadata then a copy is made of the original before doing so.

Types

type Type

type Type struct {
	// contains filtered or unexported fields
}

Type is an implementation of types.Metadata representing the metadata of a message part within a batch.

func New

func New(m map[string]string) *Type

New creates a new metadata implementation from a map[string]string. It is safe to provide a nil map.

func (*Type) Copy

func (m *Type) Copy() types.Metadata

Copy returns a copy of the metadata object that can be edited without changing the contents of the original.

func (*Type) Delete

func (m *Type) Delete(key string) types.Metadata

Delete removes the value of a metadata key.

func (*Type) Get

func (m *Type) Get(key string) string

Get returns a metadata value if a key exists, otherwise an empty string.

func (*Type) Iter

func (m *Type) Iter(f func(k, v string) error) error

Iter iterates each metadata key/value pair.

func (*Type) Set

func (m *Type) Set(key, value string) types.Metadata

Set sets the value of a metadata key.

Jump to

Keyboard shortcuts

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