models

package
v0.0.0-...-1834baf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Index

Constants

View Source
const (
	// ActivityTypeApplicationCreated is the 'application_created' ActivityType.
	ActivityTypeApplicationCreated = ActivityType(1)

	// ActivityTypeApplicationDeleted is the 'application_deleted' ActivityType.
	ActivityTypeApplicationDeleted = ActivityType(2)

	// ActivityTypeDeploymentStarted is the 'deployment_started' ActivityType.
	ActivityTypeDeploymentStarted = ActivityType(3)

	// ActivityTypeDeploymentSuccess is the 'deployment_success' ActivityType.
	ActivityTypeDeploymentSuccess = ActivityType(4)

	// ActivityTypeDeploymentFailure is the 'deployment_failure' ActivityType.
	ActivityTypeDeploymentFailure = ActivityType(5)

	// ActivityTypeEnvironmentCreated is the 'environment_created' ActivityType.
	ActivityTypeEnvironmentCreated = ActivityType(6)

	// ActivityTypeEnvironmentDestroyed is the 'environment_destroyed' ActivityType.
	ActivityTypeEnvironmentDestroyed = ActivityType(7)
)
View Source
const (
	// AppTypeServer is the 'server' AppType.
	AppTypeServer = AppType(1)

	// AppTypeCronjob is the 'cronjob' AppType.
	AppTypeCronjob = AppType(2)
)
View Source
const (
	// CreationStateTypeCreateInfrastructureWait is the 'CREATE_INFRASTRUCTURE_WAIT' CreationStateType.
	CreationStateTypeCreateInfrastructureWait = CreationStateType(1)

	// CreationStateTypeCreateInfrastructureSucceeded is the 'CREATE_INFRASTRUCTURE_SUCCEEDED' CreationStateType.
	CreationStateTypeCreateInfrastructureSucceeded = CreationStateType(2)

	// CreationStateTypeCreateInfrastructureFailed is the 'CREATE_INFRASTRUCTURE_FAILED' CreationStateType.
	CreationStateTypeCreateInfrastructureFailed = CreationStateType(3)
)
View Source
const (
	// DeletionStateTypeNotDeleted is the 'NOT_DELETED' DeletionStateType.
	DeletionStateTypeNotDeleted = DeletionStateType(1)

	// DeletionStateTypeDeleteInfrastructureWait is the 'DELETE_INFRASTRUCTURE_WAIT' DeletionStateType.
	DeletionStateTypeDeleteInfrastructureWait = DeletionStateType(2)

	// DeletionStateTypeDeleteInfrastructureSucceeded is the 'DELETE_INFRASTRUCTURE_SUCCEEDED' DeletionStateType.
	DeletionStateTypeDeleteInfrastructureSucceeded = DeletionStateType(3)

	// DeletionStateTypeDeleteInfrastructureFailed is the 'DELETE_INFRASTRUCTURE_FAILED' DeletionStateType.
	DeletionStateTypeDeleteInfrastructureFailed = DeletionStateType(4)
)

Variables

View Source
var XOLog = func(string, ...interface{}) {}

XOLog provides the log func used by generated queries.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	ID            int           `json:"id"`             // id
	UserID        sql.NullInt64 `json:"user_id"`        // user_id
	Activity      ActivityType  `json:"activity"`       // activity
	ApplicationID sql.NullInt64 `json:"application_id"` // application_id
	DeploymentID  sql.NullInt64 `json:"deployment_id"`  // deployment_id
	EnvironmentID sql.NullInt64 `json:"environment_id"` // environment_id
	CreatedAt     time.Time     `json:"created_at"`     // created_at
	// contains filtered or unexported fields
}

Activity represents a row from 'public.activities'.

func ActivityByID

func ActivityByID(db XODB, id int) (*Activity, error)

ActivityByID retrieves a row from 'public.activities' as a Activity.

Generated from index 'activities_pkey'.

func (*Activity) Application

func (a *Activity) Application(db XODB) (*Application, error)

Application returns the Application associated with the Activity's ApplicationID (application_id).

