server

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectMetrics

func CollectMetrics(c *gin.Context)

func Leader

func Leader(c *gin.Context)

func LeaderResign

func LeaderResign(c *gin.Context)

func PProf

func PProf(c *gin.Context)

func RedirectIfNotLeader

func RedirectIfNotLeader(c *gin.Context)

Types

type ClusterHandler

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

func (*ClusterHandler) Create

func (handler *ClusterHandler) Create(c *gin.Context)

func (*ClusterHandler) Get

func (handler *ClusterHandler) Get(c *gin.Context)

func (*ClusterHandler) GetFailOverTasks

func (handler *ClusterHandler) GetFailOverTasks(c *gin.Context)

func (*ClusterHandler) List

func (handler *ClusterHandler) List(c *gin.Context)

func (*ClusterHandler) Remove

func (handler *ClusterHandler) Remove(c *gin.Context)

type CreateClusterRequest

type CreateClusterRequest struct {
	Name     string   `json:"name"`
	Nodes    []string `json:"nodes"`
	Password string   `json:"password"`
	Replicas int      `json:"replicas"`
}

type CreateShardRequest

type CreateShardRequest struct {
	Master *metadata.NodeInfo  `json:"master"`
	Slaves []metadata.NodeInfo `json:"slaves"`
}

type Error

type Error struct {
	Message string `json:"message"`
}

type MigrateSlotDataRequest

type MigrateSlotDataRequest struct {
	Source int `json:"source" validate:"required"`
	Target int `json:"target" validate:"required"`
	Slot   int `json:"slot"`
}

type MigrateSlotOnlyRequest

type MigrateSlotOnlyRequest struct {
	Source int                  `json:"source" validate:"required"`
	Target int                  `json:"target" validate:"required"`
	Slots  []metadata.SlotRange `json:"slots"`
}

type NamespaceHandler

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

func (*NamespaceHandler) Create

func (handler *NamespaceHandler) Create(c *gin.Context)

func (*NamespaceHandler) Exists

func (handler *NamespaceHandler) Exists(c *gin.Context)

func (*NamespaceHandler) List

func (handler *NamespaceHandler) List(c *gin.Context)

func (*NamespaceHandler) Remove

func (handler *NamespaceHandler) Remove(c *gin.Context)

type NodeHandler

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

func (*NodeHandler) Create

func (handler *NodeHandler) Create(c *gin.Context)

func (*NodeHandler) List

func (handler *NodeHandler) List(c *gin.Context)

func (*NodeHandler) Remove

func (handler *NodeHandler) Remove(c *gin.Context)

type Response

type Response struct {
	Error *Error      `json:"error,omitempty"`
	Data  interface{} `json:"data"`
}

type Server

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

func NewServer

func NewServer(cfg *config.Config) (*Server, error)

func (*Server) Start

func (srv *Server) Start() error

func (*Server) Stop

func (srv *Server) Stop() error

type ShardHandler

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

func (*ShardHandler) Create

func (handler *ShardHandler) Create(c *gin.Context)

func (*ShardHandler) Failover added in v0.2.0

func (handler *ShardHandler) Failover(c *gin.Context)

func (*ShardHandler) Get

func (handler *ShardHandler) Get(c *gin.Context)

func (*ShardHandler) List

func (handler *ShardHandler) List(c *gin.Context)

func (*ShardHandler) MigrateSlotData

func (handler *ShardHandler) MigrateSlotData(c *gin.Context)

func (*ShardHandler) MigrateSlotOnly

func (handler *ShardHandler) MigrateSlotOnly(c *gin.Context)

func (*ShardHandler) Remove

func (handler *ShardHandler) Remove(c *gin.Context)

func (*ShardHandler) UpdateSlots

func (handler *ShardHandler) UpdateSlots(c *gin.Context)

type SlotsRequest

type SlotsRequest struct {
	Slots []string `json:"slots" validate:"required"`
}

Jump to

Keyboard shortcuts

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