converters

package
v0.0.0-...-d19fc40 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package converters contains pubsub message to cloudevent converters used by pubsub-based source.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter interface {
	Convert(ctx context.Context, msg *pubsub.Message, converterType ConverterType) (*cev2.Event, error)
}

func NewPubSubConverter

func NewPubSubConverter() Converter

type ConverterType

type ConverterType string
const (
	// The different type of Converters for the different sources.
	CloudPubSub    ConverterType = "pubsub"
	CloudStorage   ConverterType = "storage"
	CloudAuditLogs ConverterType = "auditlogs"
	CloudScheduler ConverterType = "scheduler"
	CloudBuild     ConverterType = "build"
	PubSubPull     ConverterType = "pubsub_pull"
)

type ModeType

type ModeType string

ModeType is the type for mode enum.

const (
	// Binary mode is binary encoding.
	Binary ModeType = "binary"
	// Structured mode is structured encoding.
	Structured ModeType = "structured"
	// Push mode emulates Pub/Sub push encoding.
	Push ModeType = "push"
)

type PubSubConverter

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

func (*PubSubConverter) Convert

func (c *PubSubConverter) Convert(ctx context.Context, msg *pubsub.Message, converterType ConverterType) (*cev2.Event, error)

Convert converts a message off the pubsub format to a source specific if there's a registered handler for the type in the converters map. If there's no registered handler, a default Pubsub one will be used.

type UnknownMsg

type UnknownMsg empty.Empty

func (*UnknownMsg) ProtoMessage

func (m *UnknownMsg) ProtoMessage()

func (*UnknownMsg) Reset

func (m *UnknownMsg) Reset()

func (*UnknownMsg) String

func (m *UnknownMsg) String() string

Jump to

Keyboard shortcuts

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