data

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckWhereArgs

func CheckWhereArgs(sql string, whereArgs []WhereArg) (string, []interface{})

func GetDBWithTimeout

func GetDBWithTimeout(dsn string, timeout time.Duration) (*sqlx.DB, error)

ConnectLoop tries to connect to the DB under given DSN using a give driver in a loop until connection succeeds. timeout specifies the timeout for the loop.

func MigrateDB

func MigrateDB(DSN, logLevel string) error

Types

type Artifact

type Artifact struct {
	ID            int    `db:"id"`
	Name          string `db:"name"`
	FeedType      string `db:"feed_type"`
	ProviderGroup string `db:"provider_group"`
	ImageTag      string `db:"image_tag"`
	ServicePort   int    `db:"service_port"`
	MetricsPort   int    `db:"metrics_port"`
}

type Artifacts

type Artifacts []Artifact

type Clause

type Clause struct {
	// contains filtered or unexported fields
}

type Cluster

type Cluster struct {
	ID            string       `db:"id"`
	Name          string       `db:"name"`
	ProviderGroup string       `db:"provider_group"`
	SchQueueUrl   string       `db:"sch_queue_url"`
	CreatedAt     sql.NullTime `db:"created_at"`
	UpdatedAt     sql.NullTime `db:"updated_at"`
}

type Clusters

type Clusters []Cluster

type Definition

type Definition struct {
	ID               int          `db:"id"`
	Description      string       `db:"description"`
	DefinitionTypeID int          `db:"definition_type_id"`
	Data             json.Object  `db:"data"`
	CreatedAt        sql.NullTime `db:"created_at"`
	UpdatedAt        sql.NullTime `db:"updated_at"`
}

type DefinitionJob

type DefinitionJob struct {
	DefinitionID          int           `db:"definition_id"`
	DefinitionTypeID      int           `db:"definition_type_id"`
	StackingOrder         int           `db:"stacking_order"`
	DefinitionType        string        `db:"definition_type"`
	DefinitionVersion     string        `db:"definition_version"`
	DefinitionClass       string        `db:"definition_class"`
	DefinitionKind        string        `db:"definition_kind"`
	DefinitionOrder       string        `db:"definition_order"`
	DefinitionDescription string        `db:"definition_description"`
	MapDescription        string        `db:"map_description"`
	Data                  json.Object   `db:"data"`
	MapEnvironmentId      sql.NullInt32 `db:"map_environment_id"`
	MapArtifactId         sql.NullInt32 `db:"map_artifact_id"`
	MapNamespaceId        sql.NullInt32 `db:"map_namespace_id"`
	MapJobId              sql.NullInt32 `db:"map_job_id"`
	MapClusterID          sql.NullInt32 `db:"map_cluster_id"`
	CreatedAt             sql.NullTime  `db:"created_at"`
	UpdatedAt             sql.NullTime  `db:"updated_at"`
}

type DefinitionJobMap

type DefinitionJobMap struct {
	Description   string        `db:"description"`
	DefinitionID  int           `db:"definition_id"`
	EnvironmentID sql.NullInt32 `db:"environment_id"`
	ArtifactID    sql.NullInt32 `db:"artifact_id"`
	NamespaceID   sql.NullInt32 `db:"namespace_id"`
	JobID         sql.NullInt32 `db:"job_id"`
	ClusterID     sql.NullInt32 `db:"cluster_id"`
	StackingOrder int           `db:"stacking_order"`
	CreatedAt     sql.NullTime  `db:"created_at"`
	UpdatedAt     sql.NullTime  `db:"updated_at"`
}

type DefinitionService

type DefinitionService struct {
	DefinitionID          int           `db:"definition_id"`
	DefinitionTypeID      int           `db:"definition_type_id"`
	StackingOrder         int           `db:"stacking_order"`
	DefinitionType        string        `db:"definition_type"`
	DefinitionVersion     string        `db:"definition_version"`
	DefinitionClass       string        `db:"definition_class"`
	DefinitionKind        string        `db:"definition_kind"`
	DefinitionOrder       string        `db:"definition_order"`
	DefinitionDescription string        `db:"definition_description"`
	MapDescription        string        `db:"map_description"`
	Data                  json.Object   `db:"data"`
	MapEnvironmentID      sql.NullInt32 `db:"map_environment_id"`
	MapArtifactID         sql.NullInt32 `db:"map_artifact_id"`
	MapNamespaceID        sql.NullInt32 `db:"map_namespace_id"`
	MapServiceID          sql.NullInt32 `db:"map_service_id"`
	MapClusterID          sql.NullInt32 `db:"map_cluster_id"`
	CreatedAt             sql.NullTime  `db:"created_at"`
	UpdatedAt             sql.NullTime  `db:"updated_at"`
}

