pubsub

package
v1.0.1-0...-f351835 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCloudEvent

func NewCloudEvent(req *CloudEvent) (map[string]interface{}, error)

NewCloudEvent encapusalates the creation of a Dapr cloudevent from an existing cloudevent or a raw payload

Types

type Adapter

type Adapter interface {
	GetPubSub(pubsubName string) contrib_pubsub.PubSub
	Publish(req *contrib_pubsub.PublishRequest) error
}

Adapter is the interface for message buses

type CloudEvent

type CloudEvent struct {
	ID              string
	Data            []byte
	Topic           string
	Pubsub          string
	DataContentType string
	TraceID         string
}

CloudEvent is a reqeust object to create a Dapr compliant cloudevent

type NotAllowedError

type NotAllowedError struct {
	Topic string
	ID    string
}

pubsub.NotAllowedError is returned by the runtime when publishing is forbidden

func (NotAllowedError) Error

func (e NotAllowedError) Error() string

type NotFoundError

type NotFoundError struct {
	PubsubName string
}

pubsub.NotFoundError is returned by the runtime when the pubsub does not exist

func (NotFoundError) Error

func (e NotFoundError) Error() string

type Subscription

type Subscription struct {
	PubsubName string            `json:"pubsubname"`
	Topic      string            `json:"topic"`
	Route      string            `json:"route"`
	Metadata   map[string]string `json:"metadata"`
	Scopes     []string          `json:"scopes"`
}

func DeclarativeKubernetes

func DeclarativeKubernetes(client operatorv1pb.OperatorClient, log logger.Logger) []Subscription

DeclarativeKubernetes loads subscriptions from the operator when running in Kubernetes

func DeclarativeSelfHosted

func DeclarativeSelfHosted(componentsPath string, log logger.Logger) []Subscription

DeclarativeSelfHosted loads subscriptions from the given components path

func GetSubscriptionsGRPC

func GetSubscriptionsGRPC(channel runtimev1pb.AppCallbackClient, log logger.Logger) []Subscription

func GetSubscriptionsHTTP

func GetSubscriptionsHTTP(channel channel.AppChannel, log logger.Logger) []Subscription

Jump to

Keyboard shortcuts

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