Generated from foreign key 'activities_application_id_fkey'.

func (*Activity) Delete

func (a *Activity) Delete(db XODB) error

Delete deletes the Activity from the database.

func (*Activity) Deleted

func (a *Activity) Deleted() bool

Deleted provides information if the Activity has been deleted from the database.

func (*Activity) Deployment

func (a *Activity) Deployment(db XODB) (*Deployment, error)

Deployment returns the Deployment associated with the Activity's DeploymentID (deployment_id).

Generated from foreign key 'activities_deployment_id_fkey'.

func (*Activity) Environment

func (a *Activity) Environment(db XODB) (*Environment, error)

Environment returns the Environment associated with the Activity's EnvironmentID (environment_id).

Generated from foreign key 'activities_environment_id_fkey'.

func (*Activity) Exists

func (a *Activity) Exists() bool

Exists determines if the Activity exists in the database.

func (*Activity) Insert

func (a *Activity) Insert(db XODB) error

Insert inserts the Activity to the database.

func (*Activity) Save

func (a *Activity) Save(db XODB) error

Save saves the Activity to the database.

func (*Activity) Update

func (a *Activity) Update(db XODB) error

Update updates the Activity in the database.

func (*Activity) Upsert

func (a *Activity) Upsert(db XODB) error

Upsert performs an upsert for Activity.

NOTE: PostgreSQL 9.5+ only

func (*Activity) User

func (a *Activity) User(db XODB) (*User, error)

User returns the User associated with the Activity's UserID (user_id).

Generated from foreign key 'activities_user_id_fkey'.

type ActivityType

type ActivityType uint16

ActivityType is the 'activity_type' enum type from schema 'public'.

func (ActivityType) MarshalText

func (at ActivityType) MarshalText() ([]byte, error)

MarshalText marshals ActivityType into text.

func (*ActivityType) Scan

func (at *ActivityType) Scan(src interface{}) error

Scan satisfies the database/sql.Scanner interface for ActivityType.

func (ActivityType) String

func (at ActivityType) String() string

String returns the string value of the ActivityType.

func (*ActivityType) UnmarshalText

func (at *ActivityType) UnmarshalText(text []byte) error

UnmarshalText unmarshals ActivityType from text.

func (ActivityType) Value

func (at ActivityType) Value() (driver.Value, error)

Value satisfies the sql/driver.Valuer interface for ActivityType.

type AppType

type AppType uint16

AppType is the 'app_type' enum type from schema 'public'.

func (AppType) MarshalText

func (at AppType) MarshalText() ([]byte, error)

MarshalText marshals AppType into text.

func (*AppType) Scan

func (at *AppType) Scan(src interface{}) error

Scan satisfies the database/sql.Scanner interface for AppType.

func (AppType) String

func (at AppType) String() string

String returns the string value of the AppType.

func (*AppType) UnmarshalText

func (at *AppType) UnmarshalText(text []byte) error

UnmarshalText unmarshals AppType from text.

func (AppType) Value

func (at AppType) Value() (driver.Value, error)

Value satisfies the sql/driver.Valuer interface for AppType.

type Application

type Application struct {
	ID                  int               `json:"id"`                     // id
	UserID              int               `json:"user_id"`                // user_id
	Name                string            `json:"name"`                   // name
	Type                AppType           `json:"type"`                   // type
	Slug                string            `json:"slug"`                   // slug
	Description         sql.NullString    `json:"description"`            // description
	InternalDNS         sql.NullString    `json:"internal_dns"`           // internal_dns
	ExternalDNS         sql.NullString    `json:"external_dns"`           // external_dns
	GithubRepoURL       sql.NullString    `json:"github_repo_url"`        // github_repo_url
	DockerfilePath      sql.NullString    `json:"dockerfile_path"`        // dockerfile_path
	EntrypointOverride  sql.NullString    `json:"entrypoint_override"`    // entrypoint_override
	AwsEncryptionKeyArn string            `json:"aws_encryption_key_arn"` // aws_encryption_key_arn
	CreationState       CreationStateType `json:"creation_state"`         // creation_state
	DeletionState       DeletionStateType `json:"deletion_state"`         // deletion_state
	CreatedAt           time.Time         `json:"created_at"`             // created_at
	UpdatedAt           time.Time         `json:"updated_at"`             // updated_at
	DeletedAt           pq.NullTime       `json:"deleted_at"`             // deleted_at
	// contains filtered or unexported fields
}

