Documentation ¶
Index ¶
- func GetDatabaseConnection(dbUrl string) (*sql.DB, error)
- type DB
- func (db *DB) Close() error
- func (db *DB) DeleteEnvironmentByPullRequest(pullRequest int, owner, repo, branch string) error
- func (db *DB) FindEnvironmentByID(id uuid.UUID) (Environment, error)
- func (db *DB) FindEnvironmentsByOwner(owner string, options FindEnvironmentsOptions) ([]Environment, error)
- func (db *DB) FindEnvironmentsByPullRequest(pullRequest int, owner string, repo string, branch string, ...) ([]Environment, error)
- func (db *DB) FindServicesByEnvironment(environmentID uuid.UUID) ([]Service, error)
- func (db *DB) Migrate() (int, error)
- func (db *DB) SaveEvent(owner, action string) error
- type EnvStatus
- type Environment
- type FindEnvironmentsOptions
- type MarketplaceEvent
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
func (*DB) DeleteEnvironmentByPullRequest ¶
func (*DB) FindEnvironmentByID ¶
func (db *DB) FindEnvironmentByID(id uuid.UUID) (Environment, error)
func (*DB) FindEnvironmentsByOwner ¶
func (db *DB) FindEnvironmentsByOwner(owner string, options FindEnvironmentsOptions) ([]Environment, error)
func (*DB) FindEnvironmentsByPullRequest ¶
func (db *DB) FindEnvironmentsByPullRequest( pullRequest int, owner string, repo string, branch string, options FindEnvironmentsOptions, ) ([]Environment, error)
func (*DB) FindServicesByEnvironment ¶
type Environment ¶
type Environment struct { ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` Owner string BranchOwner string Repo string Branch sql.NullString PullRequest sql.NullInt32 Author string Status EnvStatus DegradedReason json.RawMessage `gorm:"type:jsonb"` Services []Service `gorm:"foreignKey:EnvironmentID"` GHCommentID int64 `gorm:"column:gh_comment_id"` BuildTool string }
func NewEnvironment ¶
type FindEnvironmentsOptions ¶
type FindEnvironmentsOptions struct {
IncludeDeleted bool
}
type MarketplaceEvent ¶
type MarketplaceEvent struct { ID string `gorm:"primaryKey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` Owner string Action string }
Action can only be "purchased", "cancelled", "pending_change", "pending_change_cancelled", "changed"
func (*MarketplaceEvent) BeforeCreate ¶
func (e *MarketplaceEvent) BeforeCreate(tx *gorm.DB) error
type Service ¶
type Service struct { ID string `gorm:"primaryKey"` Name string EnvironmentID uuid.UUID `gorm:"type:uuid;index"` Url string Image string Build string BuildStatus string Index int PublicPort string InternalPorts pq.StringArray `gorm:"type:text[]"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` }
Click to show internal directories.
Click to hide internal directories.