Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
NewHandler create s a HTTP handler for API
Types ¶
type Cluster ¶
type Cluster struct { ID uint64 `json:"id"` Regions []*Region `json:"regions"` Stores []*Store `json:"stores"` Members []*Member `json:"members"` }
Cluster contains all information about a mock tikv cluster
type Member ¶
type Member struct { Name string `json:"name"` MemberID uint64 `json:"member_id"` ClientUrls []string `json:"client_urls"` }
Member contains information about a PD member
type Region ¶
type Region struct { ID uint64 `json:"id"` StartKey []byte `json:"-"` EndKey []byte `json:"-"` RegionEpoch *RegionEpoch `json:"region_epoch"` Peers []*Peer `json:"peers"` }
Region records region setup for api usage.
func (*Region) MarshalJSON ¶
MarshalJSON marshal Region to json using unified hex key format
func (*Region) UnmarshalJSON ¶
UnmarshalJSON unmarshal Region from json with unified hex key format
type RegionEpoch ¶
RegionEpoch records epoch data of a region
type Server ¶
type Server interface { GetCluster(id uint64) *Cluster GetClusters() []*Cluster DeleteCluster(id uint64) CreateCluster(cluster *Cluster) (*Cluster, error) GetClusterStore(clusterID, storeID uint64) (*Store, error) GetClusterStores(clusterID uint64) ([]*Store, error) GetStoreFailPoints(clusterID, storeID uint64) (map[string]interface{}, error) GetStoreFailPoint(clusterID, storeID uint64, failPoint string) (interface{}, error) UpdateStoreFailPoint(clusterID, storeID uint64, failPoint, value string) (interface{}, error) DeleteStoreFailPoint(clusterID, storeID uint64, failPoint string) (interface{}, error) }
Server defines public surface between internal implementation and api
type Store ¶
type Store struct { ID uint64 `json:"id"` Address string `json:"address"` State StoreState `json:"state"` Version string `json:"version"` }
Store contains information about a store
type StoreState ¶
type StoreState string
StoreState contains state about a store.
const ( // StoreStateUp store is up and running StoreStateUp StoreState = "Up" // StoreStateOffline store is offline StoreStateOffline StoreState = "Offline" // StoreStateTombstone store is set to tombstone state StoreStateTombstone StoreState = "Tombstone" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.