Documentation ¶
Index ¶
- func GormDBDataType(db *gorm.DB, field *schema.Field) string
- func Scan(value interface{}, data interface{}) error
- type GormDbAfterMigrationHook
- type JsonObject
- type Label
- type Labels
- type LocalInventoryToResource
- type OperationType
- type Relationship
- type RelationshipHistory
- type RelationshipReporter
- type Reporter
- type ReporterRelationshipId
- type ReporterResourceId
- type Resource
- type ResourceHistory
- type ResourceReporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JsonObject ¶
type JsonObject map[string]interface{}
func (JsonObject) GormDBDataType ¶
func (*JsonObject) Scan ¶
func (data *JsonObject) Scan(value interface{}) error
type LocalInventoryToResource ¶
type LocalInventoryToResource struct { // Our local resource id ResourceId uuid.UUID `gorm:"type:uuid;primarykey"` CreatedAt *time.Time `gorm:"index"` ReporterResourceId }
func (*LocalInventoryToResource) BeforeCreate ¶
func (r *LocalInventoryToResource) BeforeCreate(db *gorm.DB) error
type OperationType ¶
type OperationType string
const ( OperationTypeCreate OperationType = "CREATE" OperationTypeUpdate OperationType = "UPDATE" OperationTypeDelete OperationType = "DELETE" )
func (*OperationType) Scan ¶
func (o *OperationType) Scan(value interface{}) error
type Relationship ¶
type Relationship struct { ID uuid.UUID `gorm:"type:uuid;primarykey"` OrgId string `gorm:"index"` RelationshipData JsonObject RelationshipType string SubjectId uuid.UUID `gorm:"type:uuid;index;not null"` ObjectId uuid.UUID `gorm:"type:uuid;index;not null"` Reporter RelationshipReporter CreatedAt *time.Time UpdatedAt *time.Time // Used to create FKs Subject Resource `gorm:"foreignKey:SubjectId"` Object Resource `gorm:"foreignKey:ObjectId"` }
func (*Relationship) BeforeCreate ¶
func (r *Relationship) BeforeCreate(db *gorm.DB) error
type RelationshipHistory ¶
type RelationshipHistory struct { ID uuid.UUID `gorm:"type:uuid;primarykey"` OrgId string `gorm:"index"` RelationshipData JsonObject RelationshipType string SubjectId uuid.UUID `gorm:"type:uuid;index"` ObjectId uuid.UUID `gorm:"type:uuid;index"` Reporter RelationshipReporter Timestamp *time.Time `gorm:"autoCreateTime"` RelationshipId uuid.UUID `gorm:"type:uuid;index"` OperationType OperationType `gorm:"index"` }
func (*RelationshipHistory) BeforeCreate ¶
func (r *RelationshipHistory) BeforeCreate(db *gorm.DB) error
func (*RelationshipHistory) TableName ¶
func (*RelationshipHistory) TableName() string
type RelationshipReporter ¶
type RelationshipReporter struct { Reporter SubjectLocalResourceId string `json:"subject_local_resource_id"` SubjectResourceType string `json:"subject_resource_type"` ObjectLocalResourceId string `json:"object_local_resource_id"` ObjectResourceType string `json:"object_resource_type"` }
func (RelationshipReporter) GormDBDataType ¶
func (*RelationshipReporter) Scan ¶
func (data *RelationshipReporter) Scan(value interface{}) error
type ReporterRelationshipId ¶
type ReporterRelationshipId struct { // Reporter identification ReporterId string ReporterType string // Relationship data RelationshipType string ObjectId ReporterResourceId SubjectId ReporterResourceId }
func ReporterRelationshipIdFromRelationship ¶
func ReporterRelationshipIdFromRelationship(relationship *Relationship) ReporterRelationshipId
type ReporterResourceId ¶
type ReporterResourceId struct { // Id in reporter's side LocalResourceId string `gorm:"primarykey"` ResourceType string `gorm:"primarykey"` // Reporter identification ReporterId string `gorm:"primarykey"` ReporterType string `gorm:"primarykey"` }
func ReporterResourceIdFromResource ¶
func ReporterResourceIdFromResource(resource *Resource) ReporterResourceId
type Resource ¶
type ResourceHistory ¶
type ResourceHistory struct { ID uuid.UUID `gorm:"type:uuid;primarykey"` OrgId string `gorm:"index"` ResourceData JsonObject ResourceType string WorkspaceId string Reporter ResourceReporter ConsoleHref string ApiHref string Labels Labels Timestamp *time.Time `gorm:"autoCreateTime"` ResourceId uuid.UUID `gorm:"type:uuid;index"` OperationType OperationType `gorm:"index"` }
func (*ResourceHistory) BeforeCreate ¶
func (r *ResourceHistory) BeforeCreate(db *gorm.DB) error
func (*ResourceHistory) ResourceHistory ¶
func (*ResourceHistory) TableName ¶
func (*ResourceHistory) TableName() string
type ResourceReporter ¶
func (ResourceReporter) GormDBDataType ¶
func (*ResourceReporter) Scan ¶
func (data *ResourceReporter) Scan(value interface{}) error
Click to show internal directories.
Click to hide internal directories.