api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. *

Index

Constants

View Source
const (
	OperationAdd    = "add"
	OperationRemove = "remove"
)

Variables

This section is empty.

Functions

This section is empty.

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) Import

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

func (*ClusterHandler) List

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

func (*ClusterHandler) MigrateSlot

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

func (*ClusterHandler) Remove

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

type CreateClusterRequest

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

type CreateShardRequest

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

type Handler

type Handler struct {
	Namespace *NamespaceHandler
	Cluster   *ClusterHandler
	Shard     *ShardHandler
	Node      *NodeHandler
	Raft      *RaftHandler
}

func NewHandler

func NewHandler(s *store.ClusterStore) *Handler

type MemberRequest added in v1.1.0

type MemberRequest struct {
	ID        uint64 `json:"id" validate:"required,gt=0"`
	Operation string `json:"operation" validate:"required"`
	Peer      string `json:"peer,omitempty"`
}

type MigrateSlotRequest

type MigrateSlotRequest struct {
	Target   int  `json:"target" validate:"required"`
	Slot     int  `json:"slot" validate:"required"`
	SlotOnly bool `json:"slot_only"`
}

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 RaftHandler added in v1.1.0

type RaftHandler struct{}

func (*RaftHandler) ListPeers added in v1.1.0

func (handler *RaftHandler) ListPeers(c *gin.Context)

func (*RaftHandler) UpdatePeer added in v1.1.0

func (handler *RaftHandler) UpdatePeer(c *gin.Context)

type ShardHandler

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

func (*ShardHandler) Create

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

func (*ShardHandler) Failover

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) Remove

func (handler *ShardHandler) Remove(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