github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/topic/client.go (about)

     1  package topic
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/ydb-platform/ydb-go-sdk/v3/topic/topicoptions"
     7  	"github.com/ydb-platform/ydb-go-sdk/v3/topic/topicreader"
     8  	"github.com/ydb-platform/ydb-go-sdk/v3/topic/topictypes"
     9  	"github.com/ydb-platform/ydb-go-sdk/v3/topic/topicwriter"
    10  )
    11  
    12  // Client is interface for topic client
    13  // Attention: the interface may be extended in the future.
    14  type Client interface {
    15  	// Alter change topic options
    16  	Alter(ctx context.Context, path string, opts ...topicoptions.AlterOption) error
    17  
    18  	// Create topic
    19  	Create(ctx context.Context, path string, opts ...topicoptions.CreateOption) error
    20  
    21  	// Describe topic
    22  	Describe(ctx context.Context, path string, opts ...topicoptions.DescribeOption) (topictypes.TopicDescription, error)
    23  
    24  	// Drop topic
    25  	Drop(ctx context.Context, path string, opts ...topicoptions.DropOption) error
    26  
    27  	// StartReader start read messages from topic
    28  	// it is fast non block call, connection starts in background
    29  	StartReader(
    30  		consumer string,
    31  		readSelectors topicoptions.ReadSelectors,
    32  		opts ...topicoptions.ReaderOption,
    33  	) (*topicreader.Reader, error)
    34  
    35  	// StartWriter start write session to topic
    36  	// it is fast non block call, connection starts in background
    37  	StartWriter(topicPath string, opts ...topicoptions.WriterOption) (*topicwriter.Writer, error)
    38  }