Documentation ¶
Index ¶
- Variables
- func Param(ctx context.Context, p string) string
- type API
- type AddMemberRequest
- type CreateClusterRequest
- type DropTableRequest
- type EtcdAPI
- type ForwardClient
- type GetShardTablesRequest
- type MoveLeaderRequest
- type NodeShardsRequest
- type PromoteLearnerRequest
- type RemoveMemberRequest
- type RouteRequest
- type Router
- func (r *Router) Del(path string, h http.HandlerFunc)
- func (r *Router) Get(path string, h http.HandlerFunc)
- func (r *Router) Head(path string, h http.HandlerFunc)
- func (r *Router) Options(path string, h http.HandlerFunc)
- func (r *Router) Post(path string, h http.HandlerFunc)
- func (r *Router) Put(path string, h http.HandlerFunc)
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) WithInstrumentation(instrh func(handlerName string, handler http.HandlerFunc) http.HandlerFunc) *Router
- func (r *Router) WithPrefix(prefix string) *Router
- type Service
- type SplitRequest
- type TransferLeaderRequest
- type UpdateClusterRequest
- type UpdateFlowLimiterRequest
- type UpdateMemberRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrParseRequest = coderr.NewCodeError(coderr.BadRequest, "parse request params") ErrDropTable = coderr.NewCodeError(coderr.Internal, "drop table") ErrRouteTable = coderr.NewCodeError(coderr.Internal, "route table") ErrGetNodeShards = coderr.NewCodeError(coderr.Internal, "get node shards") ErrCreateProcedure = coderr.NewCodeError(coderr.Internal, "create procedure") ErrSubmitProcedure = coderr.NewCodeError(coderr.Internal, "submit procedure") ErrGetCluster = coderr.NewCodeError(coderr.Internal, "get cluster") ErrAllocShardID = coderr.NewCodeError(coderr.Internal, "alloc shard id") ErrForwardToLeader = coderr.NewCodeError(coderr.Internal, "forward to leader") ErrParseLeaderAddr = coderr.NewCodeError(coderr.Internal, "parse leader addr") ErrHealthCheck = coderr.NewCodeError(coderr.Internal, "server health check") ErrParseTopology = coderr.NewCodeError(coderr.Internal, "parse topology type") ErrUpdateFlowLimiter = coderr.NewCodeError(coderr.Internal, "update flow limiter") ErrAddLearner = coderr.NewCodeError(coderr.Internal, "add member as learner") ErrListMembers = coderr.NewCodeError(coderr.Internal, "get member list") ErrRemoveMembers = coderr.NewCodeError(coderr.Internal, "remove member") ErrGetMember = coderr.NewCodeError(coderr.Internal, "get member") )
Functions ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func NewAPI ¶
func NewAPI(clusterManager cluster.Manager, serverStatus *status.ServerStatus, forwardClient *ForwardClient, flowLimiter *limiter.FlowLimiter, etcdClient *clientv3.Client) *API
func (*API) NewAPIRouter ¶
type AddMemberRequest ¶ added in v1.2.5
type AddMemberRequest struct {
MemberAddrs []string `json:"memberAddrs"`
}
type CreateClusterRequest ¶ added in v1.2.1
type DropTableRequest ¶
type EtcdAPI ¶ added in v1.2.5
type EtcdAPI struct {
// contains filtered or unexported fields
}
func NewEtcdAPI ¶ added in v1.2.5
func NewEtcdAPI(etcdClient *clientv3.Client, forwardClient *ForwardClient) EtcdAPI
type ForwardClient ¶
type ForwardClient struct {
// contains filtered or unexported fields
}
func NewForwardClient ¶
func NewForwardClient(member *member.Member, port int) *ForwardClient
func (*ForwardClient) GetLeaderAddr ¶ added in v1.2.4
func (s *ForwardClient) GetLeaderAddr(ctx context.Context) (string, error)
type GetShardTablesRequest ¶ added in v1.2.4
type MoveLeaderRequest ¶ added in v1.2.5
type MoveLeaderRequest struct {
MemberName string `json:"memberName"`
}
type NodeShardsRequest ¶
type NodeShardsRequest struct {
ClusterName string `json:"clusterName"`
}
type PromoteLearnerRequest ¶ added in v1.2.5
type PromoteLearnerRequest struct {
LearnerName string `json:"learnerName"`
}
type RemoveMemberRequest ¶ added in v1.2.5
type RemoveMemberRequest struct {
MemberName string `json:"memberName"`
}
type RouteRequest ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router wraps httprouter.Router and adds support for prefixed sub-routers, per-request context injections and instrumentation.
func (*Router) Del ¶
func (r *Router) Del(path string, h http.HandlerFunc)
Del registers a new DELETE route.
func (*Router) Get ¶
func (r *Router) Get(path string, h http.HandlerFunc)
Get registers a new GET route.
func (*Router) Head ¶
func (r *Router) Head(path string, h http.HandlerFunc)
Head registers a new HEAD route.
func (*Router) Options ¶
func (r *Router) Options(path string, h http.HandlerFunc)
Options registers a new OPTIONS route.
func (*Router) Post ¶
func (r *Router) Post(path string, h http.HandlerFunc)
Post registers a new POST route.
func (*Router) Put ¶
func (r *Router) Put(path string, h http.HandlerFunc)
Put registers a new PUT route.
func (*Router) ServeHTTP ¶
func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP implements http.Handler.
func (*Router) WithInstrumentation ¶
func (r *Router) WithInstrumentation(instrh func(handlerName string, handler http.HandlerFunc) http.HandlerFunc) *Router
WithInstrumentation returns a router with instrumentation support.
func (*Router) WithPrefix ¶
WithPrefix returns a router that prefixes all registered routes with prefix.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is wrapper for http.Server
func NewHTTPService ¶
type SplitRequest ¶
type TransferLeaderRequest ¶
type UpdateClusterRequest ¶ added in v1.2.1
type UpdateFlowLimiterRequest ¶ added in v1.2.1
type UpdateMemberRequest ¶ added in v1.2.5
Click to show internal directories.
Click to hide internal directories.