options

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: GPL-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVOption

type KVOption func(o *KVOptions) error

func SetBucketName

func SetBucketName(name string) KVOption

func SetDescription

func SetDescription(name string) KVOption

func SetTTL

func SetTTL(ttl time.Duration) KVOption

type KVOptions

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

func (*KVOptions) BucketName

func (kvo *KVOptions) BucketName() string

func (*KVOptions) Description

func (kvo *KVOptions) Description() string

func (*KVOptions) TTL

func (kvo *KVOptions) TTL() time.Duration

type Option

type Option func(o *Options) error

func SetAddress

func SetAddress(address string) Option

func SetAuthorizationToken

func SetAuthorizationToken(token string) Option

func SetCodec

func SetCodec(c codec.Codec) Option

func SetContext

func SetContext(ctx context.Context) Option

func SetMarshaler

func SetMarshaler(msh codec.Marshaler) Option

func SetNatsOptions

func SetNatsOptions(opts ...nats.Option) Option

func SetPassword

func SetPassword(password string) Option

func SetStoreName

func SetStoreName(name string) Option

func SetUsername

func SetUsername(username string) Option

func UseCodec

func UseCodec() Option

func UseMarshaler

func UseMarshaler() Option

type Options

type Options struct {
	// Used to select codec
	ServiceName         string
	Address             string
	CertContent         string
	AuthenticationToken string
	Username            string
	Password            string
	// contains filtered or unexported fields
}

func (*Options) Codec

func (o *Options) Codec() codec.Codec

func (*Options) Context

func (o *Options) Context() context.Context

func (*Options) Marshaler

func (o *Options) Marshaler() codec.Marshaler

func (*Options) NatOptions

func (o *Options) NatOptions() []nats.Option

type PublisherOption

type PublisherOption func(o *PublisherOptions) error

func DisablePubStreaming

func DisablePubStreaming() PublisherOption

func SetPubContentType

func SetPubContentType(ContentType string) PublisherOption

func SetPubContext

func SetPubContext(ctx context.Context) PublisherOption

func SetPubHeader

func SetPubHeader(key, value string) PublisherOption

func SetPubHeaders

func SetPubHeaders(headers map[string]string) PublisherOption

func SetPubMsgVersion

func SetPubMsgVersion(version string) PublisherOption

type PublisherOptions

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

func DefaultPublisherOptions

func DefaultPublisherOptions(opts ...PublisherOption) (*PublisherOptions, error)

func (*PublisherOptions) ContentType

func (p *PublisherOptions) ContentType() string

func (*PublisherOptions) Context

func (p *PublisherOptions) Context() context.Context

func (*PublisherOptions) Headers

func (p *PublisherOptions) Headers() map[string]string

func (*PublisherOptions) IsStreamingDisabled

func (p *PublisherOptions) IsStreamingDisabled() bool

func (*PublisherOptions) SpecVersion

func (p *PublisherOptions) SpecVersion() string

type StreamerOption added in v2.0.9

type StreamerOption func(o *StreamerOptions) error

func SetStaleStreamCleanupDuration added in v2.0.9

func SetStaleStreamCleanupDuration(t time.Duration) StreamerOption

func SetStreamProcessorChanSize added in v2.0.9

func SetStreamProcessorChanSize(s int) StreamerOption

type StreamerOptions added in v2.0.9

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

func DefaultStreamerOptions added in v2.0.9

func DefaultStreamerOptions() StreamerOptions

func (StreamerOptions) ChanSize added in v2.0.9

func (o StreamerOptions) ChanSize() int

func (StreamerOptions) Duration added in v2.0.9

func (o StreamerOptions) Duration() time.Duration

type SubscriptionOption

type SubscriptionOption func(o *SubscriptionOptions) error

func DisableSubStreaming

func DisableSubStreaming() SubscriptionOption

func SetExpectedMessageSpecVersion

func SetExpectedMessageSpecVersion(version string) SubscriptionOption

func SetSubContentType

func SetSubContentType(contentType string) SubscriptionOption

func SetSubContext

func SetSubContext(ctx context.Context) SubscriptionOption

func SetSubMaxRedelivery

func SetSubMaxRedelivery(n int) SubscriptionOption

type SubscriptionOptions

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

func DefaultSubOptions

func DefaultSubOptions(opts ...SubscriptionOption) (*SubscriptionOptions, error)

func (SubscriptionOptions) ContentType

func (s SubscriptionOptions) ContentType() string

func (SubscriptionOptions) Context

func (s SubscriptionOptions) Context() context.Context

func (SubscriptionOptions) ExpectedSpecVersion

func (s SubscriptionOptions) ExpectedSpecVersion() string

func (SubscriptionOptions) IsStreamingDisabled

func (s SubscriptionOptions) IsStreamingDisabled() bool

func (SubscriptionOptions) MaxRedelivery

func (s SubscriptionOptions) MaxRedelivery() int

func (SubscriptionOptions) SubscriptionType

func (s SubscriptionOptions) SubscriptionType() SubscriptionType

type SubscriptionType

type SubscriptionType int

SubscriptionType of subscription supported by most messaging systems. ( Pulsar,

const (
	// Exclusive there can be only 1 consumer on the same topic with the same subscription name
	Exclusive SubscriptionType = iota

	// Shared subscription mode, multiple consumer will be able to use the same subscription name
	// and the messages will be dispatched according to
	// a round-robin rotation between the connected consumers
	Shared

	// Failover subscription mode, multiple consumer will be able to use the same subscription name
	// but only 1 consumer will receive the messages.
	// If that consumer disconnects, one of the other connected consumers will start receiving messages.
	Failover

	// KeyShared subscription mode, multiple consumer will be able to use the same
	// subscription and all messages with the same key will be dispatched to only one consumer
	KeyShared
)

func (SubscriptionType) IsValid

func (t SubscriptionType) IsValid() bool

func (SubscriptionType) String

func (t SubscriptionType) String() string

Jump to

Keyboard shortcuts

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