tikvapi

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

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"
)

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) 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)
}

TiKVClient provides tikv server's api

func NewTiKVClient

func NewTiKVClient(url string, timeout time.Duration, tlsConfig *tls.Config, disableKeepalive bool) TiKVClient

NewTiKVClient returns a new TiKVClient

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