tiflashapi

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func TiFlashPodClientURL

func TiFlashPodClientURL(namespace, clusterName, podName, scheme string) string

TiFlashPodClientURL builds the url of tiflash pod client

Types

type Action

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

type ActionType

type ActionType string
const (
	GetStoreStatusActionType ActionType = "GetStoreStatus"
)

type FakeTiFlashClient

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

FakeTiFlashClient implements a fake version of TiFlashClient.

func NewFakeTiFlashClient

func NewFakeTiFlashClient() *FakeTiFlashClient

func (*FakeTiFlashClient) AddReaction

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

func (*FakeTiFlashClient) GetStoreStatus

func (c *FakeTiFlashClient) GetStoreStatus() (Status, error)

type FakeTiFlashControl

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

FakeTiFlashControl implements a fake version of TiFlashControlInterface.

func NewFakeTiFlashControl

func NewFakeTiFlashControl(secretLister corelisterv1.SecretLister) *FakeTiFlashControl

func (*FakeTiFlashControl) GetTiFlashPodClient

func (ftc *FakeTiFlashControl) GetTiFlashPodClient(namespace, tcName, podName string, tlsEnabled bool) TiFlashClient

func (*FakeTiFlashControl) SetTiFlashPodClient

func (ftc *FakeTiFlashControl) SetTiFlashPodClient(namespace, tcName, podName string, tiflashPodClient TiFlashClient)

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 Status

type Status string
const (
	Idle       Status = "Idle"
	Ready      Status = "Ready"
	Running    Status = "Running"
	Stopping   Status = "Stopping"
	Terminated Status = "Terminated"
)

type TiFlashClient

type TiFlashClient interface {
	GetStoreStatus() (Status, error)
}

func NewTiFlashClient

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

NewTiFlashClient returns a new TiFlashClient

type TiFlashControlInterface

type TiFlashControlInterface interface {
	// GetTiFlashPodClient provides TiFlashClient of the TiFlash cluster.
	GetTiFlashPodClient(namespace string, tcName string, podName string, tlsEnabled bool) TiFlashClient
}

TiFlashControlInterface is an interface that knows how to manage and get client for TiFlash

func NewDefaultTiFlashControl

func NewDefaultTiFlashControl(secretLister corelisterv1.SecretLister) TiFlashControlInterface

NewDefaultTiFlashControl returns a defaultTiFlashControl instance

Jump to

Keyboard shortcuts

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