Documentation ¶
Index ¶
- Constants
- type AlterOption
- func AlterConsumerWithAttributes(name string, attributes map[string]string) AlterOption
- func AlterConsumerWithImportant(name string, important bool) AlterOption
- func AlterConsumerWithReadFrom(name string, readFrom time.Time) AlterOption
- func AlterConsumerWithSupportedCodecs(name string, codecs []topictypes.Codec) AlterOption
- func AlterWithAddConsumers(consumers ...topictypes.Consumer) AlterOption
- func AlterWithAttributes(attributes map[string]string) AlterOption
- func AlterWithDropConsumers(consumersName ...string) AlterOption
- func AlterWithMeteringMode(m topictypes.MeteringMode) AlterOption
- func AlterWithMinActivePartitions(minActivePartitions int64) AlterOption
- func AlterWithPartitionCountLimit(partitionCountLimit int64) AlterOption
- func AlterWithPartitionWriteBurstBytes(burstBytes int64) AlterOption
- func AlterWithPartitionWriteSpeedBytesPerSecond(bytesPerSecond int64) AlterOption
- func AlterWithRetentionPeriod(retentionPeriod time.Duration) AlterOption
- func AlterWithRetentionStorageMB(retentionStorageMB int64) AlterOption
- func AlterWithSupportedCodecs(codecs ...topictypes.Codec) AlterOption
- type CommitMode
- type CreateDecoderFunc
- type CreateEncoderFunc
- type CreateOption
- func CreateWithAttributes(attributes map[string]string) CreateOption
- func CreateWithConsumer(consumers ...topictypes.Consumer) CreateOption
- func CreateWithMeteringMode(mode topictypes.MeteringMode) CreateOption
- func CreateWithMinActivePartitions(count int64) CreateOption
- func CreateWithPartitionCountLimit(count int64) CreateOption
- func CreateWithPartitionWriteBurstBytes(partitionWriteBurstBytes int64) CreateOption
- func CreateWithPartitionWriteSpeedBytesPerSecond(partitionWriteSpeedBytesPerSecond int64) CreateOption
- func CreateWithRetentionPeriod(retentionPeriod time.Duration) CreateOption
- func CreateWithRetentionStorageMB(retentionStorageMB int64) CreateOption
- func CreateWithSupportedCodecs(codecs ...topictypes.Codec) CreateOption
- type DescribeOption
- type DropOption
- type GetPartitionStartOffsetFunc
- type GetPartitionStartOffsetRequest
- type GetPartitionStartOffsetResponse
- type OnWriterInitResponseCallback
- type ReadSelector
- type ReadSelectors
- type ReaderOption
- func WithAddDecoder(codec topictypes.Codec, decoderCreate CreateDecoderFunc) ReaderOption
- func WithBatchReadMaxCount(count int) ReaderOption
- func WithBatchReadMinCount(count int) ReaderOption
- func WithCommitCountTrigger(count int) ReaderOption
- func WithCommitMode(mode CommitMode) ReaderOption
- func WithCommitTimeLagTrigger(lag time.Duration) ReaderOption
- func WithCommonConfig(common config.Common) ReaderOption
- func WithGetPartitionStartOffset(f GetPartitionStartOffsetFunc) ReaderOption
- func WithMessagesBufferSize(size int) ReaderOption
- func WithReaderOperationCancelAfter(cancelAfter time.Duration) ReaderOption
- func WithReaderOperationTimeout(timeout time.Duration) ReaderOption
- func WithReaderTrace(tracer trace.Topic) ReaderOption
- type TopicOption
- type WithOnWriterConnectedInfo
- type WriteSessionMetadata
- type WriterOption
- func WithCodec(codec topictypes.Codec) WriterOption
- func WithCodecAutoSelect() WriterOption
- func WithMessageGroupID(groupID string) WriterOption
- func WithOnWriterFirstConnected(f OnWriterInitResponseCallback) WriterOption
- func WithPartitionID(partitionID int64) WriterOption
- func WithSyncWrite(sync bool) WriterOption
- func WithWriteSessionMeta(meta map[string]string) WriterOption
- func WithWriterAddEncoder(codec topictypes.Codec, f CreateEncoderFunc) WriterOption
- func WithWriterCompressorCount(num int) WriterOption
- func WithWriterMaxQueueLen(num int) WriterOption
- func WithWriterMessageMaxBytesSize(size int) WriterOption
- func WithWriterPartitioning(partitioning topicwriter.Partitioning) WriterOption
- func WithWriterSetAutoCreatedAt(val bool) WriterOption
- func WithWriterSetAutoSeqNo(val bool) WriterOption
Constants ¶
const ( // CommitModeAsync - commit return true if commit success add to internal send buffer (but not sent to server) // now it is grpc buffer, in feature it may be internal sdk buffer CommitModeAsync = topicreaderinternal.CommitModeAsync // default // CommitModeNone - reader will not be commit operation CommitModeNone = topicreaderinternal.CommitModeNone // CommitModeSync - commit return true when sdk receive ack of commit from server // The mode needs strong ordering client code for prevent deadlock. // Example: // Good: // CommitOffset(1) // CommitOffset(2) // // Deadlock: // CommitOffset(2) - server will wait commit offset 1 before send ack about offset 1 and 2 committed. // CommitOffset(1) CommitModeSync = topicreaderinternal.CommitModeSync )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlterOption ¶
type AlterOption func(req *rawtopic.AlterTopicRequest)
AlterOption
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterConsumerWithAttributes ¶
func AlterConsumerWithAttributes(name string, attributes map[string]string) AlterOption
AlterConsumerWithAttributes
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterConsumerWithImportant ¶
func AlterConsumerWithImportant(name string, important bool) AlterOption
AlterConsumerWithImportant
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterConsumerWithReadFrom ¶
func AlterConsumerWithReadFrom(name string, readFrom time.Time) AlterOption
AlterConsumerWithReadFrom
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterConsumerWithSupportedCodecs ¶
func AlterConsumerWithSupportedCodecs(name string, codecs []topictypes.Codec) AlterOption
AlterConsumerWithSupportedCodecs
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterWithAddConsumers ¶
func AlterWithAddConsumers(consumers ...topictypes.Consumer) AlterOption
AlterWithAddConsumers
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterWithAttributes ¶
func AlterWithAttributes(attributes map[string]string) AlterOption
AlterWithAttributes
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterWithDropConsumers ¶
func AlterWithDropConsumers(consumersName ...string) AlterOption
AlterWithDropConsumers
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterWithMeteringMode ¶ added in v3.38.2
func AlterWithMeteringMode(m topictypes.MeteringMode) AlterOption
AlterWithMeteringMode
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterWithMinActivePartitions ¶
func AlterWithMinActivePartitions(minActivePartitions int64) AlterOption
AlterWithMinActivePartitions
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterWithPartitionCountLimit ¶
func AlterWithPartitionCountLimit(partitionCountLimit int64) AlterOption
AlterWithPartitionCountLimit
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterWithPartitionWriteBurstBytes ¶
func AlterWithPartitionWriteBurstBytes(burstBytes int64) AlterOption
AlterWithPartitionWriteBurstBytes
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterWithPartitionWriteSpeedBytesPerSecond ¶
func AlterWithPartitionWriteSpeedBytesPerSecond(bytesPerSecond int64) AlterOption
AlterWithPartitionWriteSpeedBytesPerSecond
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterWithRetentionPeriod ¶
func AlterWithRetentionPeriod(retentionPeriod time.Duration) AlterOption
AlterWithRetentionPeriod
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterWithRetentionStorageMB ¶
func AlterWithRetentionStorageMB(retentionStorageMB int64) AlterOption
AlterWithRetentionStorageMB
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func AlterWithSupportedCodecs ¶
func AlterWithSupportedCodecs(codecs ...topictypes.Codec) AlterOption
AlterWithSupportedCodecs
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type CommitMode ¶
type CommitMode = topicreaderinternal.PublicCommitMode
CommitMode
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type CreateDecoderFunc ¶
type CreateDecoderFunc = topicreaderinternal.PublicCreateDecoderFunc
CreateDecoderFunc
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type CreateEncoderFunc ¶ added in v3.38.0
type CreateEncoderFunc = topicwriterinternal.PublicCreateEncoderFunc
type CreateOption ¶
type CreateOption func(request *rawtopic.CreateTopicRequest)
CreateOption
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func CreateWithAttributes ¶
func CreateWithAttributes(attributes map[string]string) CreateOption
CreateWithAttributes
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func CreateWithConsumer ¶
func CreateWithConsumer(consumers ...topictypes.Consumer) CreateOption
CreateWithConsumer
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func CreateWithMeteringMode ¶ added in v3.38.2
func CreateWithMeteringMode(mode topictypes.MeteringMode) CreateOption
CreateWithMeteringMode
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func CreateWithMinActivePartitions ¶
func CreateWithMinActivePartitions(count int64) CreateOption
CreateWithMinActivePartitions
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func CreateWithPartitionCountLimit ¶
func CreateWithPartitionCountLimit(count int64) CreateOption
CreateWithPartitionCountLimit
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func CreateWithPartitionWriteBurstBytes ¶
func CreateWithPartitionWriteBurstBytes(partitionWriteBurstBytes int64) CreateOption
CreateWithPartitionWriteBurstBytes
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func CreateWithPartitionWriteSpeedBytesPerSecond ¶
func CreateWithPartitionWriteSpeedBytesPerSecond(partitionWriteSpeedBytesPerSecond int64) CreateOption
CreateWithPartitionWriteSpeedBytesPerSecond
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func CreateWithRetentionPeriod ¶
func CreateWithRetentionPeriod(retentionPeriod time.Duration) CreateOption
CreateWithRetentionPeriod
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func CreateWithRetentionStorageMB ¶
func CreateWithRetentionStorageMB(retentionStorageMB int64) CreateOption
CreateWithRetentionStorageMB
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func CreateWithSupportedCodecs ¶ added in v3.38.2
func CreateWithSupportedCodecs(codecs ...topictypes.Codec) CreateOption
CreateWithSupportedCodecs
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type DescribeOption ¶
type DescribeOption func(req *rawtopic.DescribeTopicRequest)
DescribeOption
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type DropOption ¶
type DropOption func(request *rawtopic.DropTopicRequest)
DropOption
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type GetPartitionStartOffsetFunc ¶
type GetPartitionStartOffsetFunc = topicreaderinternal.PublicGetPartitionStartOffsetFunc
GetPartitionStartOffsetFunc
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type GetPartitionStartOffsetRequest ¶
type GetPartitionStartOffsetRequest = topicreaderinternal.PublicGetPartitionStartOffsetRequest
GetPartitionStartOffsetRequest
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type GetPartitionStartOffsetResponse ¶
type GetPartitionStartOffsetResponse = topicreaderinternal.PublicGetPartitionStartOffsetResponse
GetPartitionStartOffsetResponse
type OnWriterInitResponseCallback ¶ added in v3.38.0
type OnWriterInitResponseCallback = topicwriterinternal.PublicOnWriterInitResponseCallback
OnWriterInitResponseCallback
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type ReadSelector ¶
type ReadSelector = topicreaderinternal.PublicReadSelector
ReadSelector
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type ReadSelectors ¶
type ReadSelectors []ReadSelector
ReadSelectors
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func ReadTopic ¶
func ReadTopic(path string) ReadSelectors
ReadTopic create simple selector for read topics
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type ReaderOption ¶
type ReaderOption = topicreaderinternal.PublicReaderOption
ReaderOption
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithAddDecoder ¶
func WithAddDecoder(codec topictypes.Codec, decoderCreate CreateDecoderFunc) ReaderOption
WithAddDecoder
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithBatchReadMaxCount ¶
func WithBatchReadMaxCount(count int) ReaderOption
WithBatchReadMaxCount
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithBatchReadMinCount ¶
func WithBatchReadMinCount(count int) ReaderOption
WithBatchReadMinCount prefer min count messages in batch sometimes batch can contain fewer messages, for example if local buffer is full and SDK can't receive more messages
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithCommitCountTrigger ¶
func WithCommitCountTrigger(count int) ReaderOption
WithCommitCountTrigger set count trigger for send batch to server if count > 0 and sdk count of buffered commits >= count - send commit request to server 0 mean no count limit and use timer lag trigger only
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithCommitMode ¶
func WithCommitMode(mode CommitMode) ReaderOption
WithCommitMode
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithCommitTimeLagTrigger ¶
func WithCommitTimeLagTrigger(lag time.Duration) ReaderOption
WithCommitTimeLagTrigger set time lag from first commit message before send commit to server for accumulate many similar-time commits to one server request 0 mean no additional lag and send commit soon as possible Default value: 1 second
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithCommonConfig ¶
func WithCommonConfig(common config.Common) ReaderOption
WithCommonConfig
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithGetPartitionStartOffset ¶
func WithGetPartitionStartOffset(f GetPartitionStartOffsetFunc) ReaderOption
WithGetPartitionStartOffset
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithMessagesBufferSize ¶
func WithMessagesBufferSize(size int) ReaderOption
WithMessagesBufferSize
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithReaderOperationCancelAfter ¶
func WithReaderOperationCancelAfter(cancelAfter time.Duration) ReaderOption
WithReaderOperationCancelAfter
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithReaderOperationTimeout ¶
func WithReaderOperationTimeout(timeout time.Duration) ReaderOption
WithReaderOperationTimeout
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithReaderTrace ¶ added in v3.32.0
func WithReaderTrace(tracer trace.Topic) ReaderOption
WithReaderTrace
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type TopicOption ¶
TopicOption
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithOperationCancelAfter ¶
func WithOperationCancelAfter(operationCancelAfter time.Duration) TopicOption
WithOperationCancelAfter set the maximum amount of time a YDB server will process an operation. After timeout exceeds YDB will try to cancel operation and if it succeeds appropriate error will be returned to the client; otherwise processing will be continued. If OperationCancelAfter is zero then no timeout is used.
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithOperationTimeout ¶
func WithOperationTimeout(operationTimeout time.Duration) TopicOption
WithOperationTimeout set the maximum amount of time a YDB server will process an operation. After timeout exceeds YDB will try to cancel operation and regardless of the cancellation appropriate error will be returned to the client. If OperationTimeout is zero then no timeout is used.
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithTrace ¶
func WithTrace(trace trace.Topic, opts ...trace.TopicComposeOption) TopicOption
WithTrace defines trace over persqueue client calls
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type WithOnWriterConnectedInfo ¶ added in v3.38.0
type WithOnWriterConnectedInfo = topicwriterinternal.PublicWithOnWriterConnectedInfo
WithOnWriterConnectedInfo present information, received from server
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
type WriteSessionMetadata ¶ added in v3.38.0
type WriterOption ¶ added in v3.38.0
type WriterOption = topicwriterinternal.PublicWriterOption
func WithCodec ¶ added in v3.38.0
func WithCodec(codec topictypes.Codec) WriterOption
WithCodec disable codec auto select and force set codec for the write session
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithCodecAutoSelect ¶ added in v3.38.0
func WithCodecAutoSelect() WriterOption
WithCodecAutoSelect - auto select best codec for messages stream enabled by default if option enabled - send a batch of messages for every allowed codec (for prevent delayed bad codec accident) then from time to time measure all codecs and select codec with the smallest result messages size
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithMessageGroupID ¶ added in v3.38.0
func WithMessageGroupID(groupID string) WriterOption
WithMessageGroupID set message groupid on write session level
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithOnWriterFirstConnected ¶ added in v3.38.0
func WithOnWriterFirstConnected(f OnWriterInitResponseCallback) WriterOption
WithOnWriterFirstConnected set callback f, which will called once - after first successfully init topic writer stream
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithPartitionID ¶ added in v3.38.0
func WithPartitionID(partitionID int64) WriterOption
WithPartitionID set direct partition id on write session level
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithSyncWrite ¶ added in v3.38.0
func WithSyncWrite(sync bool) WriterOption
WithSyncWrite - when enabled every Write call wait ack from server for all messages from the call disabled by default
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithWriteSessionMeta ¶ added in v3.38.0
func WithWriteSessionMeta(meta map[string]string) WriterOption
WithWriteSessionMeta set session metadata
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithWriterAddEncoder ¶ added in v3.38.0
func WithWriterAddEncoder(codec topictypes.Codec, f CreateEncoderFunc) WriterOption
WithWriterAddEncoder add custom codec implementation to writer
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithWriterCompressorCount ¶ added in v3.38.0
func WithWriterCompressorCount(num int) WriterOption
WithWriterCompressorCount set max count of goroutine for compress messages must be more zero
panic if num <= 0
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithWriterMaxQueueLen ¶ added in v3.38.2
func WithWriterMaxQueueLen(num int) WriterOption
WithWriterMaxQueueLen set max len of queue for wait ack
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithWriterMessageMaxBytesSize ¶ added in v3.38.2
func WithWriterMessageMaxBytesSize(size int) WriterOption
WithWriterMessageMaxBytesSize set max body size of one message in bytes
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithWriterPartitioning ¶ added in v3.38.0
func WithWriterPartitioning(partitioning topicwriter.Partitioning) WriterOption
WithWriterPartitioning explicit set partitioning for write session
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithWriterSetAutoCreatedAt ¶ added in v3.38.0
func WithWriterSetAutoCreatedAt(val bool) WriterOption
WithWriterSetAutoCreatedAt set messages CreatedAt by SDK enabled by default if enabled - Message.CreatedAt field must be zero
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
func WithWriterSetAutoSeqNo ¶ added in v3.38.0
func WithWriterSetAutoSeqNo(val bool) WriterOption
WithWriterSetAutoSeqNo set messages SeqNo by SDK enabled by default if enabled - Message.SeqNo field must be zero
Experimental ¶
Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.