model

package module
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AppExposeScope_External = "external"
	AppExposeScope_Cluster  = "cluster"
)
View Source
const (
	RevisionStatusWaiting   = "Waiting"
	RevisionStatusReady     = "Ready"
	RevisionStatusUnhealthy = "Unhealthy"
	RevisionStatusUnknown   = "Unknown"
)

Variables

This section is empty.

Functions

func RulesAppName

func RulesAppName() []validation.Rule

func RulesNamingIdentifier

func RulesNamingIdentifier() []validation.Rule

RulesNamingIdentifier returns rules for naming things (e.g. an app, environment) that are RFC 1035 subdomain compatible.

Types

type APIResponse

type APIResponse struct {
	Message string `json:"message"`
}

type App

type App struct {
	Id        uuid.UUID     `json:"id"`
	Name      AppName       `json:"name"`
	Namespace NamespaceName `json:"namespace"`
}

func (App) Validate added in v0.0.10

func (v App) Validate() error

type AppConfig

type AppConfig struct {
	Id                    uuid.UUID             `json:"id"`
	Name                  AppName               `json:"name"`
	Namespace             NamespaceName         `json:"namespace"`
	Expose                *AppConfigExpose      `json:"expose,omitempty"`
	HealthCheck           *AppConfigHealthCheck `json:"healthcheck,omitempty"`
	Image                 string                `json:"image"`
	OverrideableAppConfig `json:",inline"`
}

AppConfig is the root of the application config object graph without environment overrides

func (*AppConfig) ApplyDefaults added in v0.0.10

func (appConfig *AppConfig) ApplyDefaults() error

ApplyDefaults sets any unset values with their defaults

func (AppConfig) Validate

func (appConfig AppConfig) Validate() error

type AppConfigAutoscale

type AppConfigAutoscale struct {
	Min *int `json:"min,omitempty"`
	Max *int `json:"max,omitempty"`
}

type AppConfigExpose

type AppConfigExpose struct {
	ContainerPort int32  `json:"containerPort"`
	Protocol      string `json:"protocol,omitempty"`
	Scope         string `json:"scope,omitempty"`
}

type AppConfigHealthCheck

type AppConfigHealthCheck struct {
	Path string `json:"path,omitempty"`
}

Mode is not yet implemented (httpGet = default)

type AppConfigResources

type AppConfigResources struct {
	CpuCores *float32 `json:"cpuCores,omitempty"`
	MemoryMB *int32   `json:"memoryMB,omitempty"`
}

type AppConfigWithOverrides

type AppConfigWithOverrides struct {
	AppConfig `json:",inline"`
	Overrides map[string]OverrideableAppConfig `json:"environmentOverrides,omitempty"`
}

AppConfigWithOverrides contains an app with environment level overrides

func (*AppConfigWithOverrides) ApplyOverrides

func (cfg *AppConfigWithOverrides) ApplyOverrides(envName string) (*AppConfig, error)

type AppName added in v0.0.10

type AppName string

func (AppName) Validate added in v0.0.10

func (v AppName) Validate() error

type AppStatus

type AppStatus struct {
	AppId        uuid.UUID           `json:"appId"`
	Environments []EnvironmentStatus `json:"environments"`
	Deployments  []DeploymentStatus  `json:"deployments"`
}

type DeploymentDocker

type DeploymentDocker struct {
	Tag string `json:"tag"`
}

type DeploymentMeta

type DeploymentMeta struct {
	Name string `json:"name"`
	// Namespace is an intentional omission. We always use the app's namespace as we do not allow an app to deploy to multiple namespaces at
	// this time.
	Environment   string           `json:"environment"`
	Docker        DeploymentDocker `json:"docker"`
	ManualRollout bool             `json:"manualRollout"`
}

func (DeploymentMeta) Validate added in v0.0.10

func (d DeploymentMeta) Validate() error

type DeploymentRevisionStatus

type DeploymentRevisionStatus struct {
	Name                 string `json:"name"`
	DockerImage          string `json:"dockerImage"`
	RiserRevision        int64  `json:"riserRevision"`
	RevisionStatus       string `json:"revisionStatus"`
	RevisionStatusReason string `json:"revisionStatusReason,omitempty"`
}

type DeploymentStatus

type DeploymentStatus struct {
	AppId                   uuid.UUID `json:"appId"`
	DeploymentName          string    `json:"deployment"`
	Namespace               string    `json:"namespace"`
	EnvironmentName         string    `json:"environment"`
	RiserRevision           int64     `json:"riserRevision"`
	DeploymentStatusMutable `json:",inline"`
}