Application represents a row from 'public.applications'.

func ApplicationByID

func ApplicationByID(db XODB, id int) (*Application, error)

ApplicationByID retrieves a row from 'public.applications' as a Application.

Generated from index 'applications_pkey'.

func (*Application) Delete

func (a *Application) Delete(db XODB) error

Delete deletes the Application from the database.

func (*Application) Deleted

func (a *Application) Deleted() bool

Deleted provides information if the Application has been deleted from the database.

func (*Application) Exists

func (a *Application) Exists() bool

Exists determines if the Application exists in the database.

func (*Application) Insert

func (a *Application) Insert(db XODB) error

Insert inserts the Application to the database.

func (*Application) Save

func (a *Application) Save(db XODB) error

Save saves the Application to the database.

func (*Application) Update

func (a *Application) Update(db XODB) error

Update updates the Application in the database.

func (*Application) Upsert

func (a *Application) Upsert(db XODB) error

Upsert performs an upsert for Application.

NOTE: PostgreSQL 9.5+ only

func (*Application) User

func (a *Application) User(db XODB) (*User, error)

User returns the User associated with the Application's UserID (user_id).

Generated from foreign key 'applications_user_id_fkey'.

type Configuration

type Configuration struct {
	EnvironmentID int       `json:"environment_id"` // environment_id
	Version       int       `json:"version"`        // version
	CreatedAt     time.Time `json:"created_at"`     // created_at
	// contains filtered or unexported fields
}

Configuration represents a row from 'public.configurations'.

func ConfigurationByEnvironmentIDVersion

func ConfigurationByEnvironmentIDVersion(db XODB, environmentID int, version int) (*Configuration, error)

ConfigurationByEnvironmentIDVersion retrieves a row from 'public.configurations' as a Configuration.

Generated from index 'configurations_pkey'.

func (*Configuration) Delete

func (c *Configuration) Delete(db XODB) error

Delete deletes the Configuration from the database.

func (*Configuration) Deleted

func (c *Configuration) Deleted() bool

Deleted provides information if the Configuration has been deleted from the database.

func (*Configuration) Environment

func (c *Configuration) Environment(db XODB) (*Environment, error)

Environment returns the Environment associated with the Configuration's EnvironmentID (environment_id).

Generated from foreign key 'configurations_environment_id_fkey'.

func (*Configuration) Exists

func (c *Configuration) Exists() bool

Exists determines if the Configuration exists in the database.

func (*Configuration) Insert

func (c *Configuration) Insert(db XODB) error

Insert inserts the Configuration to the database.

func (*Configuration) Save

func (c *Configuration) Save(db XODB) error

Save saves the Configuration to the database.

func (*Configuration) Update

func (c *Configuration) Update(db XODB) error

Update updates the Configuration in the database.

func (*Configuration) Upsert

func (c *Configuration) Upsert(db XODB) error

Upsert performs an upsert for Configuration.

NOTE: PostgreSQL 9.5+ only

type CreationStateType

type CreationStateType uint16

CreationStateType is the 'creation_state_type' enum type from schema 'public'.

func (CreationStateType) MarshalText

func (cst CreationStateType) MarshalText() ([]byte, error)

MarshalText marshals CreationStateType into text.

func (*CreationStateType) Scan

func (cst *CreationStateType) Scan(src interface{}) error

Scan satisfies the database/sql.Scanner interface for CreationStateType.

func (CreationStateType) String

func (cst CreationStateType) String() string

String returns the string value of the CreationStateType.

func (*CreationStateType) UnmarshalText

