golang

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Code generated by gen.sh. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	// MetaID is a unique ID for the message.
	// Required.
	// https://github.com/cloudevents/spec/blob/master/spec.md#id
	MetaID = "dataflow-id"
	// MetaSource is the source of the messages as a Unique Resource Identifier (URI).
	// Required.
	// https://github.com/cloudevents/spec/blob/master/spec.md#source-1
	MetaSource = "dataflow-source"
	// MetaTime is the time of the message. As meta-data, this might be different to the event-time (which might be within the message).
	// For example, it might be the last-modified time of a file, but the file itself was created at another time.
	// Optional.
	// https://github.com/cloudevents/spec/blob/master/spec.md#time
	MetaTime = "dataflow-time"
)

Functions

func ContextWithMeta added in v0.0.105

func ContextWithMeta(ctx context.Context, m Meta) context.Context

func HandleCrash added in v0.0.105

func HandleCrash()

func MetaExtract added in v0.0.105

func MetaExtract(ctx context.Context, h http.Header) context.Context

func MetaInject added in v0.0.105

func MetaInject(ctx context.Context, h http.Header) error

func Start

func Start(handler func(ctx context.Context, msg []byte) ([]byte, error))

func StartWithContext

func StartWithContext(ctx context.Context, handler func(ctx context.Context, msg []byte) ([]byte, error)) error

Types

type Meta added in v0.0.116

type Meta struct {
	Source string `json:"source" protobuf:"bytes,1,opt,name=source"`
	ID     string `json:"id" protobuf:"bytes,2,opt,name=id"`
	// UnixTime
	Time int64 `json:"time,omitempty" protobuf:"varint,3,opt,name=time"`
}

func MetaFromContext added in v0.0.105

func MetaFromContext(ctx context.Context) (Meta, error)

Jump to

Keyboard shortcuts

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