metadata

package
v1.6.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 157

Documentation

Index

Constants

View Source
const (
	// TTLMetadataKey defines the metadata key for setting a time to live (in seconds).
	TTLMetadataKey = "ttlInSeconds"

	// RawPayloadKey defines the metadata key for forcing raw payload in pubsub.
	RawPayloadKey = "rawPayload"

	// PriorityMetadataKey defines the metadata key for setting a priority.
	PriorityMetadataKey = "priority"

	// ContentType defines the metadata key for the content type.
	ContentType = "contentType"
)

Variables

This section is empty.

Functions

func IsRawPayload added in v1.2.0

func IsRawPayload(props map[string]string) (bool, error)

IsRawPayload determines if payload should be used as-is.

func TryGetContentType added in v1.5.0

func TryGetContentType(props map[string]string) (string, bool)

func TryGetPriority

func TryGetPriority(props map[string]string) (uint8, bool, error)

TryGetPriority tries to get the priority for binding and any other building block.

func TryGetTTL

func TryGetTTL(props map[string]string) (time.Duration, bool, error)

TryGetTTL tries to get the ttl as a time.Duration value for pubsub, binding and any other building block.

Types

type Duration added in v1.2.0

type Duration struct {
	time.Duration
}

func (Duration) MarshalJSON added in v1.2.0

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON added in v1.2.0

func (d *Duration) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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