type DeploymentStatusMutable

type DeploymentStatusMutable struct {
	ObservedRiserRevision     int64                      `json:"observedRiserRevision"`
	Revisions                 []DeploymentRevisionStatus `json:"revisions,omitempty"`
	Traffic                   []DeploymentTrafficStatus  `json:"traffic,omitempty"`
	LatestCreatedRevisionName string                     `json:"latestCreatedRevisionName"`
	LatestReadyRevisionName   string                     `json:"latestReadyRevisionName"`
}

type DeploymentTrafficStatus

type DeploymentTrafficStatus struct {
	Percent      *int64 `json:"percent,omitempty"`
	RevisionName string `json:"revisionName"`
	Tag          string `json:"tag,omitempty"`
}

type DryRunCommit

type DryRunCommit struct {
	Message string       `json:"message"`
	Files   []DryRunFile `json:"files"`
}

type DryRunFile

type DryRunFile struct {
	Name     string `json:"name"`
	Contents string `json:"contents"`
}

type EnvironmentConfig added in v0.0.12

type EnvironmentConfig struct {
	SealedSecretCert  []byte `json:"sealedSecretCert,omitempty"`
	PublicGatewayHost string `json:"publicGatewayHost,omitempty"`
}

type EnvironmentMeta added in v0.0.12

type EnvironmentMeta struct {
	Name string
}

type EnvironmentStatus added in v0.0.12

type EnvironmentStatus struct {
	EnvironmentName string `json:"environmentName"`
	Healthy         bool   `json:"healthy"`
	Reason          string `json:"string"`
}

type Namespace added in v0.0.10

type Namespace struct {
	Name NamespaceName `json:"name"`
}

func (Namespace) Validate added in v0.0.10

func (v Namespace) Validate() error

type NamespaceName added in v0.0.10

type NamespaceName string

func (NamespaceName) Validate added in v0.0.10

func (v NamespaceName) Validate() error

type NewApp

type NewApp struct {
	Name      AppName       `json:"name"`
	Namespace NamespaceName `json:"namespace"`
}

func (NewApp) Validate added in v0.0.10

func (v NewApp) Validate() error

type OverrideableAppConfig added in v0.0.12

type OverrideableAppConfig struct {
	Autoscale   *AppConfigAutoscale           `json:"autoscale,omitempty"`
	Environment map[string]intstr.IntOrString `json:"env,omitempty"`
	Resources   *AppConfigResources           `json:"resources,omitempty"`
}

OverrideableAppConfig contains properties that are overrideable

type RolloutRequest

type RolloutRequest struct {
	Traffic []TrafficRule `json:"traffic"`
}

func (*RolloutRequest) Validate

func (rolloutRequest *RolloutRequest) Validate() error

type SaveDeploymentRequest added in v0.0.21

type SaveDeploymentRequest struct {
	DeploymentMeta `json:",inline"`
	App            *AppConfigWithOverrides `json:"app"`
}

func (*SaveDeploymentRequest) ApplyDefaults added in v0.0.21

func (d *SaveDeploymentRequest) ApplyDefaults() error

func (SaveDeploymentRequest) Validate added in v0.0.21

func (d SaveDeploymentRequest) Validate() error

type SaveDeploymentResponse added in v0.0.21

type SaveDeploymentResponse struct {
	RiserRevision int64          `json:"riserRevision"`
	Message       string         `json:"message"`
	DryRunCommits []DryRunCommit `json:"dryRunCommits,omitempty"`
}

type SecretMeta

type SecretMeta struct {
	Name        string        `json:"name"`
	AppName     AppName       `json:"app"`
	Namespace   NamespaceName `json:"namespace"`
	Environment string        `json:"environment"`
}

func (SecretMeta) Validate added in v0.0.10

func (v SecretMeta) Validate() error

type SecretMetaStatus

type SecretMetaStatus struct {
	SecretMeta `json:",inline"`
	Revision   int64 `json:"revision"`
}

type TrafficRule

type TrafficRule struct {
	RiserRevision int64 `json:"riserRevision"`
	Percent       int   `json:"percent"`
}

func (*TrafficRule) Validate

func (trafficRule *TrafficRule) Validate() error

type UnsealedSecret

type UnsealedSecret struct {
	SecretMeta `json:",inline"`
	PlainText  string `json:"plainTextValue"`
}

func (UnsealedSecret) Validate added in v0.0.10

func (v UnsealedSecret) Validate() error

Jump to

Keyboard shortcuts

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