web

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2016 The kingshard Authors. All rights reserved.

Licensed 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiServer

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

func NewApiServer

func NewApiServer(cfg *config.Config, srv *server.Server) (*ApiServer, error)

func (*ApiServer) AddAllowIps

func (s *ApiServer) AddAllowIps(c echo.Context) error

add one or multi ips

func (*ApiServer) AddOneBlackSQL

func (s *ApiServer) AddOneBlackSQL(c echo.Context) error

func (*ApiServer) AddOneSlave

func (s *ApiServer) AddOneSlave(c echo.Context) error

func (*ApiServer) ChangeMasterStatus

func (s *ApiServer) ChangeMasterStatus(c echo.Context) error

func (*ApiServer) ChangeProxyStatus

func (s *ApiServer) ChangeProxyStatus(c echo.Context) error

func (*ApiServer) ChangeSlaveStatus

func (s *ApiServer) ChangeSlaveStatus(c echo.Context) error

func (*ApiServer) CheckAuth

func (s *ApiServer) CheckAuth(username, password string, ctx echo.Context) (bool, error)

func (*ApiServer) DelAllowIps

func (s *ApiServer) DelAllowIps(c echo.Context) error

delete one or multi ips

func (*ApiServer) DelOneBlackSQL

func (s *ApiServer) DelOneBlackSQL(c echo.Context) error

func (*ApiServer) DeleteOneSlave

func (s *ApiServer) DeleteOneSlave(c echo.Context) error

func (*ApiServer) GetAllBlackSQL

func (s *ApiServer) GetAllBlackSQL(c echo.Context) error

func (*ApiServer) GetAllowIps

func (s *ApiServer) GetAllowIps(c echo.Context) error

func (*ApiServer) GetNodesStatus

func (s *ApiServer) GetNodesStatus(c echo.Context) error

get nodes status

func (*ApiServer) GetProxySchema

func (s *ApiServer) GetProxySchema(c echo.Context) error

func (*ApiServer) GetProxyStatus

func (s *ApiServer) GetProxyStatus(c echo.Context) error

func (*ApiServer) GetSlowLogTime

func (s *ApiServer) GetSlowLogTime(c echo.Context) error

func (*ApiServer) RegisterMiddleware

func (s *ApiServer) RegisterMiddleware()

func (*ApiServer) RegisterURL

func (s *ApiServer) RegisterURL()

func (*ApiServer) Run

func (s *ApiServer) Run() error

func (*ApiServer) SaveProxyConfig

func (s *ApiServer) SaveProxyConfig(c echo.Context) error

func (*ApiServer) SetSlowLogTime

func (s *ApiServer) SetSlowLogTime(c echo.Context) error

func (*ApiServer) SwitchSlowSQL

func (s *ApiServer) SwitchSlowSQL(c echo.Context) error

type DBStatus

type DBStatus struct {
	Node          string `json:"node"`
	Address       string `json:"address"`
	Type          string `json:"type"`
	Status        string `json:"status"`
	LastPing      string `json:"laste_ping"`
	MaxConn       int    `json:"max_conn"`
	IdleConn      int    `json:"idle_conn"`
	CacheConn     int    `json:"cache_conn"`
	PushConnCount int64  `json:"push_conn_count"`
	PopConnCount  int64  `json:"pop_conn_count"`
}

type ShardConfig

type ShardConfig struct {
	User          string   `json:"user"`
	DB            string   `json:"db"`
	Table         string   `yaml:"table"`
	Key           string   `yaml:"key"`
	Nodes         []string `yaml:"nodes"`
	Locations     []int    `yaml:"locations"`
	Type          string   `yaml:"type"`
	TableRowLimit int      `yaml:"table_row_limit"`
	DateRange     []string `yaml:"date_range"`
}

range,hash or date

Jump to

Keyboard shortcuts

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