Documentation
¶
Index ¶
- Variables
- type AdminsJSON
- type Build
- type BuildExecutable
- func (b *BuildExecutable) Compress(level int) error
- func (b *BuildExecutable) Decompress() error
- func (b *BuildExecutable) Decrypt(key string) error
- func (b *BuildExecutable) Encrypt(key string) error
- func (b *BuildExecutable) Nullify() *BuildExecutable
- func (b *BuildExecutable) ToAPI() *api.BuildExecutable
- func (b *BuildExecutable) Validate() error
- type Compiler
- type CustomPropsJSON
- type DashReposJSON
- type Dashboard
- type Deployment
- type Hook
- type JWK
- type Log
- type Pipeline
- type Platform
- type Queue
- type QueueBuild
- type Repo
- type SCM
- type Schedule
- type Secret
- type SecretAllowlist
- type Service
- type Step
- type User
- type Worker
Constants ¶
This section is empty.
Variables ¶
var ( // ErrEmptyBuildNumber defines the error type when a // Build type has an empty Number field provided. ErrEmptyBuildNumber = errors.New("empty build number provided") // ErrEmptyBuildRepoID defines the error type when a // Build type has an empty `RepoID` field provided. ErrEmptyBuildRepoID = errors.New("empty build repo_id provided") )
var ( // ErrEmptyDashName defines the error type when a // User type has an empty Name field provided. ErrEmptyDashName = errors.New("empty dashboard name provided") // ErrExceededAdminLimit defines the error type when a // User type has Admins field provided that exceeds the database limit. ErrExceededAdminLimit = errors.New("exceeded admins limit") )
var ( // ErrEmptyDeploymentNumber defines the error type when a // Deployment type has an empty Number field provided. ErrEmptyDeploymentNumber = errors.New("empty deployment number provided") // ErrEmptyDeploymentRepoID defines the error type when a // Deployment type has an empty RepoID field provided. ErrEmptyDeploymentRepoID = errors.New("empty deployment repo_id provided") )
var ( // ErrEmptyHookNumber defines the error type when a // Hook type has an empty Number field provided. ErrEmptyHookNumber = errors.New("empty webhook number provided") // ErrEmptyHookRepoID defines the error type when a // Hook type has an empty RepoID field provided. ErrEmptyHookRepoID = errors.New("empty webhook repo_id provided") // ErrEmptyHookSourceID defines the error type when a // Hook type has an empty SourceID field provided. ErrEmptyHookSourceID = errors.New("empty webhook source_id provided") // ErrEmptyHookWebhookID defines the error type when a // Hook type has an empty WebhookID field provided. ErrEmptyHookWebhookID = errors.New("empty webhook webhook_id provided") )
var ( // ErrEmptyLogBuildID defines the error type when a // Log type has an empty BuildID field provided. ErrEmptyLogBuildID = errors.New("empty log build_id provided") // ErrEmptyLogRepoID defines the error type when a // Log type has an empty RepoID field provided. ErrEmptyLogRepoID = errors.New("empty log repo_id provided") // ErrEmptyLogStepOrServiceID defines the error type when a // Log type has an empty StepID or ServiceID field provided. ErrEmptyLogStepOrServiceID = errors.New("empty log step_id or service_id not provided") )
var ( // ErrEmptyPipelineCommit defines the error type when a // Pipeline type has an empty Commit field provided. ErrEmptyPipelineCommit = errors.New("empty pipeline commit provided") // ErrEmptyPipelineRef defines the error type when a // Pipeline type has an empty Ref field provided. ErrEmptyPipelineRef = errors.New("empty pipeline ref provided") // ErrEmptyPipelineRepoID defines the error type when a // Pipeline type has an empty RepoID field provided. ErrEmptyPipelineRepoID = errors.New("empty pipeline repo_id provided") // ErrEmptyPipelineType defines the error type when a // Pipeline type has an empty Type field provided. ErrEmptyPipelineType = errors.New("empty pipeline type provided") // ErrEmptyPipelineVersion defines the error type when a // Pipeline type has an empty Version field provided. ErrEmptyPipelineVersion = errors.New("empty pipeline version provided") // ErrExceededWarningsLimit defines the error type when a // Pipeline warnings field has too many total characters. ErrExceededWarningsLimit = errors.New("exceeded character limit for pipeline warnings") )
var ( // ErrEmptyRepoFullName defines the error type when a // Repo type has an empty FullName field provided. ErrEmptyRepoFullName = errors.New("empty repo full_name provided") // ErrEmptyRepoHash defines the error type when a // Repo type has an empty Hash field provided. ErrEmptyRepoHash = errors.New("empty repo hash provided") // ErrEmptyRepoName defines the error type when a // Repo type has an empty Name field provided. ErrEmptyRepoName = errors.New("empty repo name provided") // ErrEmptyRepoOrg defines the error type when a // Repo type has an empty Org field provided. ErrEmptyRepoOrg = errors.New("empty repo org provided") // ErrEmptyRepoUserID defines the error type when a // Repo type has an empty UserID field provided. ErrEmptyRepoUserID = errors.New("empty repo user_id provided") // ErrEmptyRepoVisibility defines the error type when a // Repo type has an empty Visibility field provided. ErrEmptyRepoVisibility = errors.New("empty repo visibility provided") // ErrExceededTopicsLimit defines the error type when a // Repo type has Topics field provided that exceeds the database limit. ErrExceededTopicsLimit = errors.New("exceeded topics limit") )
var ( // ErrEmptyScheduleEntry defines the error type when a Schedule type has an empty Entry field provided. ErrEmptyScheduleEntry = errors.New("empty schedule entry provided") // ErrEmptyScheduleName defines the error type when a Schedule type has an empty Name field provided. ErrEmptyScheduleName = errors.New("empty schedule name provided") // ErrEmptyScheduleRepoID defines the error type when a Schedule type has an empty RepoID field provided. ErrEmptyScheduleRepoID = errors.New("empty schedule repo_id provided") // ErrInvalidScheduleEntry defines the error type when a Schedule type has an invalid Entry field provided. ErrInvalidScheduleEntry = errors.New("invalid schedule entry provided") )
var ( // ErrEmptySecretName defines the error type when a // Secret type has an empty Name field provided. ErrEmptySecretName = errors.New("empty secret name provided") // ErrEmptySecretOrg defines the error type when a // Secret type has an empty Org field provided. ErrEmptySecretOrg = errors.New("empty secret org provided") // ErrEmptySecretRepo defines the error type when a // Secret type has an empty Repo field provided. ErrEmptySecretRepo = errors.New("empty secret repo provided") // ErrEmptySecretTeam defines the error type when a // Secret type has an empty Team field provided. ErrEmptySecretTeam = errors.New("empty secret team provided") // ErrEmptySecretType defines the error type when a // Secret type has an empty Type field provided. ErrEmptySecretType = errors.New("empty secret type provided") // ErrEmptySecretValue defines the error type when a // Secret type has an empty Value field provided. ErrEmptySecretValue = errors.New("empty secret value provided") )
var ( // ErrEmptyServiceBuildID defines the error type when a // Service type has an empty BuildID field provided. ErrEmptyServiceBuildID = errors.New("empty service build_id provided") // ErrEmptyServiceName defines the error type when a // Service type has an empty Name field provided. ErrEmptyServiceName = errors.New("empty service name provided") // ErrEmptyServiceImage defines the error type when a // Service type has an empty Image field provided. ErrEmptyServiceImage = errors.New("empty service image provided") // ErrEmptyServiceNumber defines the error type when a // Service type has an empty Number field provided. ErrEmptyServiceNumber = errors.New("empty service number provided") // ErrEmptyServiceRepoID defines the error type when a // Service type has an empty RepoID field provided. ErrEmptyServiceRepoID = errors.New("empty service repo_id provided") )
var ( // ErrEmptyStepBuildID defines the error type when a // Step type has an empty BuildID field provided. ErrEmptyStepBuildID = errors.New("empty step build_id provided") // ErrEmptyStepName defines the error type when a // Step type has an empty Name field provided. ErrEmptyStepName = errors.New("empty step name provided") // ErrEmptyStepImage defines the error type when a // Step type has an empty Image field provided. ErrEmptyStepImage = errors.New("empty step image provided") // ErrEmptyStepNumber defines the error type when a // Step type has an empty Number field provided. ErrEmptyStepNumber = errors.New("empty step number provided") // ErrEmptyStepRepoID defines the error type when a // Step type has an empty RepoID field provided. ErrEmptyStepRepoID = errors.New("empty step repo_id provided") )
var ( // ErrEmptyUserName defines the error type when a // User type has an empty Name field provided. ErrEmptyUserName = errors.New("empty user name provided") // ErrEmptyUserRefreshToken defines the error type when a // User type has an empty RefreshToken field provided. ErrEmptyUserRefreshToken = errors.New("empty user refresh token provided") // ErrEmptyUserToken defines the error type when a // User type has an empty Token field provided. ErrEmptyUserToken = errors.New("empty user token provided") // ErrInvalidUserName defines the error type when a // User type has an invalid Name field provided. ErrInvalidUserName = errors.New("invalid user name provided") // ErrExceededFavoritesLimit defines the error type when a // User type has Favorites field provided that exceeds the database limit. ErrExceededFavoritesLimit = errors.New("exceeded favorites limit") // ErrExceededDashboardsLimit defines the error type when a // User type has Dashboards field provided that exceeds the database limit. ErrExceededDashboardsLimit = errors.New("exceeded dashboards limit") )
var ( // ErrEmptyWorkerHost defines the error type when a // Worker type has an empty Host field provided. ErrEmptyWorkerHost = errors.New("empty worker hostname provided") // ErrEmptyWorkerAddress defines the error type when a // Worker type has an empty Address field provided. ErrEmptyWorkerAddress = errors.New("empty worker address provided") // ErrExceededRunningBuildIDsLimit defines the error type when a // Worker type has RunningBuildIDs field provided that exceeds the database limit. ErrExceededRunningBuildIDsLimit = errors.New("exceeded running build ids limit") )
var ( // ErrEmptyBuildExecutableBuildID defines the error type when a // BuildExecutable type has an empty BuildID field provided. ErrEmptyBuildExecutableBuildID = errors.New("empty build_executable build_id provided") )
var ( // ErrEmptyCloneImage defines the error type when a // Settings type has an empty CloneImage field provided. ErrEmptyCloneImage = errors.New("empty settings clone image provided") )
var ( // ErrInvalidKID defines the error type when a // JWK type has an invalid ID field provided. ErrInvalidKID = errors.New("invalid key identifier provided") )
Functions ¶
This section is empty.
Types ¶
type AdminsJSON ¶
func (*AdminsJSON) Scan ¶
func (a *AdminsJSON) Scan(value interface{}) error
Scan - Implement the database/sql scanner interface for AdminsJSON.
type Build ¶
type Build struct {
ID sql.NullInt64 `sql:"id"`
RepoID sql.NullInt64 `sql:"repo_id"`
PipelineID sql.NullInt64 `sql:"pipeline_id"`
Number sql.NullInt64 `sql:"number"`
Parent sql.NullInt64 `sql:"parent"`
Event sql.NullString `sql:"event"`
EventAction sql.NullString `sql:"event_action"`
Status sql.NullString `sql:"status"`
Error sql.NullString `sql:"error"`
Enqueued sql.NullInt64 `sql:"enqueued"`
Created sql.NullInt64 `sql:"created"`
Started sql.NullInt64 `sql:"started"`
Finished sql.NullInt64 `sql:"finished"`
Deploy sql.NullString `sql:"deploy"`
DeployNumber sql.NullInt64 `sql:"deploy_number"`
DeployPayload raw.StringSliceMap `sql:"deploy_payload" gorm:"type:varchar(2000)"`
Clone sql.NullString `sql:"clone"`
Source sql.NullString `sql:"source"`
Title sql.NullString `sql:"title"`
Message sql.NullString `sql:"message"`
Commit sql.NullString `sql:"commit"`
Sender sql.NullString `sql:"sender"`
SenderSCMID sql.NullString `sql:"sender_scm_id"`
Fork sql.NullBool `sql:"fork"`
Author sql.NullString `sql:"author"`
Email sql.NullString `sql:"email"`
Link sql.NullString `sql:"link"`
Branch sql.NullString `sql:"branch"`
Ref sql.NullString `sql:"ref"`
BaseRef sql.NullString `sql:"base_ref"`
HeadRef sql.NullString `sql:"head_ref"`
Host sql.NullString `sql:"host"`
Route sql.NullString `sql:"route"`
Runtime sql.NullString `sql:"runtime"`
Distribution sql.NullString `sql:"distribution"`
ApprovedAt sql.NullInt64 `sql:"approved_at"`
ApprovedBy sql.NullString `sql:"approved_by"`
Repo Repo `gorm:"foreignKey:RepoID"`
}
Build is the database representation of a build for a pipeline.
func BuildFromAPI ¶
BuildFromAPI converts the API Build type to a database build type.
func (*Build) Crop ¶
Crop prepares the Build type for inserting into the database by trimming values that may exceed the database column limit.
func (*Build) Nullify ¶
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Build type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type BuildExecutable ¶ added in v0.26.0
type BuildExecutable struct {
ID sql.NullInt64 `sql:"id"`
BuildID sql.NullInt64 `sql:"build_id"`
Data []byte `sql:"data"`
}
BuildExecutable is the database representation of a BuildExecutable.
func BuildExecutableFromAPI ¶ added in v0.26.0
func BuildExecutableFromAPI(c *api.BuildExecutable) *BuildExecutable
BuildExecutableFromAPI converts the API BuildExecutable type to a database BuildExecutable type.
func (*BuildExecutable) Compress ¶ added in v0.26.0
func (b *BuildExecutable) Compress(level int) error
Compress will manipulate the existing data for the BuildExecutable by compressing that data. This produces a significantly smaller amount of data that is stored in the system.
func (*BuildExecutable) Decompress ¶ added in v0.26.0
func (b *BuildExecutable) Decompress() error
Decompress will manipulate the existing data for the BuildExecutable by decompressing that data. This allows us to have a significantly smaller amount of data that is stored in the system.
func (*BuildExecutable) Decrypt ¶ added in v0.26.0
func (b *BuildExecutable) Decrypt(key string) error
Decrypt will manipulate the existing executable data by base64 decoding that value. Then, a AES-256 cipher block is created from the encryption key in order to decrypt the base64 decoded secret value.
func (*BuildExecutable) Encrypt ¶ added in v0.26.0
func (b *BuildExecutable) Encrypt(key string) error
Encrypt will manipulate the existing build executable by creating a AES-256 cipher block from the encryption key in order to encrypt the build executable. Then, the build executable is base64 encoded for transport across network boundaries.
func (*BuildExecutable) Nullify ¶ added in v0.26.0
func (b *BuildExecutable) Nullify() *BuildExecutable
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the BuildExecutable type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
func (*BuildExecutable) ToAPI ¶ added in v0.26.0
func (b *BuildExecutable) ToAPI() *api.BuildExecutable
ToAPI converts the BuildExecutable type to a API BuildExecutable type.
func (*BuildExecutable) Validate ¶ added in v0.26.0
func (b *BuildExecutable) Validate() error
Validate verifies the necessary fields for the BuildExecutable type are populated correctly.
type Compiler ¶
type Compiler struct {
CloneImage sql.NullString `json:"clone_image" sql:"clone_image"`
TemplateDepth sql.NullInt64 `json:"template_depth" sql:"template_depth"`
StarlarkExecLimit sql.NullInt64 `json:"starlark_exec_limit" sql:"starlark_exec_limit"`
}
Compiler is the database representation of compiler settings.
type CustomPropsJSON ¶ added in v0.27.0
Repo is the database representation of a repo.
func (*CustomPropsJSON) Scan ¶ added in v0.27.0
func (cp *CustomPropsJSON) Scan(value any) error
Scan - Implement the database/sql scanner interface for DashReposJSON.
type DashReposJSON ¶
type DashReposJSON []*api.DashboardRepo
func (*DashReposJSON) Scan ¶
func (r *DashReposJSON) Scan(value interface{}) error
Scan - Implement the database/sql scanner interface for DashReposJSON.
type Dashboard ¶
type Dashboard struct {
ID uuid.UUID `sql:"id" gorm:"type:uuid;default:uuid_generate_v7()"`
Name sql.NullString `sql:"name"`
CreatedAt sql.NullInt64 `sql:"created_at"`
CreatedBy sql.NullString `sql:"created_by"`
UpdatedAt sql.NullInt64 `sql:"updated_at"`
UpdatedBy sql.NullString `sql:"updated_by"`
Admins AdminsJSON `sql:"admins"`
Repos DashReposJSON `sql:"repos"`
}
Dashboard is the database representation of a dashboard.
func DashboardFromAPI ¶
DashboardFromAPI converts the API Dashboard type to a database Dashboard type.
func (*Dashboard) Nullify ¶
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Dashboard type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type Deployment ¶ added in v0.26.0
type Deployment struct {
ID sql.NullInt64 `sql:"id"`
Number sql.NullInt64 `sql:"number"`
RepoID sql.NullInt64 `sql:"repo_id"`
URL sql.NullString `sql:"url"`
Commit sql.NullString `sql:"commit"`
Ref sql.NullString `sql:"ref"`
Task sql.NullString `sql:"task"`
Target sql.NullString `sql:"target"`
Description sql.NullString `sql:"description"`
Payload raw.StringSliceMap `sql:"payload"`
CreatedAt sql.NullInt64 `sql:"created_at"`
CreatedBy sql.NullString `sql:"created_by"`
Builds pq.StringArray `sql:"builds" gorm:"type:varchar(50)"`
Repo Repo `gorm:"foreignKey:RepoID"`
}
Deployment is the database representation of a deployment for a repo.
func DeploymentFromAPI ¶ added in v0.26.0
func DeploymentFromAPI(d *api.Deployment) *Deployment
DeploymentFromAPI converts the API Deployment type to a database Deployment type.
func (*Deployment) Nullify ¶ added in v0.26.0
func (d *Deployment) Nullify() *Deployment
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Deployment type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
func (*Deployment) ToAPI ¶ added in v0.26.0
func (d *Deployment) ToAPI(builds []*api.Build) *api.Deployment
ToAPI converts the Deployment type to the API Deployment type.
func (*Deployment) Validate ¶ added in v0.26.0
func (d *Deployment) Validate() error
Validate verifies the necessary fields for the Deployment type are populated correctly.
type Hook ¶ added in v0.25.0
type Hook struct {
ID sql.NullInt64 `sql:"id"`
RepoID sql.NullInt64 `sql:"repo_id"`
BuildID sql.NullInt64 `sql:"build_id"`
Number sql.NullInt64 `sql:"number"`
SourceID sql.NullString `sql:"source_id"`
Created sql.NullInt64 `sql:"created"`
Host sql.NullString `sql:"host"`
Event sql.NullString `sql:"event"`
EventAction sql.NullString `sql:"event_action"`
Branch sql.NullString `sql:"branch"`
Error sql.NullString `sql:"error"`
Status sql.NullString `sql:"status"`
Link sql.NullString `sql:"link"`
WebhookID sql.NullInt64 `sql:"webhook_id"`
Repo Repo `gorm:"foreignKey:RepoID"`
Build Build `gorm:"foreignKey:BuildID"`
}
Hook is the database representation of a webhook for a repo.
func HookFromAPI ¶ added in v0.25.0
HookFromAPI converts the API Hook type to a database Hook type.
func (*Hook) Nullify ¶ added in v0.25.0
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Hook type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type JWK ¶
type JWK struct {
ID uuid.UUID `gorm:"type:uuid"`
Active sql.NullBool `sql:"active"`
Key []byte `sql:"key"`
}
JWK is the database representation of a jwk.
func JWKFromAPI ¶
func JWKFromAPI(j jwk.RSAPublicKey) *JWK
JWKFromAPI converts the API JWK type to a database JWK type.
func (*JWK) Nullify ¶
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the JWK type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
func (*JWK) ToAPI ¶
func (j *JWK) ToAPI() jwk.RSAPublicKey
ToAPI converts the JWK type to an API JWK type.
type Log ¶ added in v0.26.0
type Log struct {
ID sql.NullInt64 `sql:"id"`
BuildID sql.NullInt64 `sql:"build_id"`
RepoID sql.NullInt64 `sql:"repo_id"`
ServiceID sql.NullInt64 `sql:"service_id"`
StepID sql.NullInt64 `sql:"step_id"`
Data []byte `sql:"data"`
CreatedAt sql.NullInt64 `sql:"created_at"`
}
Log is the database representation of a log for a step in a build.
func LogFromAPI ¶ added in v0.26.0
LogFromAPI converts the Log type to a API Log type.
func (*Log) Compress ¶ added in v0.26.0
Compress will manipulate the existing data for the log entry by compressing that data. This produces a significantly smaller amount of data that is stored in the system.
func (*Log) Decompress ¶ added in v0.26.0
Decompress will manipulate the existing data for the log entry by decompressing that data. This allows us to have a significantly smaller amount of data that is stored in the system.
func (*Log) Nullify ¶ added in v0.26.0
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Log type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type Pipeline ¶ added in v0.26.0
type Pipeline struct {
ID sql.NullInt64 `sql:"id"`
RepoID sql.NullInt64 `sql:"repo_id"`
Commit sql.NullString `sql:"commit"`
Flavor sql.NullString `sql:"flavor"`
Platform sql.NullString `sql:"platform"`
Ref sql.NullString `sql:"ref"`
Type sql.NullString `sql:"type"`
Version sql.NullString `sql:"version"`
ExternalSecrets sql.NullBool `sql:"external_secrets"`
InternalSecrets sql.NullBool `sql:"internal_secrets"`
Services sql.NullBool `sql:"services"`
Stages sql.NullBool `sql:"stages"`
Steps sql.NullBool `sql:"steps"`
Templates sql.NullBool `sql:"templates"`
Warnings pq.StringArray `sql:"warnings" gorm:"type:varchar(5000)"`
Data []byte `sql:"data"`
Repo Repo `gorm:"foreignKey:RepoID"`
}
Pipeline is the database representation of a pipeline.
func PipelineFromAPI ¶ added in v0.26.0
PipelineFromAPI converts the API Pipeline type to a database Pipeline type.
func (*Pipeline) Compress ¶ added in v0.26.0
Compress will manipulate the existing data for the pipeline by compressing that data. This produces a significantly smaller amount of data that is stored in the system.
func (*Pipeline) Decompress ¶ added in v0.26.0
Decompress will manipulate the existing data for the pipeline by decompressing that data. This allows us to have a significantly smaller amount of data that is stored in the system.
func (*Pipeline) Nullify ¶ added in v0.26.0
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Pipeline type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type Platform ¶
type Platform struct {
ID sql.NullInt32 `sql:"id"`
Compiler `json:"compiler" sql:"compiler"`
Queue `json:"queue" sql:"queue"`
SCM `json:"scm" sql:"scm"`
RepoAllowlist pq.StringArray `json:"repo_allowlist" sql:"repo_allowlist" gorm:"type:varchar(1000)"`
ScheduleAllowlist pq.StringArray `json:"schedule_allowlist" sql:"schedule_allowlist" gorm:"type:varchar(1000)"`
MaxDashboardRepos sql.NullInt32 `json:"max_dashboard_repos" sql:"max_dashboard_repos"`
QueueRestartLimit sql.NullInt32 `json:"queue_restart_limit" sql:"queue_restart_limit"`
CreatedAt sql.NullInt64 `sql:"created_at"`
UpdatedAt sql.NullInt64 `sql:"updated_at"`
UpdatedBy sql.NullString `sql:"updated_by"`
}
Platform is the database representation of platform settings.
func SettingsFromAPI ¶
SettingsFromAPI converts the API Settings type to a database Settings type.
func (*Platform) Nullify ¶
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Settings type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type Queue ¶
type Queue struct {
Routes pq.StringArray `json:"routes" sql:"routes" gorm:"type:varchar(1000)"`
}
Queue is the database representation of queue settings.
type QueueBuild ¶
type QueueBuild struct {
Status sql.NullString `sql:"status"`
Number sql.NullInt32 `sql:"number"`
Created sql.NullInt64 `sql:"created"`
FullName sql.NullString `sql:"full_name"`
}
QueueBuild is the database representation of the builds in the queue.
func QueueBuildFromAPI ¶
func QueueBuildFromAPI(b *api.QueueBuild) *QueueBuild
QueueBuildFromAPI converts the API QueueBuild type to a database build queue type.
func (*QueueBuild) ToAPI ¶
func (b *QueueBuild) ToAPI() *api.QueueBuild
ToAPI converts the QueueBuild type to a API QueueBuild type.
type Repo ¶
type Repo struct {
ID sql.NullInt64 `sql:"id"`
UserID sql.NullInt64 `sql:"user_id"`
Hash sql.NullString `sql:"hash"`
Org sql.NullString `sql:"org"`
Name sql.NullString `sql:"name"`
FullName sql.NullString `sql:"full_name"`
Link sql.NullString `sql:"link"`
Clone sql.NullString `sql:"clone"`
Branch sql.NullString `sql:"branch"`
Topics pq.StringArray `sql:"topics" gorm:"type:varchar(1020)"`
BuildLimit sql.NullInt32 `sql:"build_limit"`
Timeout sql.NullInt32 `sql:"timeout"`
Counter sql.NullInt64 `sql:"counter"`
Visibility sql.NullString `sql:"visibility"`
Private sql.NullBool `sql:"private"`
Trusted sql.NullBool `sql:"trusted"`
Active sql.NullBool `sql:"active"`
AllowEvents sql.NullInt64 `sql:"allow_events"`
PipelineType sql.NullString `sql:"pipeline_type"`
PreviousName sql.NullString `sql:"previous_name"`
ApproveBuild sql.NullString `sql:"approve_build"`
ApprovalTimeout sql.NullInt32 `sql:"approval_timeout"`
InstallID sql.NullInt64 `sql:"install_id"`
CustomProps CustomPropsJSON `sql:"custom_props"`
Owner User `gorm:"foreignKey:UserID"`
}
Repo is the database representation of a repo.
func RepoFromAPI ¶
RepoFromAPI converts the API Repo type to a database repo type.
func (*Repo) Decrypt ¶
Decrypt will manipulate the existing repo hash by base64 decoding that value. Then, a AES-256 cipher block is created from the encryption key in order to decrypt the base64 decoded secret value.
func (*Repo) Encrypt ¶
Encrypt will manipulate the existing repo hash by creating a AES-256 cipher block from the encryption key in order to encrypt the repo hash. Then, the repo hash is base64 encoded for transport across network boundaries.
func (*Repo) Nullify ¶
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Repo type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type SCM ¶ added in v0.27.0
type SCM struct {
RepoRoleMap map[string]string `json:"repo_role_map" sql:"repo_role_map"`
OrgRoleMap map[string]string `json:"org_role_map" sql:"org_role_map"`
TeamRoleMap map[string]string `json:"team_role_map" sql:"team_role_map"`
}
SCM is the database representation of SCM settings.
type Schedule ¶
type Schedule struct {
ID sql.NullInt64 `sql:"id"`
RepoID sql.NullInt64 `sql:"repo_id"`
Active sql.NullBool `sql:"active"`
Name sql.NullString `sql:"name"`
Entry sql.NullString `sql:"entry"`
CreatedAt sql.NullInt64 `sql:"created_at"`
CreatedBy sql.NullString `sql:"created_by"`
UpdatedAt sql.NullInt64 `sql:"updated_at"`
UpdatedBy sql.NullString `sql:"updated_by"`
ScheduledAt sql.NullInt64 `sql:"scheduled_at"`
Branch sql.NullString `sql:"branch"`
Error sql.NullString `sql:"error"`
Repo Repo `gorm:"foreignKey:RepoID"`
}
func ScheduleFromAPI ¶
ScheduleFromAPI converts the API Schedule type to a database Schedule type.
func (*Schedule) Nullify ¶
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Schedule type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type Secret ¶ added in v0.26.0
type Secret struct {
ID sql.NullInt64 `sql:"id"`
Org sql.NullString `sql:"org"`
Repo sql.NullString `sql:"repo"`
Team sql.NullString `sql:"team"`
Name sql.NullString `sql:"name"`
Value sql.NullString `sql:"value"`
Type sql.NullString `sql:"type"`
Images pq.StringArray `sql:"images" gorm:"type:varchar(1000)"`
AllowEvents sql.NullInt64 `sql:"allow_events"`
AllowCommand sql.NullBool `sql:"allow_command"`
AllowSubstitution sql.NullBool `sql:"allow_substitution"`
CreatedAt sql.NullInt64 `sql:"created_at"`
CreatedBy sql.NullString `sql:"created_by"`
UpdatedAt sql.NullInt64 `sql:"updated_at"`
UpdatedBy sql.NullString `sql:"updated_by"`
}
Secret is the database representation of a secret.
func SecretFromAPI ¶ added in v0.26.0
SecretFromAPI converts the API Secret type to a database Secret type.
func (*Secret) Decrypt ¶ added in v0.26.0
Decrypt will manipulate the existing secret value by base64 decoding that value. Then, a AES-256 cipher block is created from the encryption key in order to decrypt the base64 decoded secret value.
func (*Secret) Encrypt ¶ added in v0.26.0
Encrypt will manipulate the existing secret value by creating a AES-256 cipher block from the encryption key in order to encrypt the secret value. Then, the secret value is base64 encoded for transport across network boundaries.
func (*Secret) Nullify ¶ added in v0.26.0
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Secret type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type SecretAllowlist ¶ added in v0.27.0
type SecretAllowlist struct {
ID sql.NullInt64 `sql:"id"`
SecretID sql.NullInt64 `sql:"secret_id"`
Repo sql.NullString `sql:"repo"`
}
SecretAllowlist is the database representation of a secret allowlist.
func SecretAllowlistFromAPI ¶ added in v0.27.0
func SecretAllowlistFromAPI(s *api.Secret, repo string) *SecretAllowlist
SecretAllowlistFromAPI converts the API Secret and a repo full name to a database SecretAllowlist type.
func (*SecretAllowlist) Nullify ¶ added in v0.27.0
func (s *SecretAllowlist) Nullify() *SecretAllowlist
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the SecretAllowlist type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
func (*SecretAllowlist) Validate ¶ added in v0.27.0
func (s *SecretAllowlist) Validate() error
Validate verifies the necessary fields for the Secret type are populated correctly.
type Service ¶ added in v0.26.0
type Service struct {
ID sql.NullInt64 `sql:"id"`
BuildID sql.NullInt64 `sql:"build_id"`
RepoID sql.NullInt64 `sql:"repo_id"`
Number sql.NullInt32 `sql:"number"`
Name sql.NullString `sql:"name"`
Image sql.NullString `sql:"image"`
Status sql.NullString `sql:"status"`
Error sql.NullString `sql:"error"`
ExitCode sql.NullInt32 `sql:"exit_code"`
Created sql.NullInt64 `sql:"created"`
Started sql.NullInt64 `sql:"started"`
Finished sql.NullInt64 `sql:"finished"`
Host sql.NullString `sql:"host"`
Runtime sql.NullString `sql:"runtime"`
Distribution sql.NullString `sql:"distribution"`
}
Service is the database representation of a service in a build.
func ServiceFromAPI ¶ added in v0.26.0
ServiceFromAPI converts the API Service type to a database Service type.
func (*Service) Nullify ¶ added in v0.26.0
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Service type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type Step ¶ added in v0.26.0
type Step struct {
ID sql.NullInt64 `sql:"id"`
BuildID sql.NullInt64 `sql:"build_id"`
RepoID sql.NullInt64 `sql:"repo_id"`
Number sql.NullInt32 `sql:"number"`
Name sql.NullString `sql:"name"`
Image sql.NullString `sql:"image"`
Stage sql.NullString `sql:"stage"`
Status sql.NullString `sql:"status"`
Error sql.NullString `sql:"error"`
ExitCode sql.NullInt32 `sql:"exit_code"`
Created sql.NullInt64 `sql:"created"`
Started sql.NullInt64 `sql:"started"`
Finished sql.NullInt64 `sql:"finished"`
Host sql.NullString `sql:"host"`
Runtime sql.NullString `sql:"runtime"`
Distribution sql.NullString `sql:"distribution"`
ReportAs sql.NullString `sql:"report_as"`
}
Step is the database representation of a step in a build.
func StepFromAPI ¶ added in v0.26.0
StepFromAPI converts the API Step type to a database Step type.
func (*Step) Nullify ¶ added in v0.26.0
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Step type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type User ¶
type User struct {
ID sql.NullInt64 `sql:"id"`
Name sql.NullString `sql:"name"`
RefreshToken sql.NullString `sql:"refresh_token"`
Token sql.NullString `sql:"token"`
Favorites pq.StringArray `sql:"favorites" gorm:"type:varchar(5000)"`
Active sql.NullBool `sql:"active"`
Admin sql.NullBool `sql:"admin"`
Dashboards pq.StringArray `sql:"dashboards" gorm:"type:varchar(5000)"`
}
User is the database representation of a user.
func UserFromAPI ¶
UserFromAPI converts the API User type to a database User type.
func (*User) Decrypt ¶
Decrypt will manipulate the existing user tokens by base64 decoding them. Then, a AES-256 cipher block is created from the encryption key in order to decrypt the base64 decoded user tokens.
func (*User) Encrypt ¶
Encrypt will manipulate the existing user tokens by creating a AES-256 cipher block from the encryption key in order to encrypt the user tokens. Then, the user tokens are base64 encoded for transport across network boundaries.
func (*User) Nullify ¶
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the User type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.
type Worker ¶
type Worker struct {
ID sql.NullInt64 `sql:"id"`
Hostname sql.NullString `sql:"hostname"`
Address sql.NullString `sql:"address"`
Routes pq.StringArray `sql:"routes" gorm:"type:varchar(1000)"`
Active sql.NullBool `sql:"active"`
Status sql.NullString `sql:"status"`
LastStatusUpdateAt sql.NullInt64 `sql:"last_status_update_at"`
RunningBuildIDs pq.StringArray `sql:"running_build_ids" gorm:"type:varchar(500)"`
LastBuildStartedAt sql.NullInt64 `sql:"last_build_started_at"`
LastBuildFinishedAt sql.NullInt64 `sql:"last_build_finished_at"`
LastCheckedIn sql.NullInt64 `sql:"last_checked_in"`
BuildLimit sql.NullInt32 `sql:"build_limit"`
}
Worker is the database representation of a worker.
func WorkerFromAPI ¶
WorkerFromAPI converts the API worker type to a database worker type.
func (*Worker) Nullify ¶
Nullify ensures the valid flag for the sql.Null types are properly set.
When a field within the Build type is the zero value for the field, the valid flag is set to false causing it to be NULL in the database.