db_info

package
v0.0.0-...-73f8a9c Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCluster

func AddCluster(cluster *OwlCluster) (int64, error)

func DelCluster

func DelCluster(id int64) error

func ListClusterName

func ListClusterName(userId uint, filter bool, cType string) ([]string, error)

func ListDB

func ListDB(clusterName string, userId uint, filter bool) ([]string, error)

return dbs and mapping cluster

func ListTable

func ListTable(clusterName, dbName string) ([]string, error)

func SetClusterDao

func SetClusterDao(impl ClusterDao)

func UpdateCluster

func UpdateCluster(cluster *OwlCluster) error

Types

type ClusterDao

type ClusterDao interface {
	AddCluster(db *gorm.DB, cluster *OwlCluster) (int64, error)
	UpdateCluster(db *gorm.DB, cluster *OwlCluster) error
	DelCluster(db *gorm.DB, id int64) error
	GetClusterByName(db *gorm.DB, clusterName string) (*OwlCluster, error)
	ListCluster(db *gorm.DB, pageInfo request.SortPageInfo) ([]OwlCluster, error)
	ListAllCluster(db *gorm.DB) ([]OwlCluster, error)
}

type DBInfoTool

type DBInfoTool struct {
}
var DBTool DBInfoTool

func (DBInfoTool) GetDBConn

func (DBInfoTool) GetDBConn(dbName, clusterName string) (*task.DBInfo, error)

type OwlCluster

type OwlCluster struct {
	ID          int64  `json:"id" gorm:"column:id"`
	Name        string `json:"name" gorm:"column:name"`
	Description string `json:"description" gorm:"column:description"`
	Addr        string `json:"addr" gorm:"column:addr"` //ip : port
	User        string `json:"user" gorm:"column:user"`
	Pwd         string `json:"pwd" gorm:"column:pwd"`
	CType       string `json:"c_type" gorm:"column:ctype"`

	Ct       int64  `json:"ct" gorm:"column:ct"`
	Ut       int64  `json:"ut" gorm:"column:ut"`
	Operator string `json:"operator" gorm:"column:operator"`
}

todo, list support type, backend and ui

func GetClusterByName

func GetClusterByName(name string) (*OwlCluster, error)

func ListCluster

func ListCluster(pageInfo request.SortPageInfo) ([]OwlCluster, error)

func ListClusterForUI

func ListClusterForUI(pageInfo request.SortPageInfo) ([]OwlCluster, error)

Jump to

Keyboard shortcuts

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