cloudrunner

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Account     string   `json:"account" gorm:"primary_key"`
	ProjectID   string   `json:"projectID" binding:"required"`
	ReadGroups  []string `json:"readGroups,omitempty" gorm:"-"`
	WriteGroups []string `json:"writeGroups,omitempty" gorm:"-"`
}

type CredentialsReadPermission

type CredentialsReadPermission struct {
	Account   string `json:"accountName"`
	ID        string `json:"-" gorm:"primary_key"`
	ReadGroup string `json:"readGroup"`
}

type CredentialsWritePermission

type CredentialsWritePermission struct {
	Account    string `json:"accountName"`
	ID         string `json:"-" gorm:"primary_key"`
	WriteGroup string `json:"writeGroup"`
}

type Deployment

type Deployment struct {
	EndTime   *time.Time `json:"endTime,omitempty" gorm:"type:timestamp;DEFAULT:current_timestamp"`
	ID        string     `json:"id"`
	StartTime *time.Time `json:"startTime,omitempty" gorm:"type:timestamp;DEFAULT:current_timestamp"`
	Status    string     `json:"status"`
	// Column type MEDIUMTEXT holds ~16MB of data.
	Output  string `json:"output,omitempty" gorm:"type:mediumtext"`
	Command string `json:"command,omitempty" gorm:"-"`
}

Deployment describes a Cloud Run deployment.

I was a bit confused as to why creating this table was failing in GCP. There are two timestamp columns defined below, and in GCP it is required that timestamp columns MUST have a DEFAUL:CURRENT_TIMESTAMP. It was failing to create because StartTime was not defining its default to CURRENT_TIMESTAMP, but was not throwing the same error for EndTime.

That is because...

The first TIMESTAMP column in a table, if not declared with the NULL attribute or an explicit DEFAULT or ON UPDATE clause, is automatically assigned the DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP attributes.

See https://stackoverflow.com/a/39547074/3878752.

type DeploymentDescription

type DeploymentDescription struct {
	Account              string `json:"account"`
	AllowUnauthenticated bool   `json:"allowUnauthenticated"`
	ID                   string `json:"id"`
	Image                string `json:"image"`
	MaxInstances         int    `json:"maxInstances"`
	Memory               string `json:"memory"`
	Region               string `json:"region"`
	Service              string `json:"service"`
	VPCConnector         string `json:"vpcConnector"`
}

DeploymentDescription is a Cloud Run deployment request that describes the `gcloud run deploy` command to build.

Jump to

Keyboard shortcuts

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