Documentation ¶
Index ¶
- Constants
- func NewSource() sdk.Source
- type Config
- type Source
- func (s *Source) Ack(_ context.Context, position sdk.Position) error
- func (s *Source) Configure(_ context.Context, cfg map[string]string) error
- func (s *Source) Open(_ context.Context, position sdk.Position) error
- func (s *Source) Parameters() map[string]sdk.Parameter
- func (s *Source) Read(ctx context.Context) (sdk.Record, error)
- func (s *Source) Teardown(context.Context) error
Constants ¶
View Source
const ( // ConfigKeyBufferSize is a config name for a buffer size. ConfigKeyBufferSize = "bufferSize" // ConfigKeyDeliverSubject is a config name for a deliver subject. ConfigKeyDeliverSubject = "deliverSubject" // ConfigKeyDurable is a config name for a durable name. ConfigKeyDurable = "durable" // ConfigKeyDeliverPolicy is a config name for a message deliver policy. ConfigKeyDeliverPolicy = "deliverPolicy" // ConfigKeyAckPolicy is a config name for a message acknowledge policy. ConfigKeyAckPolicy = "ackPolicy" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { config.Config BufferSize int `key:"bufferSize" validate:"omitempty,min=64"` // Durable is the name of the Consumer, if set will make a consumer durable, // allowing resuming consumption where left off. Durable string `key:"durable" validate:"required"` // DeliverSubject specifies the JetStream consumer deliver subject. DeliverSubject string `json:"deliverSubject" validate:"required"` // DeliverPolicy defines where in the stream the connector should start receiving messages. DeliverPolicy nats.DeliverPolicy `key:"deliverPolicy" validate:"oneof=0 2"` // AckPolicy defines how messages should be acknowledged. AckPolicy nats.AckPolicy `key:"ackPolicy" validate:"oneof=0 1 2"` }
Config holds source specific configurable values.
type Source ¶
type Source struct { sdk.UnimplementedSource // contains filtered or unexported fields }
Source operates source logic.
func (*Source) Parameters ¶
Parameters is a map of named Parameters that describe how to configure the Source.
Click to show internal directories.
Click to hide internal directories.