Documentation
¶
Index ¶
- func APICheck(ip string) bool
- func CalculateArea(jsonData *geojson.Feature) float64
- func CalculateAreaByStr(jsonDataStr string) float64
- func CalculateGeodesicArea(jsonData *geojson.Feature) float64
- func CamelCaseToUnderscore(str string) string
- func CamelCaseToUnderscore2(str string) string
- func ConvertGeoJSONToDXF(featureCollection geojson.FeatureCollection, outputFilename string)
- func ConvertToInitials(hanzi string) string
- func DLMCReplace(tablename string) string
- func DataSearch(query *gorm.DB, jsonData map[string]interface{}) []models.TempLayHeader
- func DecryptStr(encryptedB64Str string, key string) string
- func DeleteFiles(dirPath string)
- func DirectoryExists(dirPath string, folderName string) bool
- func EncryptStr(text string, key string) string
- func FindShpFile(dir string, ex string) *string
- func GeoIntersectLine(jsonData geojson.FeatureCollection, tablename string, attributes []string, ...) []map[string]interface{}
- func GeoJsonToWKB(geo geojson.Feature) string
- func GetAllFiles(path string) ([]string, error)
- func GetFieldName(i interface{}) []string
- func GetIP(net string) []string
- func GetIntersectGeo(jsonData geojson.FeatureCollection, tablename string, atts string) geojson.FeatureCollection
- func GetMaxItem(text []Result) string
- func GetVolume(data []map[string]interface{}) []map[string]interface{}
- func IsStringInSlice(s string, slice []string) bool
- func LowerJSONTransform(xmList interface{}) interface{}
- func MakeGeoJSON2(items []map[string]interface{}) interface{}
- func MakeTileIndex(DB *gorm.DB)
- func Md5Str(data string) string
- func MergeMaps(map1, map2 map[string]interface{}) map[string]interface{}
- func OpenURL(url string) error
- func RemoveKeyFromMapArray(input []map[string]interface{}, key string) []map[string]interface{}
- func ReplaceInJSFiles(dir string, oldValue string, newValue string) error
- func RestoreData(backupPath string)
- func SavaGeojsonToDb(db *gorm.DB, jsonData geojson.FeatureCollection, table interface{})
- func SavaGeojsonToTable(db *gorm.DB, jsonData geojson.FeatureCollection, tablename string)
- func SortSchema(TableSchema []models.MySchema) []models.MySchema
- func TempDataSearch(query *gorm.DB, jsonData map[string]interface{}) []models.TempGeo
- func ToStringSlice(args []interface{}) []string
- func Unzip(src string) error
- func UnzipRar(src string) error
- func UnzipZip(src string) error
- func UpdateGeojsonToTable(db *gorm.DB, jsonData geojson.FeatureCollection, tablename string, id int32)
- func ZipFileOut(folderPath string) ([]byte, error)
- func ZipFolder(folderPath string, name string) error
- func ZipFolderTo(folderPath string, outpath string) error
- type Att
- type BackupConfig
- type BackupInfo
- type BackupStatistics
- type ColumnInfo
- type FieldService
- func (fs *FieldService) AddField(tableName, fieldName, fieldType string, length int, ...) error
- func (fs *FieldService) CheckFieldExists(tableName, fieldName string) bool
- func (fs *FieldService) CheckTableExists(tableName string) bool
- func (fs *FieldService) DeleteField(tableName, fieldName string) error
- func (fs *FieldService) GetSingleFieldInfo(tableName, fieldName string) (*models.FieldInfo, error)
- func (fs *FieldService) GetTableList() ([]string, error)
- func (fs *FieldService) GetTableStructure(tableName string) (*models.TableStructure, error)
- func (fs *FieldService) ModifyField(tableName, oldFieldName, newFieldName, fieldType string, length int, ...) error
- type Res
- type RestoreConfig
- type RestoreResult
- type Result
- type SQLBackupManager
- type SQLRestoreManager
- type TableInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateArea ¶
func CalculateAreaByStr ¶
func CalculateGeodesicArea ¶
func CamelCaseToUnderscore ¶
func CamelCaseToUnderscore2 ¶
func ConvertGeoJSONToDXF ¶
func ConvertGeoJSONToDXF(featureCollection geojson.FeatureCollection, outputFilename string)
func ConvertToInitials ¶
ConvertToInitials 将中文字符串转换为拼音首字母拼接字符串
func DLMCReplace ¶
func DataSearch ¶
func DataSearch(query *gorm.DB, jsonData map[string]interface{}) []models.TempLayHeader
func DecryptStr ¶
func DirectoryExists ¶
func EncryptStr ¶
func FindShpFile ¶
func GeoIntersectLine ¶
func GeoJsonToWKB ¶
func GetAllFiles ¶
func GetFieldName ¶
func GetFieldName(i interface{}) []string
func GetIntersectGeo ¶
func GetIntersectGeo(jsonData geojson.FeatureCollection, tablename string, atts string) geojson.FeatureCollection
func GetMaxItem ¶
func IsStringInSlice ¶
func LowerJSONTransform ¶
func LowerJSONTransform(xmList interface{}) interface{}
func MakeGeoJSON2 ¶
func MakeGeoJSON2(items []map[string]interface{}) interface{}
func RemoveKeyFromMapArray ¶
func RestoreData ¶
func RestoreData(backupPath string)
func SavaGeojsonToDb ¶
func SavaGeojsonToDb(db *gorm.DB, jsonData geojson.FeatureCollection, table interface{})
func SavaGeojsonToTable ¶
func SavaGeojsonToTable(db *gorm.DB, jsonData geojson.FeatureCollection, tablename string)
func TempDataSearch ¶
func ToStringSlice ¶
func ToStringSlice(args []interface{}) []string
func UpdateGeojsonToTable ¶
func ZipFileOut ¶
func ZipFolderTo ¶
Types ¶
type BackupConfig ¶
type BackupConfig struct { Host string Port string User string Password string Database string BackupDir string RetentionDays int Compress bool }
BackupConfig 备份配置结构
type BackupInfo ¶
BackupInfo 备份信息结构
type BackupStatistics ¶
type BackupStatistics struct { TotalBackups int `json:"total_backups"` ValidBackups int `json:"valid_backups"` ExpiredBackups int `json:"expired_backups"` TotalSize int64 `json:"total_size"` ValidSize int64 `json:"valid_size"` ExpiredSize int64 `json:"expired_size"` RetentionDays int `json:"retention_days"` OldestBackup time.Time `json:"oldest_backup"` NewestBackup time.Time `json:"newest_backup"` }
BackupStatistics 备份统计信息
type ColumnInfo ¶
type ColumnInfo struct { ColumnName string `gorm:"column:column_name"` DataType string `gorm:"column:data_type"` IsNullable string `gorm:"column:is_nullable"` ColumnDefault string `gorm:"column:column_default"` CharMaxLength int `gorm:"column:character_maximum_length"` }
ColumnInfo 列信息结构
type FieldService ¶
type FieldService struct{}
func NewFieldService ¶
func NewFieldService() *FieldService
func (*FieldService) AddField ¶
func (fs *FieldService) AddField(tableName, fieldName, fieldType string, length int, defaultValue, comment string, isNullable bool) error
AddField 添加字段
func (*FieldService) CheckFieldExists ¶
func (fs *FieldService) CheckFieldExists(tableName, fieldName string) bool
CheckFieldExists 检查字段是否存在
func (*FieldService) CheckTableExists ¶
func (fs *FieldService) CheckTableExists(tableName string) bool
CheckTableExists 检查表是否存在
func (*FieldService) DeleteField ¶
func (fs *FieldService) DeleteField(tableName, fieldName string) error
DeleteField 删除字段
func (*FieldService) GetSingleFieldInfo ¶
func (fs *FieldService) GetSingleFieldInfo(tableName, fieldName string) (*models.FieldInfo, error)
GetSingleFieldInfo 获取单个字段信息
func (*FieldService) GetTableList ¶
func (fs *FieldService) GetTableList() ([]string, error)
GetTableList 获取数据库中所有表的列表
func (*FieldService) GetTableStructure ¶
func (fs *FieldService) GetTableStructure(tableName string) (*models.TableStructure, error)
GetTableStructure 获取表结构信息
func (*FieldService) ModifyField ¶
func (fs *FieldService) ModifyField(tableName, oldFieldName, newFieldName, fieldType string, length int, defaultValue, comment string, isNullable bool) error
ModifyField 修改字段
type RestoreConfig ¶
type RestoreConfig struct { Host string Port string User string Password string Database string BackupPath string DropExisting bool // 是否删除现有数据 RestoreData bool // 是否恢复数据 Verbose bool // 详细日志 }
RestoreConfig 恢复配置结构
type RestoreResult ¶
type RestoreResult struct { Success bool TablesCreated int DataRestored int IndexesCreated int ViewsCreated int FunctionsCreated int Errors []string Duration time.Duration }
RestoreResult 恢复结果
type Result ¶
type Result struct { Area float64 // 假设 area 指的是一个面积,使用 float64 类型来接收 Dlmc string // 假设 dlmc 是一个字符串 AttributeName string // 额外的动态字段名,仅在程序内部使用 }
func GeoIntersect ¶
func GeoIntersect(jsonData geojson.FeatureCollection, tablename string, att string) []Result
func GeoIntersectForBG ¶
func GeoIntersectForBG(jsonData geojson.FeatureCollection, tablename string, att string) []Result
func GroupAndSum ¶
type SQLBackupManager ¶
type SQLBackupManager struct {
// contains filtered or unexported fields
}
SQLBackupManager SQL备份管理器
func NewSQLBackupManager ¶
func NewSQLBackupManager() (*SQLBackupManager, error)
NewSQLBackupManager 创建SQL备份管理器
func (*SQLBackupManager) GetBackupStatistics ¶
func (sbm *SQLBackupManager) GetBackupStatistics() (*BackupStatistics, error)
GetBackupStatistics 获取备份统计信息
func (*SQLBackupManager) PerformSQLBackup ¶
func (sbm *SQLBackupManager) PerformSQLBackup() error
PerformSQLBackup 执行SQL备份
type SQLRestoreManager ¶
type SQLRestoreManager struct {
// contains filtered or unexported fields
}
SQLRestoreManager SQL恢复管理器
func NewSQLRestoreManager ¶
func NewSQLRestoreManager(backupPath string) (*SQLRestoreManager, error)
NewSQLRestoreManager 创建SQL恢复管理器
func (*SQLRestoreManager) PerformRestore ¶
func (srm *SQLRestoreManager) PerformRestore() (*RestoreResult, error)
PerformRestore 执行完整恢复
func (*SQLRestoreManager) SetRestoreOptions ¶
func (srm *SQLRestoreManager) SetRestoreOptions(dropExisting, restoreData, verbose bool)
SetRestoreOptions 设置恢复选项
Click to show internal directories.
Click to hide internal directories.