db

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequiredTables = []cassandra.CTable{
	cassandra.CTable{
		Name: "builds_by_id",
		Columns: []string{
			"id uuid PRIMARY KEY",
			"request frozen<build_request>",
			"state text",
			"build_output text",
			"push_output text",
			"finished boolean",
			"failed boolean",
			"cancelled boolean",
			"started timestamp",
			"completed timestamp",
			"duration double",
		},
	},
	cassandra.CTable{
		Name: "build_metrics_by_id",
		Columns: []string{
			"id uuid PRIMARY KEY",
			"docker_build_started timestamp",
			"docker_build_completed timestamp",
			"docker_build_duration double",
			"push_started timestamp",
			"push_completed timestamp",
			"push_duration double",
			"clean_started timestamp",
			"clean_completed timestamp",
			"clean_duration double",
			"docker_image_size bigint",
			"docker_image_vsize bigint",
		},
	},
	cassandra.CTable{
		Name: "build_events_by_id",
		Columns: []string{
			"id uuid PRIMARY KEY",
			"build_output list<blob>",
			"push_output list<blob>",
		},
	},
}

RequiredTables are the tables we need defined in the DB

View Source
var RequiredUDTs = []cassandra.UDT{
	cassandra.UDT{
		Name: "build_request",
		Columns: []string{
			"github_repo text",
			"dockerfile_path text",
			"tags list<text>",
			"tag_with_commit_sha boolean",
			"ref text",
			"push_registry_repo text",
			"push_s3_region text",
			"push_s3_bucket text",
			"push_s3_key_prefix text",
		},
	},
}

RequiredUDTs are the UDTs we need defined in the DB

Functions

func BuildRequestFromUDT

func BuildRequestFromUDT(udt *BuildRequestUDT) *lib.BuildRequest

BuildRequestFromUDT constructs a BuildRequest from a UDT

func BuildStateFromString

func BuildStateFromString(state string) lib.BuildStatusResponse_BuildState

BuildStateFromString returns the enum value from the string stored in the DB

Types

type BuildRequestUDT

type BuildRequestUDT struct {
	GithubRepo       string   `cql:"github_repo"`
	DockerfilePath   string   `cql:"dockerfile_path"`
	Tags             []string `cql:"tags"`
	TagWithCommitSha bool     `cql:"tag_with_commit_sha"`
	Ref              string   `cql:"ref"`
	PushRegistryRepo string   `cql:"push_registry_repo"`
	PushS3Region     string   `cql:"push_s3_region"`
	PushS3Bucket     string   `cql:"push_s3_bucket"`
	PushS3KeyPrefix  string   `cql:"push_s3_key_prefix"`
}

BuildRequestUDT models BuildRequest in the database We need a separate explicit type for UDT that contains "cql:" tags (protobuf definitions can't have custom tags)

func UDTFromBuildRequest

func UDTFromBuildRequest(req *lib.BuildRequest) *BuildRequestUDT

UDTFromBuildRequest constructs a UDT struct from a BuildRequest

Jump to

Keyboard shortcuts

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