publisheropts

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ManagementOption

type ManagementOption func(p common.Publisher) error

ManagementOption provides structure for configuring a new Publisher

func SetDefaultHeader

func SetDefaultHeader(headerName, msgKey string) ManagementOption

SetDefaultHeader adds a header to every message published using the value specified from the message body

func SetMessageMarshaller added in v0.8.2

func SetMessageMarshaller(marshaller marshal.Marshaller) ManagementOption

SetMessageMarshaller sets the message marshaller for this publisher. defaults to json.

func WithConnectionString

func WithConnectionString(connStr string) ManagementOption

WithConnectionString configures a publisher with the information provided in a Service Bus connection string

func WithEnvironmentName

func WithEnvironmentName(environmentName string) ManagementOption

WithEnvironmentName configures the azure environment used to connect to Servicebus. The environment value used is then provided by Azure/go-autorest. ref: https://github.com/Azure/go-autorest/blob/c7f947c0610de1bc279f76e6d453353f95cd1bfa/autorest/azure/environments.go#L34

func WithManagedIdentityClientID

func WithManagedIdentityClientID(serviceBusNamespaceName, managedIdentityClientID string) ManagementOption

WithManagedIdentityClientID configures a publisher with the attached managed identity and the Service bus resource name

func WithManagedIdentityResourceID

func WithManagedIdentityResourceID(serviceBusNamespaceName, managedIdentityResourceID string) ManagementOption

WithManagedIdentityResourceID configures a publisher with the attached managed identity and the Service bus resource name

func WithToken

func WithToken(serviceBusNamespaceName string, spt *adal.ServicePrincipalToken) ManagementOption

type Option

type Option func(msg *servicebus.Message) error

Option provides structure for configuring when starting to publish to a specified queue

func SetCorrelationID

func SetCorrelationID(correlationID string) Option

SetCorrelationID sets the SetCorrelationID of the message.

func SetMessage added in v0.8.2

func SetMessage(messageConfigurator func(msg *servicebus.Message) error) Option

SetMessage provides a func that will configure the message before sending it.

func SetMessageDelay

func SetMessageDelay(delay time.Duration) Option

SetMessageDelay schedules a message in the future

func SetMessageID

func SetMessageID(messageID string) Option

SetMessageID sets the messageID of the message. Used for duplication detection

func SetScheduleAt added in v0.8.2

func SetScheduleAt(t time.Time) Option

SetScheduleAt schedules a message in the future

func SetUserProperty added in v0.8.2

func SetUserProperty(key string, value interface{}) Option

SetUserProperty sets a SetUserProperty on the message.

Jump to

Keyboard shortcuts

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