Skip to content

Commit

Permalink
Change the MetaDB of SecurityGroup with GORM
Browse files Browse the repository at this point in the history
  • Loading branch information
powerkimhub committed Aug 15, 2023
1 parent 6642563 commit c80a66d
Show file tree
Hide file tree
Showing 5 changed files with 625 additions and 559 deletions.
22 changes: 22 additions & 0 deletions api-runtime/common-runtime/CommonManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,28 @@ var clusterSPLock = splock.New()
// definition of IIDManager RWLock
var iidRWLock = new(iidm.IIDRWLOCK)

// ====================================================================
// Common column name and struct for GORM
const CONNECTION_NAME_COLUMN = "connection_name"
const NAME_ID_COLUMN = "name_id"
const SYSTEM_ID_COLUMN = "system_id"
const OWNER_VPC_NAME_COLUMN = "owner_vpc_name"

type FirstIIDInfo struct {
ConnectionName string `gorm:"primaryKey"` // ex) "aws-seoul-config"
NameId string `gorm:"primaryKey"` // ex) "my_resource"
SystemId string // ID in CSP, ex) "i7baab81a4ez"
}

type SecondaryIIDInfo struct {
ConnectionName string `gorm:"primaryKey"` // ex) "aws-seoul-config"
NameId string `gorm:"primaryKey"` // ex) "my_resource"
SystemId string // ID in CSP, ex) "i7baab81a4ez"
OwnerVPCName string `gorm:"primaryKey"` // ex) "my_vpc"
}

// ====================================================================

var cblog *logrus.Logger
var callogger *logrus.Logger

Expand Down
Loading

0 comments on commit c80a66d

Please sign in to comment.