brokers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

The list that can be iterated

Functions

func NewAzServiceBusBuilder

func NewAzServiceBusBuilder() (asbc *azServiceBusBuilder)

func NewCloudEvent

func NewCloudEvent(ctx context.Context, eventType services.EventType, source, subject string, payload []byte) (cloudevent []byte, err error)

func NewGcpPubSubBuilder added in v0.1.1

func NewGcpPubSubBuilder() (spb *gcpPubSubBuilder)

Types

type AzServiceBusClient

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

func NewAzServiceBusClient

func NewAzServiceBusClient() (asbc *AzServiceBusClient, err error)

func (*AzServiceBusClient) Close

func (asbc *AzServiceBusClient) Close(ctx context.Context)

func (*AzServiceBusClient) Connect

func (asbc *AzServiceBusClient) Connect(ctx context.Context, cfg *ServiceBrokerConfig) (err error)

func (*AzServiceBusClient) Consume

func (asbc *AzServiceBusClient) Consume(ctx context.Context, subscriptionId string, limit int, f func(context.Context, []byte) error) (err error)

func (*AzServiceBusClient) DeadletterReceive

func (asbc *AzServiceBusClient) DeadletterReceive(ctx context.Context) (err error)

func (*AzServiceBusClient) HandlerFn

func (asbc *AzServiceBusClient) HandlerFn(ctx context.Context, msg *servicebus.Message) error

func (*AzServiceBusClient) Publish

func (asbc *AzServiceBusClient) Publish(ctx context.Context, eventType services.EventType, source, subject string, value interface{}) error

func (asbc *AzServiceBusClient) Publish(ctx context.Context, cloudevent string) (err error) {

func (*AzServiceBusClient) PublishRaw

func (asbc *AzServiceBusClient) PublishRaw(ctx context.Context, cloudevent []byte) error

type ServiceBrokerBuilderInterface

type ServiceBrokerBuilderInterface interface {
	PrepareFoundation(ctx context.Context, defaults *configV2.BrokerDefaults, cfg *configV2.ServiceConfig) (err error)
	RemoveFoundation(ctx context.Context, defaults *configV2.BrokerDefaults, cfg *configV2.ServiceConfig) (err error)
	QueryFoundation(ctx context.Context, defaults *configV2.BrokerDefaults, cfg *configV2.ServiceConfig) (err error)
	Connect(ctx context.Context, cfg *configV2.ServiceConfig, topicID string) error
	CreateTopic(ctx context.Context, topicName string) (err error)
	DeleteTopic(ctx context.Context, topicName string) (err error)
	CreateSubscription(ctx context.Context, subID, topicName string, ackDeadline time.Duration) (err error)
	CreateSubscriptionWithDeadLetter(ctx context.Context, subID, topicName, DLTopicID string, ackDeadline time.Duration, maxDeliveryAttempts int) (err error)
	DeleteSubscription(ctx context.Context, subID string) (err error)
	GetTopics(ctx context.Context) ([]string, error)
	GetSubscriptions(ctx context.Context, subID, topicID string) ([]string, error)
}

type ServiceBrokerClient

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

Service implements serviceInterface

func (*ServiceBrokerClient) Add

func (slc *ServiceBrokerClient) Add(ctx context.Context, key string, value interface{}) (err error)

func (*ServiceBrokerClient) Consume

func (slc *ServiceBrokerClient) Consume(ctx context.Context, subscriptionId string, limit int, f func(context.Context, []byte) error) (err error)

func (*ServiceBrokerClient) Delete

func (slc *ServiceBrokerClient) Delete(ctx context.Context, key string) (err error)

func (*ServiceBrokerClient) GetCloudeventDomain

func (slc *ServiceBrokerClient) GetCloudeventDomain() string

func (*ServiceBrokerClient) NewClient

func (slc *ServiceBrokerClient) NewClient(ctx context.Context, topic string, cfg *ServiceBrokerConfig) (err error)

func (*ServiceBrokerClient) PublishRaw

func (slc *ServiceBrokerClient) PublishRaw(ctx context.Context, cloudevent []byte) (err error)

func (*ServiceBrokerClient) Update

func (slc *ServiceBrokerClient) Update(ctx context.Context, key string, value interface{}) (err error)

type ServiceBrokerClientInterface

type ServiceBrokerClientInterface interface {
	Connect(ctx context.Context, cfg *ServiceBrokerConfig) error
	PublishRaw(ctx context.Context, cloudevent []byte) error
	Publish(ctx context.Context, eventType services.EventType, source, subject string, value interface{}) error
	Consume(ctx context.Context, subscriptionId string, limit int, f func(context.Context, []byte) error) (err error)
}

type ServiceBrokerConfig

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

func NewServiceBrokerConfig

func NewServiceBrokerConfig(brokerType ServiceBrokerType, topic, subscription, cloudeventDomain string, hasDeadletter bool) *ServiceBrokerConfig

func (*ServiceBrokerConfig) GetBrokerType

func (sc *ServiceBrokerConfig) GetBrokerType() string

func (*ServiceBrokerConfig) GetClient

func (*ServiceBrokerConfig) HasDeadletter

func (sc *ServiceBrokerConfig) HasDeadletter(b bool)

func (*ServiceBrokerConfig) IsValidBrokerType

func (sc *ServiceBrokerConfig) IsValidBrokerType() bool

func (*ServiceBrokerConfig) SetBrokerType

func (sc *ServiceBrokerConfig) SetBrokerType(s string)

func (*ServiceBrokerConfig) SetCloudEventDomain

func (sc *ServiceBrokerConfig) SetCloudEventDomain(s string)

func (*ServiceBrokerConfig) SetConnectionString

func (sc *ServiceBrokerConfig) SetConnectionString(s string)

func (*ServiceBrokerConfig) SetGCPProjectID

func (sc *ServiceBrokerConfig) SetGCPProjectID(s string)

func (*ServiceBrokerConfig) SetSubscription

func (sc *ServiceBrokerConfig) SetSubscription(s string)

func (*ServiceBrokerConfig) SetTopic

func (sc *ServiceBrokerConfig) SetTopic(s string)

func (*ServiceBrokerConfig) Validate

func (sc *ServiceBrokerConfig) Validate(ctx context.Context) (errorString string)

type ServiceBrokerType

type ServiceBrokerType int
const (
	SERVICEBROKERTYPE_UNDEFINED ServiceBrokerType = iota
	SERVICEBROKERTYPE_PUBSUB
	SERVICEBROKERTYPE_SERVICEBUS
)

func GetServiceBrokerType

func GetServiceBrokerType(serviceBrokerName string) ServiceBrokerType

func (ServiceBrokerType) Cloud

func (ServiceBrokerType) NewBuilder

func (ServiceBrokerType) NewClient

func (ServiceBrokerType) String

func (d ServiceBrokerType) String() string

func (ServiceBrokerType) Type

func (d ServiceBrokerType) Type() string

Jump to

Keyboard shortcuts

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