Documentation ¶
Index ¶
- Constants
- Variables
- func ConnectDatabase()
- func CreateOrGetDiggerRepoForGithubRepo(ghRepoFullName string, ghRepoOrganisation string, ghRepoName string, ...) (*model.Repo, *model.Organisation, error)
- type Database
- func (db *Database) CreateCiJobFromSpec(spec spec.Spec, runName string, projectId string) (*model.DiggerCiJob, error)
- func (db *Database) CreateDiggerJobToken(organisationId string) (*model.DiggerCiJobToken, error)
- func (db *Database) CreateGithubInstallationLink(orgId string, installationId string) (*model.GithubAppInstallationLink, error)
- func (db *Database) CreateProject(name string, repo *model.Repo) (*model.Project, error)
- func (db *Database) CreateRepo(name string, repoFullName string, repoOrganisation string, repoName string, ...) (*model.Repo, error)
- func (db *Database) GetDiggerCiJob(diggerJobId string) (*model.DiggerCiJob, error)
- func (db *Database) GetGithubAppInstallationLink(installationId string) (*model.GithubAppInstallationLink, error)
- func (db *Database) GetGithubInstallationLinkForInstallationId(installationId string) (*model.GithubAppInstallationLink, error)
- func (db *Database) GetJobToken(tenantId any) (*model.DiggerCiJobToken, error)
- func (db *Database) GetOrganisationById(orgId any) (*model.Organisation, error)
- func (db *Database) GetProjectById(projectId string) (*model.Project, error)
- func (db *Database) GetProjectByName(orgId any, repo *model.Repo, name string) (*model.Project, error)
- func (db *Database) GetRepo(orgIdKey any, repoName string) (*model.Repo, error)
- func (db *Database) GetRepoByInstllationIdAndRepoFullName(installationId string, repoFullName string) (*model.Repo, error)
- func (db *Database) LoadProjectsForOrg(orgId string) ([]*model.Project, error)
- func (db *Database) RefreshProjectsFromRepo(orgId string, config configuration.DiggerConfigYaml, repo *model.Repo) error
- func (db *Database) UpdateDiggerJob(job *model.DiggerCiJob) error
- type DiggerJobStatus
- type DriftStatus
- type GithubAppInstallationLinkStatus
Constants ¶
View Source
const ( AccessPolicyType = "access" AdminPolicyType = "admin" CliJobAccessType = "cli_access" )
Variables ¶
View Source
var DriftStatusAcknowledgeDrift = "acknowledged drift"
View Source
var DriftStatusNewDrift = "new drift"
View Source
var DriftStatusNoDrift = "no drift"
Functions ¶
func ConnectDatabase ¶
func ConnectDatabase()
Types ¶
type Database ¶
type Database struct { GormDB *gorm.DB Query *models_generated.Query }
var DB *Database
var DB *gorm.DB
func (*Database) CreateCiJobFromSpec ¶
func (*Database) CreateDiggerJobToken ¶
func (db *Database) CreateDiggerJobToken(organisationId string) (*model.DiggerCiJobToken, error)
func (*Database) CreateGithubInstallationLink ¶
func (*Database) CreateProject ¶
func (*Database) CreateRepo ¶
func (db *Database) CreateRepo(name string, repoFullName string, repoOrganisation string, repoName string, repoUrl string, org *model.Organisation, diggerConfig string, githubInstallationId string, githubAppId int64, accountId int64, login string, defaultBranch string, cloneUrl string) (*model.Repo, error)
func (*Database) GetDiggerCiJob ¶
func (db *Database) GetDiggerCiJob(diggerJobId string) (*model.DiggerCiJob, error)
func (*Database) GetGithubAppInstallationLink ¶
func (db *Database) GetGithubAppInstallationLink(installationId string) (*model.GithubAppInstallationLink, error)
GetGithubAppInstallationLink repoFullName should be in the following format: org/repo_name, for example "diggerhq/github-job-scheduler"
func (*Database) GetGithubInstallationLinkForInstallationId ¶
func (db *Database) GetGithubInstallationLinkForInstallationId(installationId string) (*model.GithubAppInstallationLink, error)
func (*Database) GetJobToken ¶
func (db *Database) GetJobToken(tenantId any) (*model.DiggerCiJobToken, error)
func (*Database) GetOrganisationById ¶
func (db *Database) GetOrganisationById(orgId any) (*model.Organisation, error)
func (*Database) GetProjectById ¶
func (*Database) GetProjectByName ¶
func (db *Database) GetProjectByName(orgId any, repo *model.Repo, name string) (*model.Project, error)
GetProjectByName return project for specified org and repo if record doesn't exist return nil
func (*Database) GetRepo ¶
GetRepo returns digger repo by organisationId and repo name (diggerhq-digger) it will return an empty object if record doesn't exist in database
func (*Database) GetRepoByInstllationIdAndRepoFullName ¶
func (db *Database) GetRepoByInstllationIdAndRepoFullName(installationId string, repoFullName string) (*model.Repo, error)
GetGithubAppInstallationByIdAndRepo repoFullName should be in the following format: org/repo_name, for example "diggerhq/github-job-scheduler"
func (*Database) LoadProjectsForOrg ¶
func (*Database) RefreshProjectsFromRepo ¶
func (db *Database) RefreshProjectsFromRepo(orgId string, config configuration.DiggerConfigYaml, repo *model.Repo) error
func (*Database) UpdateDiggerJob ¶
func (db *Database) UpdateDiggerJob(job *model.DiggerCiJob) error
type DiggerJobStatus ¶
type DiggerJobStatus string
const ( DiggerJobCreated DiggerJobStatus = "created" DiggerJobTriggered DiggerJobStatus = "triggered" DiggerJobFailed DiggerJobStatus = "failed" DiggerJobStarted DiggerJobStatus = "started" DiggerJobSucceeded DiggerJobStatus = "succeeded" DiggerJobQueuedForRun DiggerJobStatus = "queued" )
type DriftStatus ¶
type DriftStatus string
type GithubAppInstallationLinkStatus ¶
type GithubAppInstallationLinkStatus string
const ( GithubAppInstallationLinkActive GithubAppInstallationLinkStatus = "active" GithubAppInstallationLinkInactive GithubAppInstallationLinkStatus = "inactive" )
Click to show internal directories.
Click to hide internal directories.