http_reply

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenSign

func GenSign(clusterId uint64, d int64, token string) string

func SendReply

func SendReply(w http.ResponseWriter, rep *Reply)

func VerifySign

func VerifySign(clusterId uint64, d, token, s string) bool

Types

type Peer

type Peer struct {
	Id   uint64       `json:"id,omitempty"`
	Node *metapb.Node `json:"node,omitempty"`
}

type PeerBrief

type PeerBrief struct {
	Id          uint64 `json:"id,omitempty"`
	Index       uint64 `json:"index,omitempty"`
	Term        uint64 `json:"term,omitempty"`
	Commit      uint64 `json:"commit,omitempty"`
	StartKey    string `json:"start_key,omitempty"`
	EndKey      string `json:"end_key,omitempty"`
	NodeId      uint64 `json:"node_id,omitempty"`
	NodeAddress string `json:"node_address,omitempty"`
	NodeState   int32  `json:"node_state,omitempty"`
}

type PeerBriefReply

type PeerBriefReply struct {
	Code    int          `json:"code"`
	Message string       `json:"message"`
	Data    []*PeerBrief `json:"data"`
}

type PeerInfo

type PeerInfo struct {
	Id uint64 `json:"id,omitempty"`
	// Range key range [start_key, end_key).
	StartKey   []byte             `json:"start_key,omitempty"`
	EndKey     []byte             `json:"end_key,omitempty"`
	RangeEpoch *metapb.RangeEpoch `json:"range_epoch,omitempty"`
	Peer       *Peer              `json:"peers,omitempty"`
	// Range state
	State string `json:"state,omitempty"`
}

type PeerInfoReply

type PeerInfoReply struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    []*PeerInfo `json:"data"`
}

type Range

type Range struct {
	Id         uint64             `json:"id,omitempty"`
	StartKey   []byte             `json:"start_key,omitempty"`
	EndKey     []byte             `json:"end_key,omitempty"`
	RangeEpoch *metapb.RangeEpoch `json:"range_epoch,omitempty"`
	Peers      []*Peer            `json:"peers,omitempty"`
}

type RangeBrief

type RangeBrief struct {
	Id         uint64   `json:"id,omitempty"`
	StartKey   string   `json:"start_key,omitempty"`
	EndKey     string   `json:"end_key,omitempty"`
	State      int32    `json:"state,omitempty"`
	LastHbTime string   `json:"last_hb_time,omitempty"`
	DownPeers  []uint64 `json:"down_peers,omitempty"`
	Peers      []uint64 `json:"peers,omitempty"`
	Leader     uint64   `json:"leader,omitempty"`
}

type RangeBriefReply

type RangeBriefReply struct {
	Code    int           `json:"code"`
	Message string        `json:"message"`
	Data    []*RangeBrief `json:"data"`
}

type RangeLocateRequest

type RangeLocateRequest struct {
	DbName    string `json:"db_name"`
	TableName string `json:"table_name"`
}

func GetRangeLocateRequest

func GetRangeLocateRequest(r *http.Request) (*RangeLocateRequest, error)

type RangeLocateResponse

type RangeLocateResponse struct {
	Routes []*Route `json:"routes"`
}

type RangeStatHeap

type RangeStatHeap []RangeStatsInfo

func (RangeStatHeap) Len

func (h RangeStatHeap) Len() int

func (RangeStatHeap) Less

func (h RangeStatHeap) Less(i, j int) bool

func (*RangeStatHeap) Pop

func (h *RangeStatHeap) Pop() interface{}

func (*RangeStatHeap) Push

func (h *RangeStatHeap) Push(x interface{})

func (RangeStatHeap) Swap

func (h RangeStatHeap) Swap(i, j int)

type RangeStatsInfo

type RangeStatsInfo struct {
	RangeId         uint64 `json:"range_id,omitempty"`
	LeaderId        uint64 `json:"leader_id,omitempty"`
	TableId         uint64 `json:"table_id,omitempty"`
	NodeAddr        string `json:"node_addr,omitempty"`
	BytesWritten    uint64 `json:"bytes_written,omitempty"`
	BytesRead       uint64 `json:"bytes_read,omitempty"`
	KeysWritten     uint64 `json:"keys_written,omitempty"`
	KeysRead        uint64 `json:"keys_read,omitempty"`
	ApproximateSize uint64 `json:"approximate_size,omitempty"`
	WriteOps        uint64 `json:"write_ops,omitempty"`
}

type Reply

type Reply struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

func GetResponse

func GetResponse(resp *http.Response) (*Reply, error)

type Route

type Route struct {
	Range  *Range   `json:"range,omitempty"`
	Leader *Peer    `json:"leader,omitempty"`
	Downs  []uint64 `json:"downs"`
	Pends  []uint64 `json:"pends"`
}

type Task

type Task struct {
	Id       uint64 `json:"id"`
	Type     string `json:"type"`
	RangeId  uint64 `json:"range_id"`
	Describe string `json:"describe"`
	State    string `json:"state"`
}

type TaskResponse

type TaskResponse []*Task

Jump to

Keyboard shortcuts

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