client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BufferSize = 32 << 20
)

Variables

This section is empty.

Functions

func InitConnectionFactory

func InitConnectionFactory(
	rootOpts options.RootOptions,
	logger *zap.SugaredLogger,
	retryNumber int,
) error

func LogOperation

func LogOperation(logger *zap.SugaredLogger, op *Ydb_Operations.Operation)

func WrapWithRetries

func WrapWithRetries(
	maxAttempts int,
	f func() (*Ydb_Operations.Operation, error),
) (*Ydb_Operations.Operation, error)

Types

type Auth

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

func NewAuthClient

func NewAuthClient(logger *zap.SugaredLogger, f *Factory) *Auth

func (*Auth) Auth

func (c *Auth) Auth(grpcOpts options.GRPC, user, password string) (string, error)

func (*Auth) ExecuteAuthMethod

func (c *Auth) ExecuteAuthMethod(
	out proto.Message,
	method func(context.Context, Ydb_Auth_V1.AuthServiceClient) (OperationResponse, error),
	grpcOpts options.GRPC,
) (*Ydb_Operations.Operation, error)

type Cms

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

func GetCmsClient

func GetCmsClient() *Cms

func NewCMSClient

func NewCMSClient(f *Factory, logger *zap.SugaredLogger) *Cms

func (*Cms) CompleteAction

func (c *Cms) CompleteAction(actionIds []*Ydb_Maintenance.ActionUid) (*Ydb_Maintenance.ManageActionResult, error)

func (*Cms) CreateMaintenanceTask

func (c *Cms) CreateMaintenanceTask(params MaintenanceTaskParams) (MaintenanceTask, error)

func (*Cms) DropMaintenanceTask

func (c *Cms) DropMaintenanceTask(taskID string) (string, error)

func (*Cms) ExecuteCMSMethod

func (c *Cms) ExecuteCMSMethod(
	out proto.Message,
	method func(context.Context, Ydb_Cms_V1.CmsServiceClient) (OperationResponse, error),
) (*Ydb_Operations.Operation, error)

func (*Cms) GetMaintenanceTask

func (c *Cms) GetMaintenanceTask(taskID string) (MaintenanceTask, error)

func (*Cms) MaintenanceTasks

func (c *Cms) MaintenanceTasks(userSID string) ([]string, error)

func (*Cms) Nodes

func (c *Cms) Nodes() ([]*Ydb_Maintenance.Node, error)

func (*Cms) RefreshMaintenanceTask

func (c *Cms) RefreshMaintenanceTask(taskID string) (MaintenanceTask, error)

func (*Cms) Tenants

func (c *Cms) Tenants() ([]string, error)

type Discovery

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

func GetDiscoveryClient

func GetDiscoveryClient() *Discovery

func NewDiscoveryClient

func NewDiscoveryClient(f *Factory, logger *zap.SugaredLogger) *Discovery

func (*Discovery) ListEndpoints

func (c *Discovery) ListEndpoints(database string) ([]*Ydb_Discovery.EndpointInfo, error)

func (*Discovery) WhoAmI

func (c *Discovery) WhoAmI() (string, error)

type Factory

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

func (*Factory) Connection

func (f *Factory) Connection() (*grpc.ClientConn, error)

func (*Factory) ContextWithAuth

func (f *Factory) ContextWithAuth() (context.Context, context.CancelFunc, error)

func (*Factory) ContextWithoutAuth

func (f *Factory) ContextWithoutAuth() (context.Context, context.CancelFunc)

func (*Factory) GetRetryNumber

func (f *Factory) GetRetryNumber() int

func (*Factory) OperationParams

func (f *Factory) OperationParams() *Ydb_Operations.OperationParams

type MaintenanceTask

type MaintenanceTask interface {
	GetRetryAfter() *timestamppb.Timestamp
	GetActionGroupStates() []*Ydb_Maintenance.ActionGroupStates
	GetTaskUid() string
}

type MaintenanceTaskParams

type MaintenanceTaskParams struct {
	TaskUID          string
	AvailabilityMode Ydb_Maintenance.AvailabilityMode
	Duration         *durationpb.Duration
	Nodes            []*Ydb_Maintenance.Node
}

type OperationResponse

type OperationResponse interface {
	GetOperation() *Ydb_Operations.Operation
}

Jump to

Keyboard shortcuts

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