Documentation
¶
Overview ¶
Package db defines database models for Result data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotations ¶
type Annotations map[string]string
Annotations is a custom-defined type of a gorm model field.
type Record ¶
type Record struct {
// Result is used to create the relationship between the Result and Records
// table. Data will not be returned here during reads. Use the foreign key
// fields instead.
Result Result `gorm:"foreignKey:Parent,ResultID;references:Parent,ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
Parent string `gorm:"primaryKey;uniqueIndex:records_by_name,priority:1;size:64;"`
ResultID string `gorm:"primaryKey;size:64;"`
ResultName string `gorm:"uniqueIndex:records_by_name,priority:2;size:64;"`
ID string `gorm:"primaryKey;size:64;"`
Name string `gorm:"index:records_by_name,priority:3;size:64;"`
// Napkin Math (with a bit of buffer): 256 (DNS Subdomain) * 3 (Group +
// Version + Kind).
Type string `gorm:"size:768;"`
Data []byte `gorm:"type:jsonb;"`
CreatedTime time.Time `gorm:"default:current_timestamp;"`
UpdatedTime time.Time `gorm:"default:current_timestamp;"`
Etag string `gorm:"size:128;"`
}
Record is the database model of a Record
type RecordSummary ¶ added in v0.5.0
type RecordSummary struct {
Record string `gorm:"size:256;"`
// Napkin Math (with a bit of buffer): 256 (DNS Subdomain) * 3 (Group +
// Version + Kind).
Type string `gorm:"size:768;"`
StartTime *time.Time
EndTime *time.Time
Status int32
Annotations Annotations `gorm:"type:jsonb;"`
}
RecordSummary is the database model of a Result.RecordSummary.
type Result ¶
type Result struct {
Parent string `gorm:"primaryKey;uniqueIndex:results_by_name,priority:1;size:64;"`
ID string `gorm:"primaryKey;size:64;"`
Name string `gorm:"uniqueIndex:results_by_name,priority:2;size:64;"`
Annotations Annotations `gorm:"type:jsonb;"`
CreatedTime time.Time `gorm:"default:current_timestamp;"`
UpdatedTime time.Time `gorm:"default:current_timestamp;"`
Summary RecordSummary `gorm:"embedded;embeddedPrefix:recordsummary_;"`
Etag string `gorm:"size:128;"`
}
Result is the database model of a Result.
Click to show internal directories.
Click to hide internal directories.