mysqlmanager

package
v1.0.4-0...-d8282c0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MulanPSL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo-plugin-topology licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: Wangjunqi123 <wangjunqi@kylinos.cn> * Date: Mon Nov 4 14:30:13 2024 +0800

* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo-plugin-topology licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: Wangjunqi123 <wangjunqi@kylinos.cn> * Date: Mon Nov 4 14:30:13 2024 +0800

Index

Constants

View Source
const (
	FILTER_TYPE_HOST     = "host"
	FILTER_TYPE_PROCESS  = "process"
	FILTER_TYPE_RESOURCE = "resource"
	FILTER_TYPE_TAG      = "tag"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter_rule

type Filter_rule struct {
	Rule_type      string                 `json:"rule_type"`
	Rule_condition map[string]interface{} `json:"rule_condition"`
}

type MysqlClient

type MysqlClient struct {
	// contains filtered or unexported fields
}
var Global_Mysql *MysqlClient

func MysqldbInit

func MysqldbInit(conf *conf.MysqlConf) *MysqlClient

func (*MysqlClient) AddTopoConfiguration

func (m *MysqlClient) AddTopoConfiguration(tc *Topo_configuration_DB) (int, error)

func (*MysqlClient) DBToTopoConfiguration

func (m *MysqlClient) DBToTopoConfiguration(tcdb *Topo_configuration_DB) (*Topo_configuration, error)

func (*MysqlClient) DeleteTopoConfiguration

func (m *MysqlClient) DeleteTopoConfiguration(tcid uint) error

func (*MysqlClient) QuerySingleTopoConfiguration

func (m *MysqlClient) QuerySingleTopoConfiguration(tcid uint) (*Topo_configuration_DB, error)

func (*MysqlClient) QueryTopoConfigurationList

func (m *MysqlClient) QueryTopoConfigurationList(query *response.PaginationQ) ([]*Topo_configuration_DB, int, error)

func (*MysqlClient) TopoConfigurationToDB

func (m *MysqlClient) TopoConfigurationToDB(tc *Topo_configuration) (*Topo_configuration_DB, error)

type Tag_rule

type Tag_rule struct {
	Tag_name string          `json:"tag_name"`
	Target   string          `json:"target"`
	Rules    [][]Filter_rule `json:"rules"`
}

type Topo_configuration

type Topo_configuration struct {
	ID             uint                            `gorm:"primary_key;AUTO_INCREMENT" json:"id"`
	Name           string                          `gorm:"not null;type:varchar(200)" json:"conf_name"`
	Version        string                          `gorm:"not null;type:varchar(20)" json:"conf_version"`
	Description    string                          `gorm:"type:text" json:"description"`
	CreatedAt      string                          `gorm:"not null" json:"create_time"`
	UpdatedAt      string                          `gorm:"not null" json:"update_time"`
	Preserve       uint                            `gorm:"not null" json:"preserve"`
	BatchId        uint                            `gorm:"not null" json:"batchId"`
	NodeRules      [][]Filter_rule                 `gorm:"type:text" json:"node_rules"`
	TagRules       []Tag_rule                      `gorm:"type:text" json:"tag_rules"`
	NodeCoordinate []map[string]map[string]float32 `gorm:"type:text" json:"node_coordi"`
}

type Topo_configuration_DB

type Topo_configuration_DB struct {
	ID             uint   `gorm:"primary_key;AUTO_INCREMENT" json:"id"`
	Name           string `gorm:"not null;type:varchar(200)" json:"conf_name"`
	Version        string `gorm:"not null;type:varchar(20)" json:"conf_version"`
	Description    string `gorm:"type:text" json:"description"`
	CreatedAt      string `gorm:"not null" json:"create_time"`
	UpdatedAt      string `gorm:"not null" json:"update_time"`
	Preserve       uint   `gorm:"not null" json:"preserve"`
	BatchId        uint   `gorm:"not null" json:"batchId"`
	NodeRules      string `gorm:"type:text" json:"node_rules"`
	TagRules       string `gorm:"type:text" json:"tag_rules"`
	NodeCoordinate string `gorm:"type:text" json:"node_coordinate"`
}

Jump to

Keyboard shortcuts

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