github.com/ydb-platform/ydb-go-sdk/v3@v3.89.2/internal/topic/topicreaderinternal/public_callbacks.go (about)

     1  package topicreaderinternal
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawtopic/rawtopiccommon"
     7  )
     8  
     9  // PublicGetPartitionStartOffsetResponse allow to set start offset for read messages for the partition
    10  type PublicGetPartitionStartOffsetResponse struct {
    11  	startOffset     rawtopiccommon.Offset
    12  	startOffsetUsed bool
    13  }
    14  
    15  // StartFrom set start offset for read the partition
    16  func (r *PublicGetPartitionStartOffsetResponse) StartFrom(offset int64) {
    17  	r.startOffset.FromInt64(offset)
    18  	r.startOffsetUsed = true
    19  }
    20  
    21  // PublicGetPartitionStartOffsetRequest info about partition
    22  type PublicGetPartitionStartOffsetRequest struct {
    23  	Topic       string
    24  	PartitionID int64
    25  
    26  	// ExampleOnly
    27  	PartitionSessionID int64
    28  }
    29  
    30  // PublicGetPartitionStartOffsetFunc callback function for optional manage read progress store at own side
    31  type PublicGetPartitionStartOffsetFunc func(
    32  	ctx context.Context,
    33  	req PublicGetPartitionStartOffsetRequest,
    34  ) (res PublicGetPartitionStartOffsetResponse, err error)