func (cst *CreationStateType) UnmarshalText(text []byte) error

UnmarshalText unmarshals CreationStateType from text.

func (CreationStateType) Value

func (cst CreationStateType) Value() (driver.Value, error)

Value satisfies the sql/driver.Valuer interface for CreationStateType.

type DeletionStateType

type DeletionStateType uint16

DeletionStateType is the 'deletion_state_type' enum type from schema 'public'.

func (DeletionStateType) MarshalText

func (dst DeletionStateType) MarshalText() ([]byte, error)

MarshalText marshals DeletionStateType into text.

func (*DeletionStateType) Scan

func (dst *DeletionStateType) Scan(src interface{}) error

Scan satisfies the database/sql.Scanner interface for DeletionStateType.

func (DeletionStateType) String

func (dst DeletionStateType) String() string

String returns the string value of the DeletionStateType.

func (*DeletionStateType) UnmarshalText

func (dst *DeletionStateType) UnmarshalText(text []byte) error

UnmarshalText unmarshals DeletionStateType from text.

func (DeletionStateType) Value

func (dst DeletionStateType) Value() (driver.Value, error)

Value satisfies the sql/driver.Valuer interface for DeletionStateType.

type Deployment

type Deployment struct {
	ID            int           `json:"id"`             // id
	ApplicationID sql.NullInt64 `json:"application_id"` // application_id
	EnvironmentID sql.NullInt64 `json:"environment_id"` // environment_id
	Committish    string        `json:"committish"`     // committish
	CurrentState  string        `json:"current_state"`  // current_state
	CreatedAt     time.Time     `json:"created_at"`     // created_at
	// contains filtered or unexported fields
}

Deployment represents a row from 'public.deployments'.

func DeploymentByID

func DeploymentByID(db XODB, id int) (*Deployment, error)

DeploymentByID retrieves a row from 'public.deployments' as a Deployment.

Generated from index 'deployments_pkey'.

func (*Deployment) Application

func (d *Deployment) Application(db XODB) (*Application, error)

Application returns the Application associated with the Deployment's ApplicationID (application_id).

Generated from foreign key 'deployments_application_id_fkey'.

func (*Deployment) Delete

func (d *Deployment) Delete(db XODB) error

Delete deletes the Deployment from the database.

func (*Deployment) Deleted

func (d *Deployment) Deleted() bool

Deleted provides information if the Deployment has been deleted from the database.

func (*Deployment) Environment

func (d *Deployment) Environment(db XODB) (*Environment, error)

Environment returns the Environment associated with the Deployment's EnvironmentID (environment_id).

Generated from foreign key 'deployments_environment_id_fkey'.

func (*Deployment) Exists

func (d *Deployment) Exists() bool

Exists determines if the Deployment exists in the database.

func (*Deployment) Insert

func (d *Deployment) Insert(db XODB) error

Insert inserts the Deployment to the database.

func (*Deployment) Save

func (d *Deployment) Save(db XODB) error

Save saves the Deployment to the database.

func (*Deployment) Update

func (d *Deployment) Update(db XODB) error

Update updates the Deployment in the database.

func (*Deployment) Upsert

func (d *Deployment) Upsert(db XODB) error

Upsert performs an upsert for Deployment.

NOTE: PostgreSQL 9.5+ only

type Environment

type Environment struct {
	ID            int           `json:"id"`             // id
	ApplicationID sql.NullInt64 `json:"application_id"` // application_id
	Name          string        `json:"name"`           // name
	Slug          string        `json:"slug"`           // slug
	CreatedAt     time.Time     `json:"created_at"`     // created_at
	// contains filtered or unexported fields
}

Environment represents a row from 'public.environments'.

func EnvironmentByApplicationIDName

func EnvironmentByApplicationIDName(db XODB, applicationID sql.NullInt64, name string) (*Environment, error)

EnvironmentByApplicationIDName retrieves a row from 'public.environments' as a Environment.

Generated from index 'environments_application_id_name_key'.

func EnvironmentByApplicationIDSlug

