Documentation ¶
Index ¶
- Constants
- func WithConsumeOptionsBindingExchangeName(name string) func(*ConsumeOptions)
- func WithConsumeOptionsBindingExchangeType(kind string) func(*ConsumeOptions)
- func WithConsumeOptionsBindingRoutingKeys(keys []string) func(*ConsumeOptions)
- func WithConsumeOptionsConcurrency(concurrency int) func(*ConsumeOptions)
- func WithConsumeOptionsConsumerAutoAck(autoAck bool) func(*ConsumeOptions)
- func WithConsumeOptionsConsumerName(consumerName string) func(*ConsumeOptions)
- func WithConsumeOptionsQOSPrefetch(prefetchCount int) func(*ConsumeOptions)
- func WithPublishOptionsAppID(appID string) func(*PublishOptions)
- func WithPublishOptionsContentType(contentType string) func(*PublishOptions)
- func WithPublishOptionsExchange(exchange string) func(*PublishOptions)
- func WithPublishOptionsMessageID(messageID string) func(*PublishOptions)
- func WithPublishOptionsReplyTo(replyTo string) func(*PublishOptions)
- func WithPublishOptionsUserID(userID string) func(*PublishOptions)
- type AdapterCache
- type AdapterLocker
- type AdapterQueue
- type BindingExchangeOptions
- type ConsumeOptions
- type ConsumerFunc
- type Messager
- type PublishOptions
Constants ¶
const (
PrefixKey = "__host"
)
Variables ¶
This section is empty.
Functions ¶
func WithConsumeOptionsBindingExchangeName ¶
func WithConsumeOptionsBindingExchangeName(name string) func(*ConsumeOptions)
WithConsumeOptionsBindingExchangeName returns a function that sets the exchange name the queue will be bound to
func WithConsumeOptionsBindingExchangeType ¶
func WithConsumeOptionsBindingExchangeType(kind string) func(*ConsumeOptions)
WithConsumeOptionsBindingExchangeType returns a function that sets the binding exchange kind/type
func WithConsumeOptionsBindingRoutingKeys ¶
func WithConsumeOptionsBindingRoutingKeys(keys []string) func(*ConsumeOptions)
WithConsumeOptionsBindingRoutingKeys returns a function that sets the exchange name the RoutingKeys will be bound to
func WithConsumeOptionsConcurrency ¶
func WithConsumeOptionsConcurrency(concurrency int) func(*ConsumeOptions)
WithConsumeOptionsConcurrency returns a function that sets the concurrency, which means that many goroutines will be spawned to run the provided handler on messages
func WithConsumeOptionsConsumerAutoAck ¶
func WithConsumeOptionsConsumerAutoAck(autoAck bool) func(*ConsumeOptions)
WithConsumeOptionsConsumerAutoAck returns a function that sets the auto acknowledge property on the server of this consumer if unset the default will be used (false)
func WithConsumeOptionsConsumerName ¶
func WithConsumeOptionsConsumerName(consumerName string) func(*ConsumeOptions)
WithConsumeOptionsConsumerName returns a function that sets the name on the server of this consumer if unset a random name will be given
func WithConsumeOptionsQOSPrefetch ¶
func WithConsumeOptionsQOSPrefetch(prefetchCount int) func(*ConsumeOptions)
WithConsumeOptionsQOSPrefetch returns a function that sets the prefetch count, which means that many messages will be fetched from the server in advance to help with throughput. This doesn't affect the handler, messages are still processed one at a time.
func WithPublishOptionsAppID ¶
func WithPublishOptionsAppID(appID string) func(*PublishOptions)
WithPublishOptionsAppID returns a function that sets the application id
func WithPublishOptionsContentType ¶
func WithPublishOptionsContentType(contentType string) func(*PublishOptions)
WithPublishOptionsContentType returns a function that sets the content type, i.e. "application/json"
func WithPublishOptionsExchange ¶
func WithPublishOptionsExchange(exchange string) func(*PublishOptions)
WithPublishOptionsExchange returns a function that sets the exchange to publish to
func WithPublishOptionsMessageID ¶
func WithPublishOptionsMessageID(messageID string) func(*PublishOptions)
WithPublishOptionsMessageID returns a function that sets the message identifier
func WithPublishOptionsReplyTo ¶
func WithPublishOptionsReplyTo(replyTo string) func(*PublishOptions)
WithPublishOptionsReplyTo returns a function that sets the reply to field
func WithPublishOptionsUserID ¶
func WithPublishOptionsUserID(userID string) func(*PublishOptions)
WithPublishOptionsUserID returns a function that sets the user id i.e. "user"
Types ¶
type AdapterCache ¶
type AdapterCache interface { String() string Get(ctx context.Context, key string) (*gvar.Var, error) Set(ctx context.Context, key string, val interface{}, expire int) error Del(ctx context.Context, key string) error HashGet(ctx context.Context, hk, key string) (*gvar.Var, error) HashDel(ctx context.Context, hk, key string) error Increase(ctx context.Context, key string) error Decrease(ctx context.Context, key string) error Expire(ctx context.Context, key string, dur time.Duration) error }
type AdapterLocker ¶
type AdapterQueue ¶
type AdapterQueue interface { String() string Publish(ctx context.Context, message Messager, optionFuncs ...func(*PublishOptions)) error Consumer(ctx context.Context, name string, f ConsumerFunc, optionFuncs ...func(*ConsumeOptions)) Run(ctx context.Context) Shutdown(ctx context.Context) }
type BindingExchangeOptions ¶
BindingExchangeOptions are used when binding to an exchange. it will verify the exchange is created before binding to it.
type ConsumeOptions ¶
type ConsumeOptions struct { BindingRoutingKeys []string BindingExchange *BindingExchangeOptions Concurrency int QOSPrefetch int ConsumerName string ConsumerAutoAck bool }
ConsumeOptions are used to describe how a new consumer will be created.
func GetDefaultConsumeOptions ¶
func GetDefaultConsumeOptions() ConsumeOptions
GetDefaultConsumeOptions descibes the options that will be used when a value isn't provided
type PublishOptions ¶
type PublishOptions struct { Exchange string // MIME content type ContentType string // address to to reply to (ex: RPC) ReplyTo string // message identifier MessageID string // creating user id - ex: "guest" UserID string // creating application id AppID string }
PublishOptions are used to control how data is published