mocktikv

package
v0.0.0-...-13785af Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

Cluster represents a mock cluster in mock-tikv server.

func NewCluster

func NewCluster(mockServer string) (*Cluster, error)

NewCluster creates a mock cluster in mock-tikv server.

func (*Cluster) Close

func (c *Cluster) Close() error

Close releases the mock cluster.

func (*Cluster) ClusterID

func (c *Cluster) ClusterID() uint64

ClusterID returns the mock cluster's ID.

func (*Cluster) PDAddrs

func (c *Cluster) PDAddrs() []string

PDAddrs returns the mock cluster's PD addresses.

type MockCluster

type MockCluster struct {
	ID      uint64        `json:"id"`
	Members []*MockMember `json:"members"`
}

MockCluster contains the mock cluster info respond from mock-tikv. It should be kept synced with mock-tikv.

type MockMember

type MockMember struct {
	Name       string   `json:"name"`
	MemberID   uint64   `json:"member_id"`
	ClientUrls []string `json:"client_urls"`
}

MockMember contains the mock PD member respond from mock-tikv. It should be kept synced with mock-tikv.

Jump to

Keyboard shortcuts

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