func EnvironmentByApplicationIDSlug(db XODB, applicationID sql.NullInt64, slug string) (*Environment, error)

EnvironmentByApplicationIDSlug retrieves a row from 'public.environments' as a Environment.

Generated from index 'environments_application_id_slug_key'.

func EnvironmentByID

func EnvironmentByID(db XODB, id int) (*Environment, error)

EnvironmentByID retrieves a row from 'public.environments' as a Environment.

Generated from index 'environments_pkey'.

func (*Environment) Application

func (e *Environment) Application(db XODB) (*Application, error)

Application returns the Application associated with the Environment's ApplicationID (application_id).

Generated from foreign key 'environments_application_id_fkey'.

func (*Environment) Delete

func (e *Environment) Delete(db XODB) error

Delete deletes the Environment from the database.

func (*Environment) Deleted

func (e *Environment) Deleted() bool

Deleted provides information if the Environment has been deleted from the database.

func (*Environment) Exists

func (e *Environment) Exists() bool

Exists determines if the Environment exists in the database.

func (*Environment) Insert

func (e *Environment) Insert(db XODB) error

Insert inserts the Environment to the database.

func (*Environment) Save

func (e *Environment) Save(db XODB) error

Save saves the Environment to the database.

func (*Environment) Update

func (e *Environment) Update(db XODB) error

Update updates the Environment in the database.

func (*Environment) Upsert

func (e *Environment) Upsert(db XODB) error

Upsert performs an upsert for Environment.

NOTE: PostgreSQL 9.5+ only

type ScannerValuer

type ScannerValuer interface {
	sql.Scanner
	driver.Valuer
}

ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.

type Slice

type Slice []ScannerValuer

Slice is a slice of ScannerValuers.

type StringSlice

type StringSlice []string

StringSlice is a slice of strings.

func (*StringSlice) Scan

func (ss *StringSlice) Scan(src interface{}) error

Scan satisfies the sql.Scanner interface for StringSlice.

func (StringSlice) Value

func (ss StringSlice) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface for StringSlice.

type User

type User struct {
	ID                     int       `json:"id"`                        // id
	Name                   string    `json:"name"`                      // name
	Email                  string    `json:"email"`                     // email
	EncryptedPassword      string    `json:"encrypted_password"`        // encrypted_password
	GithubOauthAccessToken string    `json:"github_oauth_access_token"` // github_oauth_access_token
	CreatedAt              time.Time `json:"created_at"`                // created_at
	UpdatedAt              time.Time `json:"updated_at"`                // updated_at
	// contains filtered or unexported fields
}

User represents a row from 'public.users'.

func UserByEmail

func UserByEmail(db XODB, email string) (*User, error)

UserByEmail retrieves a row from 'public.users' as a User.

Generated from index 'users_email_key'.

func UserByID

func UserByID(db XODB, id int) (*User, error)

UserByID retrieves a row from 'public.users' as a User.

Generated from index 'users_pkey'.

func (*User) Delete

func (u *User) Delete(db XODB) error

Delete deletes the User from the database.

func (*User) Deleted

func (u *User) Deleted() bool

Deleted provides information if the User has been deleted from the database.

func (*User) Exists

func (u *User) Exists() bool

Exists determines if the User exists in the database.

func (*User) Insert

func (u *User) Insert(db XODB) error

Insert inserts the User to the database.

func (*User) Save

func (u *User) Save(db XODB) error

Save saves the User to the database.

func (*User) Update

func (u *User) Update(db XODB) error

Update updates the User in the database.

func (*User) Upsert

func (u *User) Upsert(db XODB) error

Upsert performs an upsert for User.

NOTE: PostgreSQL 9.5+ only

type XODB

type XODB interface {
	Exec(string, ...interface{}) (sql.Result, error)
	Query(string, ...interface{}) (*sql.Rows, error)
	QueryRow(string, ...interface{}) *sql.Row
}

XODB is the common interface for database operations that can be used with types from schema 'public'.

This should work with database/sql.DB and database/sql.Tx.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL