tikvapi

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = 5 * time.Second
)

Variables

This section is empty.

Functions

func TiKVGRPCClientURL added in v1.6.2

func TiKVGRPCClientURL(namespace, clusterName, podName, scheme, clusterDomain string) string

TiKVGRPCURL builds the url of tikv grpc client

func TiKVPodClientURL

func TiKVPodClientURL(namespace, clusterName, podName, scheme, clusterDomain string) string

TiKVPodClientURL builds the url of tikv pod client

Types

type Action

type Action struct {
	ID     uint64
	Name   string
	Labels map[string]string
}

type ActionType

type ActionType string
const (
	GetLeaderCountActionType      ActionType = "GetLeaderCount"
	FlushLogBackupTasksActionType ActionType = "FlushLogBackupTasks"
)

type FakeTiKVClient

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

FakeTiKVClient implements a fake version of TiKVClient.

func NewFakeTiKVClient

func NewFakeTiKVClient() *FakeTiKVClient

func (*FakeTiKVClient) AddReaction

func (c *FakeTiKVClient) AddReaction(actionType ActionType, reaction Reaction)

func (*FakeTiKVClient) FlushLogBackupTasks added in v1.6.2

func (c *FakeTiKVClient) FlushLogBackupTasks(ctx context.Context) error

FlushLogBackupTasks implements TiKVClient.

func (*FakeTiKVClient) GetLeaderCount

func (c *FakeTiKVClient) GetLeaderCount() (int, error)

type FakeTiKVControl

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

FakeTiKVControl implements a fake version of TiKVControlInterface.

func NewFakeTiKVControl

func NewFakeTiKVControl(secretLister corelisterv1.SecretLister) *FakeTiKVControl

func (*FakeTiKVControl) GetTiKVPodClient

func (ftc *FakeTiKVControl) GetTiKVPodClient(namespace, tcName, podName, clusterDomain string, tlsEnabled bool) TiKVClient

func (*FakeTiKVControl) SetTiKVPodClient

func (ftc *FakeTiKVControl) SetTiKVPodClient(namespace, tcName, podName string, tikvPodClient TiKVClient)

type NotFoundReaction

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

func (*NotFoundReaction) Error

func (nfr *NotFoundReaction) Error() string

type Reaction

type Reaction func(action *Action) (interface{}, error)

type TiKVClient

type TiKVClient interface {
	GetLeaderCount() (int, error)
	FlushLogBackupTasks(ctx context.Context) error
}

TiKVClient provides tikv server's api

func NewTiKVClient

func NewTiKVClient(opts TiKVClientOpts) TiKVClient

NewTiKVClient returns a new TiKVClient

type TiKVClientOpts added in v1.6.2

type TiKVClientOpts struct {
	HTTPEndpoint      string
	GRPCEndpoint      string
	Timeout           time.Duration
	TLSConfig         *tls.Config
	DisableKeepAlives bool
}

type TiKVControlInterface

type TiKVControlInterface interface {
	// GetTiKVPodClient provides TiKVClient of the TiKV cluster.
	GetTiKVPodClient(namespace string, tcName string, podName, clusterDomain string, tlsEnabled bool) TiKVClient
}

TiKVControlInterface is an interface that knows how to manage and get client for TiKV

func NewDefaultTiKVControl

func NewDefaultTiKVControl(secretLister corelisterv1.SecretLister) TiKVControlInterface

NewDefaultTiKVControl returns a defaultTiKVControl instance

Jump to

Keyboard shortcuts

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