type DefinitionServiceMap

type DefinitionServiceMap struct {
	Description   string        `db:"description"`
	DefinitionID  int           `db:"definition_id"`
	EnvironmentID sql.NullInt32 `db:"environment_id"`
	ArtifactID    sql.NullInt32 `db:"artifact_id"`
	NamespaceID   sql.NullInt32 `db:"namespace_id"`
	ServiceID     sql.NullInt32 `db:"service_id"`
	ClusterID     sql.NullInt32 `db:"cluster_id"`
	StackingOrder int           `db:"stacking_order"`
	CreatedAt     sql.NullTime  `db:"created_at"`
	UpdatedAt     sql.NullTime  `db:"updated_at"`
}

type DefinitionType

type DefinitionType struct {
	ID              int          `db:"id"`
	Name            string       `db:"name"`
	Description     string       `db:"description"`
	CreatedAt       sql.NullTime `db:"created_at"`
	UpdatedAt       sql.NullTime `db:"updated_at"`
	Class           string       `db:"class"`
	Version         string       `db:"version"`
	Kind            string       `db:"kind"`
	DefinitionOrder string       `db:"definition_order"`
}

type DeployJob

type DeployJob struct {
	JobID            int            `db:"job_id"`
	JobName          string         `db:"job_name"`
	ArtifactID       int            `db:"artifact_id"`
	ArtifactName     string         `db:"artifact_name"`
	RequestedVersion string         `db:"requested_version"`
	DeployedVersion  sql.NullString `db:"deployed_version"`
	ImageTag         string         `db:"image_tag"`
	EnvironmentID    int            `db:"environment_id"`
	NamespaceID      int            `db:"namespace_id"`
	CreatedAt        sql.NullTime   `db:"created_at"`
	UpdatedAt        sql.NullTime   `db:"updated_at"`
	SuccessExitCodes string         `db:"success_exit_codes"`
}

type DeployJobs

type DeployJobs []DeployJob

type DeployService

type DeployService struct {
	ServiceID        int            `db:"service_id"`
	ServiceName      string         `db:"service_name"`
	ArtifactID       int            `db:"artifact_id"`
	ArtifactName     string         `db:"artifact_name"`
	RequestedVersion string         `db:"requested_version"`
	DeployedVersion  sql.NullString `db:"deployed_version"`
	ServicePort      int            `db:"service_port"`
	MetricsPort      int            `db:"metrics_port"`
	ImageTag         string         `db:"image_tag"`
	Count            int            `db:"count"`
	EnvironmentID    int            `db:"environment_id"`
	NamespaceID      int            `db:"namespace_id"`
	Definition       json.Object    `db:"definition"`
	CreatedAt        sql.NullTime   `db:"created_at"`
	UpdatedAt        sql.NullTime   `db:"updated_at"`
	SuccessExitCodes string         `db:"success_exit_codes"`
}

type DeployServices

type DeployServices []DeployService

type Deployment

type Deployment struct {
	ID            uuid.UUID       `db:"id"`
	EnvironmentID int             `db:"environment_id"`
	NamespaceID   int             `db:"namespace_id"`
	MessageID     sql.NullString  `db:"message_id"`
	ReceiptHandle sql.NullString  `db:"receipt_handle"`
	ReqID         string          `db:"req_id"`
	PlanOptions   json.Object     `db:"plan_options"`
	PlanLocation  json.Object     `db:"plan_location"`
	State         DeploymentState `db:"state"`
	User          string          `db:"user"`
	CreatedAt     sql.NullTime    `db:"created_at"`
	UpdatedAt     sql.NullTime    `db:"updated_at"`
}

type DeploymentCronJob

type DeploymentCronJob struct {
	ID          uuid.UUID           `db:"id"`
	Description string              `db:"description"`
	PlanOptions json.Object         `db:"plan_options"`
	Schedule    string              `db:"schedule"`
	LastRun     sql.NullTime        `db:"last_run"`
	State       DeploymentCronState `db:"state"`
	Disabled    bool                `db:"disabled"`
	Order       int                 `db:"exec_order"`
}

type DeploymentCronJobs

type DeploymentCronJobs []*DeploymentCronJob

