Projects STRLCPY Osmedeus Commits 382688a3
🤬
  • Massive refactor: streamlined codebase, eliminated technical debt, and improved maintainability

  • Loading...
  • j3ssie committed 1 year ago
    382688a3
    1 parent 7cae1c5d
  • ■ ■ ■ ■ ■ ■
    database/cloud.go
    1  -package database
    2  - 
    3  -// // DBUpdateCloudInstance update cloud instance
    4  -// func DBUpdateCloudInstance(inputObj *CloudInstance) {
    5  -// var obj CloudInstance
    6  -// DB.Model(CloudInstance{}).Where(CloudInstance{IPAddress: inputObj.IPAddress, InputName: inputObj.InputName}).First(&obj)
    7  -// if obj.ID != 0 {
    8  -// // @TODO: change target to old
    9  -// DB.Model(&obj).Updates(inputObj)
    10  -// inputObj.ID = obj.ID
    11  - 
    12  -// }
    13  -// DB.Create(&inputObj)
    14  -// }
    15  - 
    16  -// // GetRunningClouds get running cloud instance
    17  -// func GetRunningClouds() []CloudInstance {
    18  -// var objs []CloudInstance
    19  -// DB.Model(CloudInstance{}).Where(CloudInstance{Status: "running"}).Find(&objs)
    20  -// return objs
    21  -// }
    22  - 
  • ■ ■ ■ ■ ■ ■
    database/models.go
    skipped 94 lines
    95 95   ReportType string `gorm:"type:varchar(255);default:'text'" json:"report_type"`
    96 96  }
    97 97   
    98  -// // CloudInstance store cloud scan information to check
    99  -// type CloudInstance struct {
    100  -// Model
    101  -// InstanceName string `gorm:"type:varchar(255)" json:"instance_name"`
    102  -// Token string `gorm:"type:varchar(255)" json:"token"`
    103  -// AccessKeyId string `gorm:"type:varchar(255)" json:"access_key_id"`
    104  -// SecretKey string `gorm:"type:varchar(255)" json:"secret_key"`
    105  -// Provider string `gorm:"type:varchar(255)" json:"provider"`
    106  - 
    107  -// InputName string `gorm:"type:varchar(255)" json:"input_name"`
    108  -// IPAddress string `gorm:"type:varchar(255)" json:"ip_address"`
    109  -// InstanceID string `gorm:"type:varchar(255)" json:"instance_id"`
    110  -// SnapShotID string `gorm:"type:varchar(255)" json:"snap_shot_id"`
    111  - 
    112  -// // running / deleted / preparing
    113  -// Status string `gorm:"type:varchar(255)" json:"status"`
    114  -// IsError bool `json:"is_error"`
    115  - 
    116  -// IsChunk bool `json:"is_chunk"`
    117  -// }
    118  - 
  • ■ ■ ■ ■ ■
    server/mics.go
    skipped 38 lines
    39 39  func ListFlows(c *fiber.Ctx) error {
    40 40   flows := core.ListFlow(Opt)
    41 41   if len(flows) == 0 {
    42  - //color.Red("Error to list workflows: %s", options.Env.WorkFlowsFolder)
    43 42   return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
    44 43   "error": "Can't list workflow",
    45 44   })
    skipped 57 lines
Please wait...
Page is in error, reload to recover