typesDB

package
v0.0.0-...-785ad02 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAccountTypeGithub = "github"
)

Variables

This section is empty.

Functions

func AppendAlert

func AppendAlert(workflowRun *WorkflowRun, alert types.WorkflowRunAlert) error

Types

type GitIntegration

type GitIntegration struct {
	ID                string                `db:"id"`
	ProviderID        string                `db:"provider_id"`
	ProviderAccountID string                `db:"provider_account_id"`
	Type              types.GitProviderType `db:"type"`
}

type JobRun

type JobRun struct {
	ID            string `db:"id"`
	Number        int    `db:"number"`
	WorkflowRunID string `db:"workflow_run_id"`

	Runner string `db:"runner"`

	BuildMinutes int `db:"build_minutes"`

	CreatedAt  time.Time  `db:"created_at"`
	FinishedAt *time.Time `db:"finished_at"`

	Name string `db:"name"`

	Status     types.RunStatus      `db:"status"`
	Conclusion *types.RunConclusion `db:"conclusion"`
}

type OAuthUserAccountRefresh

type OAuthUserAccountRefresh struct {
	ID string `db:"id"`

	Type   UserAccountType `db:"type"`
	UserID string          `db:"user_id"`

	CreatedAt time.Time `db:"created_at"`
}

type OrgDB

type OrgDB struct {
	ID               string              `db:"id"`
	Slug             string              `db:"slug"`
	Name             string              `db:"name"`
	License          *sqlxTypes.JSONText `db:"license"`
	OwnerID          string              `db:"owner_user_id"`
	AvatarURL        string              `db:"avatar_url"`
	CurrentUsersRole *types.OrgRole      `db:"current_users_role"`
}

func (*OrgDB) GetLicense

func (o *OrgDB) GetLicense() (types.CloudLicense, error)

func (*OrgDB) SetLicense

func (o *OrgDB) SetLicense(license types.CloudLicense) error

type OrgUsersDB

type OrgUsersDB struct {
	OrgID  string        `db:"org_id"`
	UserID string        `db:"user_id"`
	Role   types.OrgRole `db:"role"`
}

type PendingOrgInviteDB

type PendingOrgInviteDB struct {
	OrgID     string        `db:"org_id"`
	Email     string        `db:"email"`
	Role      types.OrgRole `db:"role"`
	CreatedAt string        `db:"created_at"`
}

type Project

type Project struct {
	ID                string `db:"id"`
	OrgID             string `db:"org_id"`
	Slug              string `db:"slug"`
	Name              string `db:"name"`
	GitIntegrationID  string `db:"git_integration_id"`
	GitProviderRepoID string `db:"git_provider_repo_id"`
	AvatarURL         string `db:"avatar_url"`
}

type ProjectEnvironment

type ProjectEnvironment struct {
	ID            string    `db:"id"`
	ProjectID     string    `db:"project_id"`
	Name          string    `db:"name"`
	UpdatedAt     time.Time `db:"updated_at"`
	CreatedAt     time.Time `db:"created_at"`
	BranchPattern string    `db:"branch_pattern"`
}

type ProjectVariable

type ProjectVariable struct {
	ID                   string    `db:"id"`
	ProjectID            string    `db:"project_id"`
	Key                  string    `db:"key"`
	Value                string    `db:"value"`
	UpdatedAt            time.Time `db:"updated_at"`
	CreatedAt            time.Time `db:"created_at"`
	EncryptionKeyID      string    `db:"encryption_key_id"`
	InitialisationVector string    `db:"initialisation_vector"`
	Sensitive            bool      `db:"sensitive"`
}

type ProjectVariableOnProjectEnvironment

type ProjectVariableOnProjectEnvironment struct {
	ProjectVariableID    string `db:"project_variable_id"`
	ProjectEnvironmentID string `db:"project_environment_id"`
}

type ProjectVariableWithEnvironments

type ProjectVariableWithEnvironments struct {
	ID                   string
	ProjectID            string
	Key                  string
	Value                string
	UpdatedAt            time.Time
	CreatedAt            time.Time
	EncryptionKeyID      string
	InitialisationVector string
	Sensitive            bool

	Environments []ProjectEnvironment
}

type ProjectWithLastBuild

type ProjectWithLastBuild struct {
	ID                string     `db:"id"`
	OrgID             string     `db:"org_id"`
	Slug              string     `db:"slug"`
	Name              string     `db:"name"`
	GitIntegrationID  string     `db:"git_integration_id"`
	GitProviderRepoID string     `db:"git_provider_repo_id"`
	AvatarURL         string     `db:"avatar_url"`
	LastBuild         *time.Time `db:"last_build"`
}

type StepRun

type StepRun struct {
	ID            string            `db:"id"`
	Type          types.StepRunType `db:"type"`
	WorkflowRunID string            `db:"workflow_run_id"`

	CreatedAt  time.Time  `db:"created_at"`
	FinishedAt *time.Time `db:"finished_at"`

	TaskRunID string `db:"task_run_id"`
	JobRunID  string `db:"job_run_id"`

	Status     types.RunStatus      `db:"status"`
	Conclusion *types.RunConclusion `db:"conclusion"`

	Name string `db:"name"`
}

type TaskRun

type TaskRun struct {
	ID            string `db:"id"`
	JobRunID      string `db:"job_run_id"`
	WorkflowRunID string `db:"workflow_run_id"`

	Name string `db:"name"`

	CreatedAt  time.Time  `db:"created_at"`
	FinishedAt *time.Time `db:"finished_at"`

	Status     types.RunStatus      `db:"status"`
	Conclusion *types.RunConclusion `db:"conclusion"`

	DockerImage *string `db:"docker_image"`
}

type UserAccount

type UserAccount struct {
	ProviderAccountID string          `db:"provider_account_id"`
	Type              UserAccountType `db:"type"`
	UserID            string          `db:"user_id"`

	RefreshToken          string    `db:"refresh_token"`
	AccessToken           string    `db:"access_token"`
	AccessTokenExpiresAt  time.Time `db:"access_token_expires_at"`
	RefreshTokenExpiresAt time.Time `db:"refresh_token_expires_at"`
}

type UserAccountType

type UserAccountType string

type WorkflowRun

type WorkflowRun struct {
	ID        string `db:"id"`
	Number    int    `db:"number"`
	ProjectID string `db:"project_id"`

	Runner string `db:"runner"`

	BuildMinutes int `db:"build_minutes"`

	Name       string               `db:"name"`
	Status     types.RunStatus      `db:"status"`
	Conclusion *types.RunConclusion `db:"conclusion"`

	CreatedAt  time.Time  `db:"created_at"`
	FinishedAt *time.Time `db:"finished_at"`

	GitSha    string `db:"git_sha"`
	GitBranch string `db:"git_branch"`

	GitTitle *string `db:"git_title"`

	CommitterEmail *string `db:"committer_email"` // The email of the user who triggered the run (if known)
	UserID         *string `db:"user_id"`         // The user who triggered the run (if known)

	PrNumber *int32 `db:"pr_number"`

	Trigger types.RunTrigger `db:"trigger"`

	Alerts sqlxTypes.JSONText `db:"alerts"`
}

func (*WorkflowRun) GetAlerts

func (wr *WorkflowRun) GetAlerts() []types.WorkflowRunAlert

Jump to

Keyboard shortcuts

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