type DeploymentCronState

type DeploymentCronState string
const (
	DeploymentCronStateIdle    DeploymentCronState = "idle"
	DeploymentCronStateRunning DeploymentCronState = "running"
)

type DeploymentState

type DeploymentState string
const (
	DeploymentStateQueued    DeploymentState = "queued"
	DeploymentStateScheduled DeploymentState = "scheduled"
	DeploymentStateCompleted DeploymentState = "completed"
)

type Environment

type Environment struct {
	ID          int          `db:"id"`
	Name        string       `db:"name"`
	Alias       string       `db:"alias"`
	Description string       `db:"description"`
	UpdatedAt   sql.NullTime `db:"updated_at"`
}

type EnvironmentFeedMap

type EnvironmentFeedMap struct {
	EnvironmentID int `db:"environment_id"`
	FeedID        int `db:"feed_id"`
}

type Environments

type Environments []Environment

type ExecFn

type ExecFn func(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

type Feed

type Feed struct {
	ID             int    `db:"id"`
	Name           string `db:"name"`
	PromotionOrder int    `db:"promotion_order"`
	FeedType       string `db:"feed_type"`
	Alias          string `db:"alias"`
}

type Feeds

type Feeds []Feed

type Job

type Job struct {
	ID              int            `db:"id"`
	NamespaceID     int            `db:"namespace_id"`
	NamespaceName   string         `db:"namespace_name"`
	ArtifactID      int            `db:"artifact_id"`
	ArtifactName    string         `db:"artifact_name"`
	OverrideVersion sql.NullString `db:"override_version"`
	DeployedVersion sql.NullString `db:"deployed_version"`
	CreatedAt       sql.NullTime   `db:"created_at"`
	UpdatedAt       sql.NullTime   `db:"updated_at"`
	Name            string         `db:"name"`
}

type LogicalOperator

type LogicalOperator string
const (
	ORLogicalOperator  LogicalOperator = "OR"
	ANDLogicalOperator LogicalOperator = "AND"
)

type Metadata

type Metadata struct {
	ID          int          `db:"id"`
	Description string       `db:"description"`
	Value       json.Object  `db:"value"`
	CreatedAt   sql.NullTime `db:"created_at"`
	UpdatedAt   sql.NullTime `db:"updated_at"`
}

type MetadataHistory

type MetadataHistory struct {
	MetadataId  int          `db:"metadata_id"`
	Description string       `db:"description"`
	Value       json.Object  `db:"value"`
	Created     sql.NullTime `db:"created"`
	CreatedBy   string       `db:"created_by"`
	Deleted     sql.NullTime `db:"deleted"`
	DeletedBy   *string      `db:"deleted_by"`
}

type MetadataJob

type MetadataJob struct {
	MetadataID          int           `db:"metadata_id"`
	Metadata            json.Object   `db:"metadata"`
	MetadataDescription string        `db:"metadata_description"`
	MapDescription      string        `db:"map_description"`
	MapEnvironmentId    sql.NullInt32 `db:"map_environment_id"`
	MapArtifactId       sql.NullInt32 `db:"map_artifact_id"`
	MapNamespaceId      sql.NullInt32 `db:"map_namespace_id"`
	MapJobId            sql.NullInt32 `db:"map_job_id"`
	StackingOrder       int           `db:"stacking_order"`
	CreatedAt           sql.NullTime  `db:"created_at"`
	UpdatedAt           sql.NullTime  `db:"updated_at"`
}

type MetadataJobMap

type MetadataJobMap struct {
	Description   string        `db:"description"`
	MetadataID    int           `db:"metadata_id"`
	EnvironmentID sql.NullInt32 `db:"environment_id"`
	ArtifactID    sql.NullInt32 `db:"artifact_id"`
	NamespaceID   sql.NullInt32 `db:"namespace_id"`
	ClusterID     sql.NullInt32 `db:"cluster_id"`
	JobID         sql.NullInt32 `db:"job_id"`
	StackingOrder int           `db:"stacking_order"`
	CreatedAt     sql.NullTime  `db:"created_at"`
	UpdatedAt     sql.NullTime  `db:"updated_at"`
}

type MetadataService

type MetadataService struct {
	MetadataID          int           `db:"metadata_id"`
	Metadata            json.Object   `db:"metadata"`
	MetadataDescription string        `db:"metadata_description"`
	MapDescription      string        `db:"map_description"`
	MapEnvironmentID    sql.NullInt32 `db:"map_environment_id"`
	MapArtifactID       sql.NullInt32 `db:"map_artifact_id"`
	MapNamespaceID      sql.NullInt32 `db:"map_namespace_id"`
	MapServiceID        sql.NullInt32 `db:"map_service_id"`
	StackingOrder       int           `db:"stacking_order"`
	CreatedAt           sql.NullTime  `db:"created_at"`
	UpdatedAt           sql.NullTime  `db:"updated_at"`
}

type MetadataServiceMap

type MetadataServiceMap struct {
	Description   string        `db:"description"`
	MetadataID    int           `db:"metadata_id"`
	EnvironmentID sql.NullInt32 `db:"environment_id"`
	ArtifactID    sql.NullInt32 `db:"artifact_id"`
	NamespaceID   sql.NullInt32 `db:"namespace_id"`
	ClusterID     sql.NullInt32 `db:"cluster_id"`
	ServiceID     sql.NullInt32 `db:"service_id"`
	StackingOrder int           `db:"stacking_order"`
	CreatedAt     sql.NullTime  `db:"created_at"`
	UpdatedAt     sql.NullTime  `db:"updated_at"`
}

type MigrationLogger

type MigrationLogger struct {
	// contains filtered or unexported fields
}

func NewMigrationLogger

func NewMigrationLogger(debug bool) MigrationLogger

func (MigrationLogger) Printf

func (m MigrationLogger) Printf(format string, v ...interface{})

func (MigrationLogger) Verbose

func (m MigrationLogger) Verbose() bool

type Namespace

type Namespace struct {
	ID               int          `db:"id"`
	Name             string       `db:"name"`
	Alias            string       `db:"alias"`
	EnvironmentID    int          `db:"environment_id"`
	EnvironmentName  string       `db:"environment_name"`
	RequestedVersion string       `db:"requested_version"`
	ExplicitDeploy   bool         `db:"explicit_deploy"`
	ClusterID        int          `db:"cluster_id"`
	CreatedAt        sql.NullTime `db:"created_at"`
	UpdatedAt        sql.NullTime `db:"updated_at"`
}

type Namespaces

type Namespaces []Namespace

func (Namespaces) Contains

func (n Namespaces) Contains(name string) bool

func (Namespaces) FilterNamespaces

func (n Namespaces) FilterNamespaces(filter func(namespace Namespace) bool) (Namespaces, Namespaces)

func (Namespaces) ToAliases

func (n Namespaces) ToAliases() []string

func (Namespaces) ToIDs

func (n Namespaces) ToIDs() []int

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

func NotFoundErrorf

func NotFoundErrorf(format string, a ...interface{}) NotFoundError

func (NotFoundError) Error

func (e NotFoundError) Error() string

func (NotFoundError) IsEveError

func (e NotFoundError) IsEveError() bool

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

func NewRepo

func NewRepo(db *sqlx.DB) *Repo

func (*Repo) Artifact

func (r *Repo) Artifact(ctx context.Context) ([]Artifact, error)

func (*Repo) ArtifactByID

func (r *Repo) ArtifactByID(ctx context.Context, id int) (*Artifact, error)

func (*Repo) ArtifactByName

func (r *Repo) ArtifactByName(ctx context.Context, name string) (*Artifact, error)

func (*Repo) ArtifactsByProvider

func (r *Repo) ArtifactsByProvider(ctx context.Context, provider string) (Artifacts, error)

func (*Repo) ClusterByID

func (r *Repo) ClusterByID(ctx context.Context, id int) (*Cluster, error)

func (*Repo) Clusters

func (r *Repo) Clusters(ctx context.Context) ([]Cluster, error)

func (*Repo) ClustersByProvider

func (r *Repo) ClustersByProvider(ctx context.Context, provider string) (Artifacts, error)

func (*Repo) CreateArtifact

func (r *Repo) CreateArtifact(ctx context.Context, art *Artifact) error

func (*Repo) CreateCluster

func (r *Repo) CreateCluster(ctx context.Context, model *Cluster) error

func (*Repo) CreateDefinitionType

func (r *Repo) CreateDefinitionType(ctx context.Context, model *DefinitionType) error

func (*Repo) CreateDeployment

func (r *Repo) CreateDeployment(ctx context.Context, d *Deployment) error

func (*Repo) CreateDeploymentCronJob

func (r *Repo) CreateDeploymentCronJob(ctx context.Context, m *DeploymentCronJob) error

func (*Repo) CreateEnvironment

func (r *Repo) CreateEnvironment(ctx context.Context, model *Environment) error

func (*Repo) CreateEnvironmentFeedMap

func (r *Repo) CreateEnvironmentFeedMap(ctx context.Context, model *EnvironmentFeedMap) error

func (*Repo) CreateFeed

func (r *Repo) CreateFeed(ctx context.Context, model *Feed) error

func (*Repo) CreateJob

func (r *Repo) CreateJob(ctx context.Context, model *Job) error

func (*Repo) CreateMetadataJobMap

func (r *Repo) CreateMetadataJobMap(ctx context.Context, model *MetadataJobMap) error

func (*Repo) CreateMetadataServiceMap

func (r *Repo) CreateMetadataServiceMap(ctx context.Context, model *MetadataServiceMap) error

func (*Repo) CreateNamespace

func (r *Repo) CreateNamespace(ctx context.Context, ns *Namespace) error

func (*Repo) CreateService

func (r *Repo) CreateService(ctx context.Context, model *Service) error

func (*Repo) Definition

func (r *Repo) Definition(ctx context.Context) ([]Definition, error)

func (*Repo) DefinitionJobMaps

func (r *Repo) DefinitionJobMaps(ctx context.Context) ([]DefinitionJobMap, error)

func (*Repo) DefinitionServiceMaps

func (r *Repo) DefinitionServiceMaps(ctx context.Context) ([]DefinitionServiceMap, error)

func (*Repo) DefinitionTypes

func (r *Repo) DefinitionTypes(ctx context.Context) ([]DefinitionType, error)

func (*Repo) DeleteArtifact

func (r *Repo) DeleteArtifact(ctx context.Context, id int) error

func (*Repo) DeleteCluster

func (r *Repo) DeleteCluster(ctx context.Context, id int) error

func (*Repo) DeleteDefinition

func (r *Repo) DeleteDefinition(ctx context.Context, definitionID int) error

func (*Repo) DeleteDefinitionJobMap

func (r *Repo) DeleteDefinitionJobMap(ctx context.Context, definitionID int, mapDescription string) error

func (*Repo) DeleteDefinitionKey

func (r *Repo) DeleteDefinitionKey(ctx context.Context, definitionID int, key string) (*Definition, error)

func (*Repo) DeleteDefinitionServiceMap

func (r *Repo) DeleteDefinitionServiceMap(ctx context.Context, definitionID int, mapDescription string) error

func (*Repo) DeleteDefinitionType

func (r *Repo) DeleteDefinitionType(ctx context.Context, id int) error

func (*Repo) DeleteDeploymentCronJob

func (r *Repo) DeleteDeploymentCronJob(ctx context.Context, id string) error

func (*Repo) DeleteEnvironment

func (r *Repo) DeleteEnvironment(ctx context.Context, id int) error

func (*Repo) DeleteEnvironmentFeedMap

func (r *Repo) DeleteEnvironmentFeedMap(ctx context.Context, environmentID int, feedID int) error

func (*Repo) DeleteFeed

func (r *Repo) DeleteFeed(ctx context.Context, id int) error

func (*Repo) DeleteJob

func (r *Repo) DeleteJob(ctx context.Context, id int) error

func (*Repo) DeleteMetadata

func (r *Repo) DeleteMetadata(ctx context.Context, metadataID int) error

func (*Repo) DeleteMetadataJobMap

func (r *Repo) DeleteMetadataJobMap(ctx context.Context, metadataID int, mapDescription string) error

func (*Repo) DeleteMetadataKey

func (r *Repo) DeleteMetadataKey(ctx context.Context, metadataID int, key string) (*Metadata, error)

func (*Repo) DeleteMetadataServiceMap

func (r *Repo) DeleteMetadataServiceMap(ctx context.Context, metadataID int, mapDescription string) error

func (*Repo) DeleteNamespace

func (r *Repo) DeleteNamespace(ctx context.Context, id int) error

func (*Repo) DeleteService

func (r *Repo) DeleteService(ctx context.Context, id int) error

func (*Repo) DeployedJobsByNamespaceID

func (r *Repo) DeployedJobsByNamespaceID(ctx context.Context, namespaceID int) (DeployJobs, error)

func (*Repo) DeployedServicesByNamespaceID

func (r *Repo) DeployedServicesByNamespaceID(ctx context.Context, namespaceID int) (DeployServices, error)

func (*Repo) DeploymentByID

func (r *Repo) DeploymentByID(ctx context.Context, id uuid.UUID) (*Deployment, error)

func (*Repo) DeploymentCronJobs

func (r *Repo) DeploymentCronJobs(ctx context.Context) ([]DeploymentCronJob, error)

func (*Repo) EnvironmentByID

func (r *Repo) EnvironmentByID(ctx context.Context, id int) (*Environment, error)

func (*Repo) EnvironmentByName

func (r *Repo) EnvironmentByName(ctx context.Context, name string) (*Environment, error)

func (*Repo) EnvironmentFeedMaps

func (r *Repo) EnvironmentFeedMaps(ctx context.Context) ([]EnvironmentFeedMap, error)

func (*Repo) Environments

func (r *Repo) Environments(ctx context.Context) (Environments, error)

func (*Repo) FeedByAliasAndType

func (r *Repo) FeedByAliasAndType(ctx context.Context, alias, feedType string) (*Feed, error)

func (*Repo) Feeds

func (r *Repo) Feeds(ctx context.Context) ([]Feed, error)

func (*Repo) GetDefinition

func (r *Repo) GetDefinition(ctx context.Context, definitionID int) (*Definition, error)

func (*Repo) GetDefinitionByDescription

func (r *Repo) GetDefinitionByDescription(ctx context.Context, description string) (*Definition, error)

func (*Repo) GetMetadata

func (r *Repo) GetMetadata(ctx context.Context, metadataID int) (*Metadata, error)

func (*Repo) GetMetadataByDescription

func (r *Repo) GetMetadataByDescription(ctx context.Context, description string) (*Metadata, error)

func (*Repo) JobArtifacts

func (r *Repo) JobArtifacts(ctx context.Context, namespaceIDs []int) (RequestArtifacts, error)

func (*Repo) JobByID

func (r *Repo) JobByID(ctx context.Context, id int) (*Job, error)

func (*Repo) JobByName

func (r *Repo) JobByName(ctx context.Context, name string, namespace string) (*Job, error)

func (*Repo) JobDefinition

func (r *Repo) JobDefinition(ctx context.Context, jobID int) ([]DefinitionJob, error)

func (*Repo) JobDefinitionMapsByDefinitionID

func (r *Repo) JobDefinitionMapsByDefinitionID(ctx context.Context, definitionID int) ([]DefinitionJobMap, error)

func (*Repo) JobDefinitionMapsByJobID

func (r *Repo) JobDefinitionMapsByJobID(ctx context.Context, jobID int) ([]DefinitionJobMap, error)

func (*Repo) JobMetadata

func (r *Repo) JobMetadata(ctx context.Context, jobID int) ([]MetadataJob, error)

func (*Repo) JobMetadataMapsByJobID

func (r *Repo) JobMetadataMapsByJobID(ctx context.Context, jobID int) ([]MetadataJobMap, error)

func (*Repo) JobMetadataMapsByMetadataID

func (r *Repo) JobMetadataMapsByMetadataID(ctx context.Context, metadataID int) ([]MetadataJobMap, error)

func (*Repo) Jobs

func (r *Repo) Jobs(ctx context.Context, whereArgs ...WhereArg) ([]Job, error)

func (*Repo) JobsByNamespaceID

func (r *Repo) JobsByNamespaceID(ctx context.Context, namespaceID int) ([]Job, error)

func (*Repo) JobsByNamespaceName

func (r *Repo) JobsByNamespaceName(ctx context.Context, namespaceName string) ([]Job, error)

func (*Repo) Metadata

func (r *Repo) Metadata(ctx context.Context) ([]Metadata, error)

func (*Repo) MetadataHistory

func (r *Repo) MetadataHistory(ctx context.Context) ([]MetadataHistory, error)

func (*Repo) MetadataJobMaps

func (r *Repo) MetadataJobMaps(ctx context.Context) ([]MetadataJobMap, error)

func (*Repo) MetadataServiceMaps

func (r *Repo) MetadataServiceMaps(ctx context.Context) ([]MetadataServiceMap, error)

func (*Repo) NamespaceByID

func (r *Repo) NamespaceByID(ctx context.Context, id int) (*Namespace, error)

func (*Repo) NamespaceByName

func (r *Repo) NamespaceByName(ctx context.Context, name string) (*Namespace, error)

func (*Repo) Namespaces

func (r *Repo) Namespaces(ctx context.Context) (Namespaces, error)

func (*Repo) NamespacesByEnvironmentID

func (r *Repo) NamespacesByEnvironmentID(ctx context.Context, environmentID int) (Namespaces, error)

func (*Repo) NamespacesByEnvironmentName

func (r *Repo) NamespacesByEnvironmentName(ctx context.Context, environmentName string) (Namespaces, error)

func (*Repo) NextFeedByPromotionOrderType

func (r *Repo) NextFeedByPromotionOrderType(ctx context.Context, promotionOrder int, feedType string) (*Feed, error)

func (*Repo) PreviousFeedByPromotionOrderType

func (r *Repo) PreviousFeedByPromotionOrderType(ctx context.Context, promotionOrder int, feedType string) (*Feed, error)

func (*Repo) RequestJobArtifactByEnvironment

func (r *Repo) RequestJobArtifactByEnvironment(ctx context.Context, jobName, artifactName string, environmentID int, ns []int) (RequestArtifacts, error)

func (*Repo) RequestServiceArtifactByEnvironment

func (r *Repo) RequestServiceArtifactByEnvironment(ctx context.Context, serviceName, artifactName string, environmentID int, ns []int) (RequestArtifacts, error)

func (*Repo) ScheduleDeploymentCronJobs

func (r *Repo) ScheduleDeploymentCronJobs(ctx context.Context, schedule func(context.Context, *DeploymentCronJob) ([]uuid.UUID, error)) error

func (*Repo) ServiceArtifacts

func (r *Repo) ServiceArtifacts(ctx context.Context, namespaceIDs []int) (RequestArtifacts, error)

func (*Repo) ServiceByID

func (r *Repo) ServiceByID(ctx context.Context, id int) (*Service, error)

func (*Repo) ServiceByName

func (r *Repo) ServiceByName(ctx context.Context, name string, namespace string) (*Service, error)

func (*Repo) ServiceDefinition

func (r *Repo) ServiceDefinition(ctx context.Context, serviceID int) ([]DefinitionService, error)

func (*Repo) ServiceDefinitionMapsByDefinitionID

func (r *Repo) ServiceDefinitionMapsByDefinitionID(ctx context.Context, definitionID int) ([]DefinitionServiceMap, error)

func (*Repo) ServiceMetadata

func (r *Repo) ServiceMetadata(ctx context.Context, serviceID int) ([]MetadataService, error)

func (*Repo) ServiceMetadataMapsByMetadataID

func (r *Repo) ServiceMetadataMapsByMetadataID(ctx context.Context, metadataID int) ([]MetadataServiceMap, error)

func (*Repo) Services

func (r *Repo) Services(ctx context.Context, whereArgs ...WhereArg) ([]Service, error)

func (*Repo) ServicesByNamespaceID

func (r *Repo) ServicesByNamespaceID(ctx context.Context, namespaceID int) ([]Service, error)

func (*Repo) ServicesByNamespaceName

func (r *Repo) ServicesByNamespaceName(ctx context.Context, namespaceName string) ([]Service, error)

func (*Repo) UpdateArtifact

func (r *Repo) UpdateArtifact(ctx context.Context, model *Artifact) error

func (*Repo) UpdateCluster

func (r *Repo) UpdateCluster(ctx context.Context, model *Cluster) error

func (*Repo) UpdateDefinitionType

func (r *Repo) UpdateDefinitionType(ctx context.Context, m *DefinitionType) error

func (*Repo) UpdateDeployedJobVersion

func (r *Repo) UpdateDeployedJobVersion(ctx context.Context, id int, version string) error

func (*Repo) UpdateDeployedServiceVersion

func (r *Repo) UpdateDeployedServiceVersion(ctx context.Context, id int, version string) error

func (*Repo) UpdateDeploymentCronJob

func (r *Repo) UpdateDeploymentCronJob(ctx context.Context, m *DeploymentCronJob) error

func (*Repo) UpdateDeploymentCronState

func (r *Repo) UpdateDeploymentCronState(ctx context.Context, id uuid.UUID, state DeploymentCronState) error

func (*Repo) UpdateDeploymentMessageID

func (r *Repo) UpdateDeploymentMessageID(ctx context.Context, id uuid.UUID, messageID string) error

func (*Repo) UpdateDeploymentPlanLocation

func (r *Repo) UpdateDeploymentPlanLocation(ctx context.Context, id uuid.UUID, location json.Object) error

func (*Repo) UpdateDeploymentReceiptHandle

func (r *Repo) UpdateDeploymentReceiptHandle(ctx context.Context, id uuid.UUID, receiptHandle string) (*Deployment, error)

func (*Repo) UpdateDeploymentResult

func (r *Repo) UpdateDeploymentResult(ctx context.Context, id uuid.UUID) (*Deployment, error)

func (*Repo) UpdateEnvironment

func (r *Repo) UpdateEnvironment(ctx context.Context, environment *Environment) error

func (*Repo) UpdateEnvironmentFeedMap

func (r *Repo) UpdateEnvironmentFeedMap(ctx context.Context, model *EnvironmentFeedMap) error

func (*Repo) UpdateFeed

func (r *Repo) UpdateFeed(ctx context.Context, model *Feed) error

func (*Repo) UpdateFinishedJobs

func (r *Repo) UpdateFinishedJobs(ctx context.Context) error

func (*Repo) UpdateJob

func (r *Repo) UpdateJob(ctx context.Context, job *Job) error

func (*Repo) UpdateNamespace

func (r *Repo) UpdateNamespace(ctx context.Context, namespace *Namespace) error

func (*Repo) UpdateService

func (r *Repo) UpdateService(ctx context.Context, service *Service) error

func (*Repo) UpdateServiceCount

func (r *Repo) UpdateServiceCount(ctx context.Context, serviceID int, count int) error

func (*Repo) UpsertDefinition

func (r *Repo) UpsertDefinition(ctx context.Context, def *Definition) error

func (*Repo) UpsertDefinitionJobMap

func (r *Repo) UpsertDefinitionJobMap(ctx context.Context, djm *DefinitionJobMap) error

func (*Repo) UpsertDefinitionServiceMap

func (r *Repo) UpsertDefinitionServiceMap(ctx context.Context, dsm *DefinitionServiceMap) error

func (*Repo) UpsertMergeDefinition

func (r *Repo) UpsertMergeDefinition(ctx context.Context, def *Definition) error

func (*Repo) UpsertMergeMetadata

func (r *Repo) UpsertMergeMetadata(ctx context.Context, m *Metadata) error

func (*Repo) UpsertMetadata

func (r *Repo) UpsertMetadata(ctx context.Context, m *Metadata) error

func (*Repo) UpsertMetadataJobMap

func (r *Repo) UpsertMetadataJobMap(ctx context.Context, mjm *MetadataJobMap) error

func (*Repo) UpsertMetadataServiceMap

func (r *Repo) UpsertMetadataServiceMap(ctx context.Context, msm *MetadataServiceMap) error

type RequestArtifact

type RequestArtifact struct {
	ArtifactID       int    `db:"artifact_id"`
	ArtifactName     string `db:"artifact_name"`
	ProviderGroup    string `db:"provider_group"`
	FeedName         string `db:"feed_name"`
	FeedType         string `db:"feed_type"`
	RequestedVersion string `db:"requested_version"`
}

func (*RequestArtifact) Path

func (ra *RequestArtifact) Path() string

type RequestArtifacts

type RequestArtifacts []RequestArtifact

type Service

type Service struct {
	ID              int            `db:"id"`
	NamespaceID     int            `db:"namespace_id"`
	NamespaceName   string         `db:"namespace_name"`
	ArtifactID      int            `db:"artifact_id"`
	ArtifactName    string         `db:"artifact_name"`
	OverrideVersion sql.NullString `db:"override_version"`
	DeployedVersion sql.NullString `db:"deployed_version"`
	CreatedAt       sql.NullTime   `db:"created_at"`
	UpdatedAt       sql.NullTime   `db:"updated_at"`
	Name            string         `db:"name"`
	Count           int            `db:"count"`
}

type WhereArg

type WhereArg func(*WhereClause)

func AndWhere

func AndWhere(key string, value interface{}) WhereArg

func OrWhere

func OrWhere(key string, value interface{}) WhereArg

func Where

func Where(key string, value interface{}) WhereArg

func WhereIn

func WhereIn(key string, values []interface{}) WhereArg

type WhereClause

type WhereClause struct {
	// contains filtered or unexported fields
}

func (*WhereClause) AddClause

func (w *WhereClause) AddClause(value string, operator LogicalOperator, params ...interface{}) *WhereClause

func (*WhereClause) AppendToSql

func (w *WhereClause) AppendToSql(sql string) (string, []interface{})

func (WhereClause) Params

func (w WhereClause) Params() []interface{}

func (*WhereClause) Value

func (w *WhereClause) Value() string

Jump to

Keyboard shortcuts

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