Documentation ¶
Overview ¶
nolint
Index ¶
- Variables
- func ExecuteCmdCreateStore(args *CreateCommandArgs, address string, port int32) (*pb.StoreCreateReply, error)
- func ExecuteCmdGet(args *GetArgs, address string, port int32) (*pb.GetReply, error)
- func ExecuteCmdListStore(address string, port int32) (*pb.ListStoreReply, error)
- func ExecuteCmdPut(args *PutArgs, address string, port int32) error
- func ExecuteCmdQuery(args *QueryArgs, address string, port int32) (*pb.ExecuteQueryReply, error)
- func ExecuteCmdSQLQuery(args *QueryArgs, address string, port int32) (*pb.QueryReply, error)
- func ExecuteCmdStatus(address string, port int32) (*pb.ClusterStatusReply, error)
- func GetLeader(address string, port int32) (*pb.Peer, error)
- type CreateCommandArgs
- type GetArgs
- type HTTPHandler
- type NewServerArgs
- type PutArgs
- type QueryArgs
- type Server
- type StatusArgs
Constants ¶
This section is empty.
Variables ¶
var ( //ErrorPeerAlreadyExists error if the peer with same name already exists ErrorPeerAlreadyExists = errors.New("peer with this name already exists in cluster") )
var ErrorStoreAlreadyExists = errors.New("store with this name already exists")
ErrorStoreAlreadyExists error if store with this name already exists
var ErrorStoreDoesExists = errors.New("store does not exists")
ErrorStoreDoesExists error if store does not exists
Functions ¶
func ExecuteCmdCreateStore ¶
func ExecuteCmdCreateStore(args *CreateCommandArgs, address string, port int32) (*pb.StoreCreateReply, error)
ExecuteCmdCreateStore helper function to executed create store command
func ExecuteCmdGet ¶
ExecuteCmdGet helper function to perform put command
func ExecuteCmdListStore ¶
func ExecuteCmdListStore(address string, port int32) (*pb.ListStoreReply, error)
ExecuteCmdListStore executes the list command for a store
func ExecuteCmdPut ¶
ExecuteCmdPut helper function to perform put command
func ExecuteCmdQuery ¶
ExecuteCmdQuery executes the query on the store
func ExecuteCmdSQLQuery ¶
ExecuteCmdSQLQuery executes the query on the store
func ExecuteCmdStatus ¶
func ExecuteCmdStatus(address string, port int32) (*pb.ClusterStatusReply, error)
ExecuteCmdStatus helper function to execute grpc call to get the status
Types ¶
type CreateCommandArgs ¶
CreateCommandArgs argument structure for this command
type HTTPHandler ¶
type HTTPHandler struct {
// contains filtered or unexported fields
}
HTTPHandler http handler
func NewHTTPHandler ¶
func NewHTTPHandler(srv Server) *HTTPHandler
NewHTTPHandler create object of the router
func (*HTTPHandler) Router ¶
func (h *HTTPHandler) Router() *gin.Engine
Router return the Gin router object
type NewServerArgs ¶
type NewServerArgs struct { Name string Address string Port int32 Loglevel string WalDir string IsTestMode bool HTTPPort int Controllers []string }
NewServerArgs argument structure for new server
type PutArgs ¶
type PutArgs struct { Key string `json:"key"` Value string `json:"value"` StoreName string `json:"storeName"` }
PutArgs argument structure for this command
type Server ¶
type Server interface { pb.YadosServiceServer Name() string Stop() error Address() string Port() int32 Peers() map[string]*pb.Peer Logger() *logrus.Logger SetLogLevel(level string) Serve() error RPCServer() rpc.Server Raft() raft.Raft Self() *pb.Peer State() raft.State WALDir() string WAL() wal.Wal HTTPPort() int StartHTTPServer() StopHTTPServer() error StoreManager() store.Manager Controller() []controller // EventHandler for test purpose EventHandler() *events.Events }
Server Server interface
func NewServer ¶
func NewServer(args *NewServerArgs) (Server, error)
NewServer creates new instance of a server
type StatusArgs ¶
StatusArgs arguments for status cluster