api

package module
v0.0.0-...-be24d6a Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 16 Imported by: 4

README

Deploys.app - API

Deploys.app API interfaces

Documentation

Index

Constants

View Source
const (
	ReValidNameStr     = `^[a-z][a-z0-9\-]*[a-z0-9]$`
	ReValidScheduleStr = `^((((\*(/\d+)?)|(\d+((-\d+)|(/\d+))?)),?)+\s?){5}$`
)
View Source
const (
	MinNameLength = 3
	MaxNameLength = 27
)

global

View Source
const (
	DeploymentMinReplicas = 1
	DeploymentMaxReplicas = 20
	DiskMaxSize           = 100
)

Deployments

View Source
const (
	DeploymentProtocolHTTP  = "http"
	DeploymentProtocolHTTPS = "https"
	DeploymentProtocolH2C   = "h2c"
)
View Source
const (
	DeploymentMetricsTimeRange1h     = "1h"
	DeploymentMetricsTimeRange6h     = "6h"
	DeploymentMetricsTimeRange12h    = "12h"
	DeploymentMetricsTimeRange1d     = "1d"
	DeploymentMetricsTimeRange1hagg  = "1hagg"
	DeploymentMetricsTimeRange6hagg  = "6hagg"
	DeploymentMetricsTimeRange12hagg = "12hagg"
	DeploymentMetricsTimeRange1dagg  = "1dagg"
	DeploymentMetricsTimeRange2dagg  = "2dagg"
	DeploymentMetricsTimeRange7dagg  = "7dagg"
	DeploymentMetricsTimeRange30dagg = "30dagg"
)
View Source
const (
	DiskMetricsTimeRange1h  = "1h"
	DiskMetricsTimeRange6h  = "6h"
	DiskMetricsTimeRange12h = "12h"
	DiskMetricsTimeRange1d  = "1d"
	DiskMetricsTimeRange2d  = "2d"
	DiskMetricsTimeRange7d  = "7d"
	DiskMetricsTimeRange30d = "30d"
)
View Source
const (
	PriceCPUUsage = 0.0006   // s
	PriceCPU      = 0.00025  // s
	PriceMemory   = 0.00007  // GiB/s
	PriceEgress   = 4        // GiB
	PriceDisk     = 0.000004 // GiB/s
	PriceReplica  = 0.000004 // replica/s
)

Variables

global

View Source
var (
	ErrUnauthorized                  = newError("api: unauthorized")
	ErrForbidden                     = newError("api: forbidden")
	ErrLocationNotAvailable          = newError("api: location not available")
	ErrLocationNotSupport            = newError("api: location not support")
	ErrSIDNotAvailable               = newError("api: sid not available")
	ErrRoleNotFound                  = newError("api: role not found")
	ErrRoleSIDNotAvailable           = newError("api: role sid not available")
	ErrProjectNotFound               = newError("api: project not found")
	ErrBillingAccountNotFound        = newError("api: billing account not found")
	ErrBillingAccountNotActive       = newError("api: billing account not active, please contact us via email to activate billing account")
	ErrBillingAccountInUsed          = newError("api: billing account in used")
	ErrDeploymentNotFound            = newError("api: deployment not found")
	ErrInvalidRouteTarget            = newError("api: invalid route target")
	ErrCanNotDelete                  = newError("api: can not delete")
	ErrCanNotPause                   = newError("api: can not pause")
	ErrCanNotResume                  = newError("api: can not resume")
	ErrWorkloadIdentityNotFound      = newError("api: workload identity not found")
	ErrWorkloadIdentityAlreadyExists = newError("api: workload identity already exists")
	ErrWorkloadIdentityInUse         = newError("api: workload identity in use")
	ErrUserNotFound                  = newError("api: user not found")
	ErrDomainNotAvailable            = newError("api: domain not available")
	ErrReplicasInvalid               = newError("api: replicas invalid")
	ErrCanMapOnlyWebService          = newError("api: can not map to deployment other than web service type")
	ErrScheduleInvalid               = newError("api: schedule invalid")
	ErrTypeInvalid                   = newError("api: type invalid")
	ErrTypeNotAllowChange            = newError("api: type not allow to change")
	ErrDiskNotFound                  = newError("api: disk not found")
	ErrDiskSizeMustScaleUp           = newError("api: disk size must scale up")
	ErrDiskAlreadyExists             = newError("api: disk already exists")
	ErrDiskInUsed                    = newError("api: disk in use")
	ErrPullSecretNameNotAvailable    = newError("api: pull secret name not available")
	ErrPullSecretNotFound            = newError("api: pull secret not found")
	ErrPullSecretInUse               = newError("api: pull secret in use")
	ErrServiceAccountNotFound        = newError("api: service account not found")
	ErrServiceAccountAlreadyExists   = newError("api: service account already exists")
	ErrMaximumDeploymentReach        = newError("api: maximum deployment reach")
	ErrRouteNotFound                 = newError("api: route not found")
	ErrDomainInUsed                  = newError("api: domain in used")
	ErrPurgeFailed                   = newError("api: purge failed")
	ErrDomainNotFound                = newError("api: domain not found")
	ErrDomainCanNotPurge             = newError("api: domain can not purge")
	ErrDomainPurgeInvalid            = newError("api: domain purge invalid")
	ErrDomainDisableCDNNotEnabled    = newError("api: domain disable cdn not enabled for this project")
	ErrEmailDomainNotFound           = newError("api: email domain not found")
)
View Source
var (
	ReValidSIDStr = `^[a-z][a-z0-9\-]*[^\-]$`
	ReValidSID    = regexp.MustCompile(ReValidSIDStr)
)
View Source
var AllErrors []error

Functions

func Bool

func Bool(b bool) *bool

func Int

func Int(i int) *int

func Int64

func Int64(i int64) *int64

func IsValidateError

func IsValidateError(err error) bool

func Permissions

func Permissions() []string

func RouteTargetPrefix

func RouteTargetPrefix() []string

func String

func String(s string) *string

func WrapValidate

func WrapValidate(v *validator.Validator) error

Types

type Action

type Action int
const (
	Create Action // create
	Delete        // delete
)

func (Action) MarshalJSON

func (a Action) MarshalJSON() ([]byte, error)

func (Action) String

func (i Action) String() string

func (*Action) UnmarshalJSON

func (a *Action) UnmarshalJSON(b []byte) error

type BillingCreate

type BillingCreate struct {
	Name       string `json:"name" yaml:"name"`
	TaxID      string `json:"taxId" yaml:"taxId"`
	TaxName    string `json:"taxName" yaml:"taxName"`
	TaxAddress string `json:"taxAddress" yaml:"taxAddress"`
}

func (*BillingCreate) Valid

func (m *BillingCreate) Valid() error

type BillingCreateResult

type BillingCreateResult struct {
	ID int64 `json:"id,string" yaml:"id"`
}

type BillingDelete

type BillingDelete struct {
	ID int64 `json:"id,string" yaml:"id"`
}

func (*BillingDelete) Valid

func (m *BillingDelete) Valid() error

type BillingGet

type BillingGet struct {
	ID int64 `json:"id,string" yaml:"id"`
}

func (*BillingGet) Valid

func (m *BillingGet) Valid() error

type BillingItem

type BillingItem struct {
	ID         int64  `json:"id,string" yaml:"id"`
	Name       string `json:"name" yaml:"name"`
	TaxID      string `json:"taxId" yaml:"taxId"`
	TaxName    string `json:"taxName" yaml:"taxName"`
	TaxAddress string `json:"taxAddress" yaml:"taxAddress"`
	Active     bool   `json:"active" yaml:"active"`
}

type BillingListResult

type BillingListResult struct {
	Items []*BillingItem `json:"items" yaml:"items"`
}

type BillingProject

type BillingProject struct {
	Project string `json:"project" yaml:"project"`
}

type BillingProjectResult

type BillingProjectResult struct {
	Price float64 `json:"price" yaml:"price"`
}

type BillingReport

type BillingReport struct {
	ID          int64    `json:"id,string" yaml:"id"`
	Range       string   `json:"range" yaml:"range"`
	ProjectSIDs []string `json:"projectSids" yaml:"projectSids"`
}

type BillingReportChart

type BillingReportChart struct {
	Categories []string                    `json:"categories" yaml:"categories"`
	Series     []*BillingReportChartSeries `json:"series" yaml:"series"`
}

type BillingReportChartSeries

type BillingReportChartSeries struct {
	Name string    `json:"name" yaml:"name"`
	Data []float64 `json:"data" yaml:"data"`
}

type BillingReportListItem

type BillingReportListItem struct {
	ProjectSID   string  `json:"projectSid" yaml:"projectSid"`
	Name         string  `json:"name" yaml:"name"`
	UsageValue   float64 `json:"usageValue" yaml:"usageValue"`
	BillingValue float64 `json:"billingValue" yaml:"billingValue"`
}

type BillingReportResult

type BillingReportResult struct {
	Range       string                   `json:"range" yaml:"range"`
	List        []*BillingReportListItem `json:"list" yaml:"list"`
	Chart       *BillingReportChart      `json:"chart" yaml:"chart"`
	ProjectList []*ReportProjectListItem `json:"projectList" yaml:"projectList"`
	ProjectSIDs []string                 `json:"projectSids" yaml:"projectSids"`
}

type BillingSKUs

type BillingSKUs struct {
	CPUUsage float64 `json:"cpuUsage" yaml:"cpuUsage"`
	CPU      float64 `json:"cpu" yaml:"cpu"`
	Memory   float64 `json:"memory" yaml:"memory"`
	Egress   float64 `json:"egress" yaml:"egress"`
	Disk     float64 `json:"disk" yaml:"disk"`
	Replica  float64 `json:"replica" yaml:"replica"`
}

type BillingUpdate

type BillingUpdate struct {
	ID         int64  `json:"id,string" yaml:"id"`
	Name       string `json:"name" yaml:"name"`
	TaxID      string `json:"taxId" yaml:"taxId"`
	TaxName    string `json:"taxName" yaml:"taxName"`
	TaxAddress string `json:"taxAddress" yaml:"taxAddress"`
}

func (*BillingUpdate) Valid

func (m *BillingUpdate) Valid() error

type CloudSQLProxySidecar

type CloudSQLProxySidecar struct {
	Instance    string `json:"instance" yaml:"instance"`
	Port        int    `json:"port" yaml:"port"`
	Credentials string `json:"credentials" yaml:"credentials"`
}

func (*CloudSQLProxySidecar) Valid

func (s *CloudSQLProxySidecar) Valid() error

type Collector

type Collector interface {
	Location(ctx context.Context, m *CollectorLocation) (*CollectorLocationResult, error)
	SetProjectUsage(ctx context.Context, m *CollectorSetProjectUsage) (*Empty, error)
	SetDeploymentUsage(ctx context.Context, m *CollectorSetDeploymentUsage) (*Empty, error)
	SetDiskUsage(ctx context.Context, m *CollectorSetDiskUsage) (*Empty, error)
}

type CollectorDeploymentUsageItem

type CollectorDeploymentUsageItem struct {
	ProjectID      int64   `json:"projectId,string" yaml:"projectId"`
	DeploymentName string  `json:"deploymentName" yaml:"deploymentName"`
	Pod            string  `json:"pod" yaml:"pod"`
	Name           string  `json:"name" yaml:"name"`
	Value          float64 `json:"value" yaml:"value"`
	At             int64   `json:"at" yaml:"at"`
}

type CollectorDiskUsageItem

type CollectorDiskUsageItem struct {
	ProjectID int64   `json:"projectId,string" yaml:"projectId"`
	DiskName  string  `json:"diskName" yaml:"diskName"`
	Name      string  `json:"name" yaml:"name"`
	Value     float64 `json:"value" yaml:"value"`
	At        int64   `json:"at" yaml:"at"`
}

type CollectorLocation

type CollectorLocation struct {
	Location string `json:"location" yaml:"location"`
}

type CollectorLocationResult

type CollectorLocationResult struct {
	Projects []*CollectorProject `json:"projects" yaml:"projects"`
}

type CollectorProject

type CollectorProject struct {
	ID int64 `json:"id,string" yaml:"id"`
}

type CollectorProjectUsageResource

type CollectorProjectUsageResource struct {
	Name  string `json:"name" yaml:"name"`
	Value string `json:"value" yaml:"value"` // decimal
}

type CollectorSetDeploymentUsage

type CollectorSetDeploymentUsage struct {
	Location string                          `json:"location" yaml:"location"`
	List     []*CollectorDeploymentUsageItem `json:"list" yaml:"list"`
}

type CollectorSetDiskUsage

type CollectorSetDiskUsage struct {
	Location string                    `json:"location" yaml:"location"`
	List     []*CollectorDiskUsageItem `json:"list" yaml:"list"`
}

type CollectorSetProjectUsage

type CollectorSetProjectUsage struct {
	Location  string                           `json:"location" yaml:"location"`
	ProjectID int64                            `json:"projectId,string" yaml:"projectId"`
	At        string                           `json:"at" yaml:"at"`
	Resources []*CollectorProjectUsageResource `json:"resources" yaml:"resources"`
}

type Database

type Database interface {
	Create(context.Context, *DatabaseCreate) (*Empty, error)
}

type DatabaseCreate

type DatabaseCreate struct {
	Project  string
	Location string
	Name     string
}

func (*DatabaseCreate) Valid

func (m *DatabaseCreate) Valid() error

type DatabaseDelete

type DatabaseDelete struct {
	Project string
	Name    string
}

func (*DatabaseDelete) Valid

func (m *DatabaseDelete) Valid() error

type DatabaseItem

type DatabaseItem struct {
	ID        int64
	ProjectID int64
	Location  string
	Name      string
	Status    Status
	Action    string
	CreatedAt time.Time
	CreatedBy string
	SuccessAt time.Time
}

type DatabaseList

type DatabaseList struct {
	Project  string `json:"project" yaml:"project"`
	Location string `json:"location" yaml:"location"`
}

func (*DatabaseList) Valid

func (m *DatabaseList) Valid() error

type DatabaseListResult

type DatabaseListResult struct {
	Items []*DatabaseItem
}

type Deployer

type Deployer interface {
	GetLocation(ctx context.Context, m *Empty) (*LocationItem, error)
	IsDomainActive(ctx context.Context, m *DeployerIsDomainActive) (bool, error)
	GetCommands(ctx context.Context, m *Empty) (*GetCommandsResult, error)
	SetResults(ctx context.Context, m *DeployerSetResult) (*Empty, error)
}

type DeployerCommandDeploymentDeploy

type DeployerCommandDeploymentDeploy struct {
	ID            int64                                        `json:"id"`
	ProjectID     int64                                        `json:"projectId"`
	Name          string                                       `json:"name"`
	Revision      int64                                        `json:"revision"`
	Type          DeploymentType                               `json:"type"`
	BillingConfig DeployerCommandDeploymentDeployBillingConfig `json:"config"`
	Spec          DeployerCommandDeploymentDeploySpec          `json:"spec"`
}

type DeployerCommandDeploymentDeployBillingConfig

type DeployerCommandDeploymentDeployBillingConfig struct {
	Pool      string `json:"pool"`
	SharePool bool   `json:"sharePool"`
}

type DeployerCommandDeploymentDeploySpec

type DeployerCommandDeploymentDeploySpec struct {
	Image                string             `json:"image"`
	Env                  map[string]string  `json:"env"`
	Command              []string           `json:"command"`
	Args                 []string           `json:"args"`
	WorkloadIdentityName string             `json:"workloadIdentityName"`
	MinReplicas          int                `json:"minReplicas"`
	MaxReplicas          int                `json:"maxReplicas"`
	Port                 int                `json:"port"`
	Protocol             DeploymentProtocol `json:"protocol"`
	Internal             bool               `json:"internal"`
	Schedule             string             `json:"schedule"`
	Annotations          map[string]string  `json:"annotations"`
	CPU                  string             `json:"cpu"`
	CPULimit             string             `json:"cpuLimit"`
	Memory               string             `json:"memory"`
	PullSecretName       string             `json:"pullSecretName"`
	DiskName             string             `json:"diskName"`
	DiskMountPath        string             `json:"diskMountPath"`
	DiskSubPath          string             `json:"diskSubPath"`
	MountData            map[string]string  `json:"mountData"` // file path => data
	Sidecars             []*Sidecar         `json:"sidecars"`
}

type DeployerCommandDeploymentMetadata

type DeployerCommandDeploymentMetadata struct {
	ID        int64          `json:"id"`
	ProjectID int64          `json:"projectId"`
	Name      string         `json:"name"`
	Revision  int64          `json:"revision"`
	Type      DeploymentType `json:"type"`
}

type DeployerCommandDiskCreate

type DeployerCommandDiskCreate struct {
	ID        int64  `json:"id"`
	ProjectID int64  `json:"projectId"`
	Name      string `json:"name"`
	Size      int64  `json:"size"`
}

type DeployerCommandItem

type DeployerCommandItem struct {
	PullSecretCreate       *DeployerCommandPullSecretCreate       `json:"pullSecretCreate,omitempty"`
	PullSecretDelete       *DeployerCommandMetadata               `json:"pullSecretDelete,omitempty"`
	WorkloadIdentityCreate *DeployerCommandWorkloadIdentityCreate `json:"workloadIdentityCreate,omitempty"`
	WorkloadIdentityDelete *DeployerCommandMetadata               `json:"workloadIdentityDelete,omitempty"`
	DiskCreate             *DeployerCommandDiskCreate             `json:"diskCreate,omitempty"`
	DiskDelete             *DeployerCommandMetadata               `json:"diskDelete,omitempty"`
	DeploymentDeploy       *DeployerCommandDeploymentDeploy       `json:"deploymentDeploy,omitempty"`
	DeploymentDelete       *DeployerCommandDeploymentMetadata     `json:"deploymentDelete,omitempty"`
	DeploymentPause        *DeployerCommandDeploymentMetadata     `json:"deploymentPause,omitempty"`
	DeploymentCleanup      *DeployerCommandDeploymentMetadata     `json:"deploymentCleanup,omitempty"`
	RouteCreate            *DeployerCommandRouteCreate            `json:"routeCreate,omitempty"`
	RouteDelete            *DeployerCommandRouteDelete            `json:"routeDelete,omitempty"`
}

type DeployerCommandMetadata

type DeployerCommandMetadata struct {
	ID        int64  `json:"id"`
	ProjectID int64  `json:"projectId"`
	Name      string `json:"name"`
}

type DeployerCommandPullSecretCreate

type DeployerCommandPullSecretCreate struct {
	ID        int64  `json:"id"`
	ProjectID int64  `json:"projectId"`
	Name      string `json:"name"`
	Value     string `json:"value"`
}

type DeployerCommandRouteCreate

type DeployerCommandRouteCreate struct {
	ID        int64       `json:"id"`
	ProjectID int64       `json:"projectId"`
	Domain    string      `json:"domain"`
	Path      string      `json:"path"`
	Target    string      `json:"target"`
	Config    RouteConfig `json:"config"`
}

type DeployerCommandRouteDelete

type DeployerCommandRouteDelete struct {
	ID        int64  `json:"id"`
	ProjectID int64  `json:"projectId"`
	Domain    string `json:"domain"`
}

type DeployerCommandWorkloadIdentityCreate

type DeployerCommandWorkloadIdentityCreate struct {
	ID        int64  `json:"id"`
	ProjectID int64  `json:"projectId"`
	Name      string `json:"name"`
	GSA       string `json:"gsa"`
}

type DeployerIsDomainActive

type DeployerIsDomainActive struct {
	Domain string `json:"domain"`
}

type DeployerSetResult

type DeployerSetResult []*DeployerSetResultItem

type DeployerSetResultItem

type DeployerSetResultItem struct {
	PullSecretCreate       *DeployerSetResultItemGeneral    `json:"pullSecretCreate,omitempty"`
	PullSecretDelete       *DeployerSetResultItemGeneral    `json:"pullSecretDelete,omitempty"`
	WorkloadIdentityCreate *DeployerSetResultItemGeneral    `json:"workloadIdentityCreate,omitempty"`
	WorkloadIdentityDelete *DeployerSetResultItemGeneral    `json:"workloadIdentityDelete,omitempty"`
	DiskCreate             *DeployerSetResultItemGeneral    `json:"diskCreate,omitempty"`
	DiskDelete             *DeployerSetResultItemGeneral    `json:"diskDelete,omitempty"`
	DeploymentDeploy       *DeployerSetResultItemDeploy     `json:"deploymentDeploy,omitempty"`
	DeploymentDelete       *DeployerSetResultItemGeneral    `json:"deploymentDelete,omitempty"`
	DeploymentPause        *DeployerSetResultItemDeployment `json:"deploymentPause,omitempty"`
	DeploymentCleanup      *DeployerSetResultItemDeployment `json:"deploymentCleanup,omitempty"`
	RouteCreate            *DeployerSetResultItemGeneral    `json:"routeCreate,omitempty"`
	RouteDelete            *DeployerSetResultItemGeneral    `json:"routeDelete,omitempty"`
}

type DeployerSetResultItemDeploy

type DeployerSetResultItemDeploy struct {
	ID       int64 `json:"id"`
	Revision int64 `json:"revision"`
	Success  bool  `json:"success"`
	NodePort *int  `json:"nodePort,omitempty"`
}

type DeployerSetResultItemDeployment

type DeployerSetResultItemDeployment struct {
	ID       int64 `json:"id"`
	Revision int64 `json:"revision"`
}

type DeployerSetResultItemGeneral

type DeployerSetResultItemGeneral struct {
	ID int64 `json:"id"`
}

type DeploymentAction

type DeploymentAction int
const (
	DeploymentActionDeploy DeploymentAction // deploy
	DeploymentActionDelete                  // delete
	DeploymentActionPause                   // pause
)

func (DeploymentAction) MarshalJSON

func (a DeploymentAction) MarshalJSON() ([]byte, error)

func (DeploymentAction) String

func (i DeploymentAction) String() string

func (*DeploymentAction) UnmarshalJSON

func (a *DeploymentAction) UnmarshalJSON(b []byte) error

type DeploymentDelete

type DeploymentDelete struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
}

func (*DeploymentDelete) Valid

func (m *DeploymentDelete) Valid() error

type DeploymentDeploy

type DeploymentDeploy struct {
	Project          string              `json:"project" yaml:"project"`
	Location         string              `json:"location" yaml:"location"`
	Name             string              `json:"name" yaml:"name"`
	Image            string              `json:"image" yaml:"image"`
	MinReplicas      *int                `json:"minReplicas" yaml:"minReplicas"`
	MaxReplicas      *int                `json:"maxReplicas" yaml:"maxReplicas"`
	Type             DeploymentType      `json:"type" yaml:"type"`
	Port             *int                `json:"port" yaml:"port"`
	Protocol         *DeploymentProtocol `json:"protocol" yaml:"protocol"`   // protocol for WebService
	Internal         *bool               `json:"internal" yaml:"internal"`   // run WebService as internal service
	Env              map[string]string   `json:"env" yaml:"env"`             // override all env
	AddEnv           map[string]string   `json:"addEnv" yaml:"addEnv"`       // add env to old revision env
	RemoveEnv        []string            `json:"removeEnv" yaml:"removeEnv"` // remove env from old revision env
	Command          []string            `json:"command" yaml:"command"`
	Args             []string            `json:"args" yaml:"args"`
	WorkloadIdentity *string             `json:"workloadIdentity" yaml:"workloadIdentity"` // workload identity name
	PullSecret       *string             `json:"pullSecret" yaml:"pullSecret"`             // pull secret name
	Disk             *DeploymentDisk     `json:"disk" yaml:"disk"`                         // type=Stateful
	Schedule         *string             `json:"schedule" yaml:"schedule"`                 // type=CronJob
	Resources        *DeploymentResource `json:"resources" yaml:"resources"`
	MountData        map[string]string   `json:"mountData" yaml:"mountData"`
	Sidecars         []*Sidecar          `json:"sidecars" yaml:"sidecars"`
}

func (*DeploymentDeploy) Valid

func (m *DeploymentDeploy) Valid() error

type DeploymentDisk

type DeploymentDisk struct {
	Name      string `json:"name" yaml:"name"`
	MountPath string `json:"mountPath" yaml:"mountPath"`
	SubPath   string `json:"subPath" yaml:"subPath"`
}

type DeploymentGet

type DeploymentGet struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
	Revision int    `json:"revision" yaml:"revision"` // 0 = latest
}

func (*DeploymentGet) Valid

func (m *DeploymentGet) Valid() error

type DeploymentItem

type DeploymentItem struct {
	Project          string             `json:"project" yaml:"project"`
	Location         string             `json:"location" yaml:"location"`
	Name             string             `json:"name" yaml:"name"`
	Type             DeploymentType     `json:"type" yaml:"type"`
	Revision         int64              `json:"revision" yaml:"revision"`
	Image            string             `json:"image" yaml:"image"`
	Env              map[string]string  `json:"env" yaml:"env"`
	Command          []string           `json:"command" yaml:"command"`
	Args             []string           `json:"args" yaml:"args"`
	WorkloadIdentity string             `json:"workloadIdentity" yaml:"workloadIdentity"`
	PullSecret       string             `json:"pullSecret" yaml:"pullSecret"`
	Disk             *DeploymentDisk    `json:"disk" yaml:"disk"`
	MountData        map[string]string  `json:"mountData" yaml:"mountData"`
	MinReplicas      int                `json:"minReplicas" yaml:"minReplicas"`
	MaxReplicas      int                `json:"maxReplicas" yaml:"maxReplicas"`
	Schedule         string             `json:"schedule" yaml:"schedule"`
	Port             int                `json:"port" yaml:"port"`
	Protocol         DeploymentProtocol `json:"protocol" yaml:"protocol"`
	Internal         bool               `json:"internal" yaml:"internal"`
	NodePort         int                `json:"nodePort" yaml:"nodePort"`
	Annotations      map[string]string  `json:"annotations" yaml:"annotations"`
	Resources        DeploymentResource `json:"resources" yaml:"resources"`
	Sidecars         []*Sidecar         `json:"sidecars" yaml:"sidecars"`
	URL              string             `json:"url" yaml:"url"`
	InternalURL      string             `json:"internalUrl" yaml:"internalUrl"`
	LogURL           string             `json:"logUrl" yaml:"logUrl"`
	EventURL         string             `json:"eventUrl" yaml:"eventUrl"`
	PodsURL          string             `json:"podsUrl" yaml:"podsUrl"`
	StatusURL        string             `json:"statusUrl" yaml:"statusUrl"`
	Address          string             `json:"address" yaml:"address"`
	InternalAddress  string             `json:"internalAddress" yaml:"internalAddress"`
	Status           Status             `json:"status" yaml:"status"`
	Action           DeploymentAction   `json:"action" yaml:"action"`
	AllocatedPrice   float64            `json:"allocatedPrice" yaml:"allocatedPrice"`
	CreatedAt        time.Time          `json:"createdAt" yaml:"createdAt"`
	CreatedBy        string             `json:"createdBy" yaml:"createdBy"`
	SuccessAt        time.Time          `json:"successAt" yaml:"successAt"`
}

type DeploymentList

type DeploymentList struct {
	Location string `json:"location" yaml:"location"` // optional
	Project  string `json:"project" yaml:"project"`
}

func (*DeploymentList) Valid

func (m *DeploymentList) Valid() error

type DeploymentListResult

type DeploymentListResult struct {
	Items []*DeploymentItem `json:"items" yaml:"items"`
}

func (*DeploymentListResult) Table

func (m *DeploymentListResult) Table() [][]string

type DeploymentMetrics

type DeploymentMetrics struct {
	Location  string                     `json:"location" yaml:"location"`
	Project   string                     `json:"project" yaml:"project"`
	Name      string                     `json:"name" yaml:"name"`
	TimeRange DeploymentMetricsTimeRange `json:"timeRange" yaml:"timeRange"`
}

func (*DeploymentMetrics) Valid

func (m *DeploymentMetrics) Valid() error

type DeploymentMetricsLine

type DeploymentMetricsLine struct {
	Name   string       `json:"name" yaml:"name"`
	Points [][2]float64 `json:"points" yaml:"points"`
}

type DeploymentMetricsResult

type DeploymentMetricsResult struct {
	CPUUsage    []*DeploymentMetricsLine `json:"cpuUsage" yaml:"cpuUsage"`
	CPULimit    []*DeploymentMetricsLine `json:"cpuLimit" yaml:"cpuLimit"`
	MemoryUsage []*DeploymentMetricsLine `json:"memoryUsage" yaml:"memoryUsage"`
	Memory      []*DeploymentMetricsLine `json:"memory" yaml:"memory"`
	MemoryLimit []*DeploymentMetricsLine `json:"memoryLimit" yaml:"memoryLimit"`
	Requests    []*DeploymentMetricsLine `json:"requests" yaml:"requests"`
	Egress      []*DeploymentMetricsLine `json:"egress" yaml:"egress"`
}

type DeploymentMetricsTimeRange

type DeploymentMetricsTimeRange string

type DeploymentPause

type DeploymentPause struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
}

func (*DeploymentPause) Valid

func (m *DeploymentPause) Valid() error

type DeploymentProtocol

type DeploymentProtocol string

type DeploymentResource

type DeploymentResource struct {
	Requests ResourceItem `json:"requests" yaml:"requests"`
	Limits   ResourceItem `json:"limits" yaml:"limits"`
}

type DeploymentResume

type DeploymentResume struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
}

func (*DeploymentResume) Valid

func (m *DeploymentResume) Valid() error

type DeploymentRevisions

type DeploymentRevisions struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
}

func (*DeploymentRevisions) Valid

func (m *DeploymentRevisions) Valid() error

type DeploymentRevisionsResult

type DeploymentRevisionsResult struct {
	Items []*DeploymentItem `json:"items" yaml:"items"`
}

type DeploymentRollback

type DeploymentRollback struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
	Revision int    `json:"revision" yaml:"revision"`
}

func (*DeploymentRollback) Valid

func (m *DeploymentRollback) Valid() error

type DeploymentType

type DeploymentType int
const (
	DeploymentTypeWebService DeploymentType
	DeploymentTypeWorker
	DeploymentTypeCronJob
	DeploymentTypeTCPService
	DeploymentTypeInternalTCPService
)

func ParseDeploymentTypeString

func ParseDeploymentTypeString(s string) DeploymentType

func (DeploymentType) HasExternalTCPAddress

func (t DeploymentType) HasExternalTCPAddress() bool

func (DeploymentType) HasInternalTCPAddress

func (t DeploymentType) HasInternalTCPAddress() bool

func (DeploymentType) Int

func (t DeploymentType) Int() int

func (DeploymentType) IsZero

func (t DeploymentType) IsZero() bool

func (DeploymentType) MarshalJSON

func (t DeploymentType) MarshalJSON() ([]byte, error)

func (DeploymentType) MarshalYAML

func (t DeploymentType) MarshalYAML() (any, error)

func (DeploymentType) String

func (t DeploymentType) String() string

func (DeploymentType) Text

func (t DeploymentType) Text() string

func (*DeploymentType) UnmarshalJSON

func (t *DeploymentType) UnmarshalJSON(b []byte) error

func (*DeploymentType) UnmarshalYAML

func (t *DeploymentType) UnmarshalYAML(unmarshal func(any) error) error

func (DeploymentType) Valid

func (t DeploymentType) Valid() bool

type Disk

type Disk interface {
	Create(ctx context.Context, m *DiskCreate) (*Empty, error)
	Get(ctx context.Context, m *DiskGet) (*DiskItem, error)
	List(ctx context.Context, m *DiskList) (*DiskListResult, error)
	Update(ctx context.Context, m *DiskUpdate) (*Empty, error)
	Delete(ctx context.Context, m *DiskDelete) (*Empty, error)
	Metrics(ctx context.Context, m *DiskMetrics) (*DiskMetricsResult, error)
}

type DiskCreate

type DiskCreate struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
	Size     int64  `json:"size" yaml:"size"`
}

func (*DiskCreate) Valid

func (m *DiskCreate) Valid() error

type DiskDelete

type DiskDelete struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
}

func (*DiskDelete) Valid

func (m *DiskDelete) Valid() error

type DiskGet

type DiskGet struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
}

func (*DiskGet) Valid

func (m *DiskGet) Valid() error

type DiskItem

type DiskItem struct {
	Project   string    `json:"project" yaml:"project"`
	Location  string    `json:"location" yaml:"location"`
	Name      string    `json:"name" yaml:"name"`
	Size      int64     `json:"size" yaml:"size"`
	Status    Status    `json:"status" yaml:"status"`
	Action    string    `json:"action" yaml:"action"`
	CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
	CreatedBy string    `json:"createdBy" yaml:"createdBy"`
	SuccessAt time.Time `json:"successAt" yaml:"successAt"`
}

func (*DiskItem) Table

func (m *DiskItem) Table() [][]string

type DiskList

type DiskList struct {
	Location string `json:"location" yaml:"location"` // optional
	Project  string `json:"project" yaml:"project"`
}

func (*DiskList) Valid

func (m *DiskList) Valid() error

type DiskListResult

type DiskListResult struct {
	Items []*DiskItem `json:"items" yaml:"items"`
}

func (*DiskListResult) Table

func (m *DiskListResult) Table() [][]string

type DiskMetrics

type DiskMetrics struct {
	Location  string               `json:"location" yaml:"location"`
	Project   string               `json:"project" yaml:"project"`
	Name      string               `json:"name" yaml:"name"`
	TimeRange DiskMetricsTimeRange `json:"timeRange" yaml:"timeRange"`
}

func (*DiskMetrics) Valid

func (m *DiskMetrics) Valid() error

type DiskMetricsLine

type DiskMetricsLine struct {
	Name   string       `json:"name" yaml:"name"`
	Points [][2]float64 `json:"points" yaml:"points"`
}

type DiskMetricsResult

type DiskMetricsResult struct {
	Usage []*DiskMetricsLine `json:"usage" yaml:"usage"`
	Size  []*DiskMetricsLine `json:"size" yaml:"size"`
}

type DiskMetricsTimeRange

type DiskMetricsTimeRange string

type DiskUpdate

type DiskUpdate struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
	Size     int64  `json:"size" yaml:"size"`
}

func (*DiskUpdate) Valid

func (m *DiskUpdate) Valid() error

type Domain

type Domain interface {
	Create(ctx context.Context, m *DomainCreate) (*Empty, error)
	Get(ctx context.Context, m *DomainGet) (*DomainItem, error)
	List(ctx context.Context, m *DomainList) (*DomainListResult, error)
	Delete(ctx context.Context, m *DomainDelete) (*Empty, error)
	PurgeCache(ctx context.Context, m *DomainPurgeCache) (*Empty, error)
}

type DomainCreate

type DomainCreate struct {
	Project  string     `json:"project" yaml:"project"`
	Location string     `json:"location" yaml:"location"`
	Domain   string     `json:"domain" yaml:"domain"`
	Wildcard bool       `json:"wildcard" yaml:"wildcard"`
	CDN      bool       `json:"cdn" yaml:"cdn"`
	Type     DomainType `json:"type" yaml:"type"` // deprecated
}

func (*DomainCreate) Valid

func (m *DomainCreate) Valid() error

type DomainDNSConfig

type DomainDNSConfig struct {
	IPv4  []string `json:"ipv4" yaml:"ipv4"`
	IPv6  []string `json:"ipv6" yaml:"ipv6"`
	CName []string `json:"cname" yaml:"cname"`
}

type DomainDelete

type DomainDelete struct {
	Project string `json:"project" yaml:"project"`
	Domain  string `json:"domain" yaml:"domain"`
}

func (*DomainDelete) Valid

func (m *DomainDelete) Valid() error

type DomainGet

type DomainGet struct {
	Project string `json:"project" yaml:"project"`
	Domain  string `json:"domain" yaml:"domain"`
}

func (*DomainGet) Valid

func (m *DomainGet) Valid() error

type DomainItem

type DomainItem struct {
	Project      string             `json:"project" yaml:"project"`
	Location     string             `json:"location" yaml:"location"`
	Domain       string             `json:"domain" yaml:"domain"`
	Type         DomainType         `json:"type" yaml:"type"` // deprecated
	Wildcard     bool               `json:"wildcard" yaml:"wildcard"`
	CDN          bool               `json:"cdn" yaml:"cdn"`
	Verification DomainVerification `json:"verification" yaml:"verification"`
	DNSConfig    DomainDNSConfig    `json:"dnsConfig" yaml:"dnsConfig"`
	Status       DomainStatus       `json:"status" yaml:"status"`
	CreatedAt    time.Time          `json:"createdAt" yaml:"createdAt"`
	CreatedBy    string             `json:"createdBy" yaml:"createdBy"`
}

type DomainList

type DomainList struct {
	Project  string `json:"project" yaml:"project"`
	Location string `json:"location" yaml:"location"`
}

func (*DomainList) Valid

func (m *DomainList) Valid() error

type DomainListResult

type DomainListResult struct {
	Items []*DomainItem `json:"items" yaml:"items"`
}

func (*DomainListResult) Table

func (m *DomainListResult) Table() [][]string

type DomainPurgeCache

type DomainPurgeCache struct {
	Project string `json:"project" yaml:"project"`
	Domain  string `json:"domain" yaml:"domain"`
	File    string `json:"file" yaml:"file"`
	Prefix  string `json:"prefix" yaml:"prefix"`
}

func (*DomainPurgeCache) Valid

func (m *DomainPurgeCache) Valid() error

type DomainStatus

type DomainStatus int
const (
	DomainStatusPending DomainStatus = iota // pending
	DomainStatusSuccess                     // success
	DomainStatusError                       // error
	DomainStatusVerify                      // verify
)

func (DomainStatus) MarshalJSON

func (s DomainStatus) MarshalJSON() ([]byte, error)

func (DomainStatus) MarshalYAML

func (s DomainStatus) MarshalYAML() (any, error)

func (DomainStatus) String

func (i DomainStatus) String() string

func (*DomainStatus) UnmarshalJSON

func (s *DomainStatus) UnmarshalJSON(b []byte) error

func (*DomainStatus) UnmarshalYAML

func (s *DomainStatus) UnmarshalYAML(unmarshal func(any) error) error

type DomainType

type DomainType int
const (
	DomainTypeCloudflare DomainType // cloudflare
	DomainTypeHostname              // hostname
	DomainTypeWildcard              // wildcard
)

func (DomainType) MarshalJSON

func (t DomainType) MarshalJSON() ([]byte, error)

func (DomainType) String

func (i DomainType) String() string

func (*DomainType) UnmarshalJSON

func (t *DomainType) UnmarshalJSON(b []byte) error

func (DomainType) Valid

func (t DomainType) Valid() bool

type DomainVerification

type DomainVerification struct {
	Ownership DomainVerificationOwnership `json:"ownership"`
	SSL       DomainVerificationSSL       `json:"ssl"`
}

type DomainVerificationOwnership

type DomainVerificationOwnership struct {
	Type   string   `json:"type"`
	Name   string   `json:"name"`
	Value  string   `json:"value"`
	Errors []string `json:"errors"`
}

type DomainVerificationSSL

type DomainVerificationSSL struct {
	Pending bool                          `json:"pending"`
	DCV     DomainVerificationSSLDCV      `json:"dcv"`
	Records []DomainVerificationSSLRecord `json:"records"`
	Errors  []string                      `json:"errors"`
}

type DomainVerificationSSLDCV

type DomainVerificationSSLDCV struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type DomainVerificationSSLRecord

type DomainVerificationSSLRecord struct {
	TxtName  string `json:"txtName"`
	TxtValue string `json:"txtValue"`
}

type Email

type Email interface {
	Send(ctx context.Context, m *EmailSend) (*Empty, error)
	List(ctx context.Context, m *EmailList) (*EmailListResult, error)
}

type EmailAddr

type EmailAddr struct {
	Email string `json:"email" yaml:"email"`
	Name  string `json:"name" yaml:"name"`
}

func (EmailAddr) Address

func (a EmailAddr) Address() string

func (*EmailAddr) IsZero

func (a *EmailAddr) IsZero() bool

func (*EmailAddr) UnmarshalJSON

func (a *EmailAddr) UnmarshalJSON(b []byte) error

func (*EmailAddr) Valid

func (a *EmailAddr) Valid() bool

type EmailBody

type EmailBody struct {
	Type    EmailType `json:"type" yaml:"type"`
	Content string    `json:"content" yaml:"content"`
}

type EmailItem

type EmailItem struct {
	Domain    string    `json:"domain" yaml:"domain"`
	CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
}

type EmailList

type EmailList struct {
	Project string `json:"project" yaml:"project"`
}

func (*EmailList) Valid

func (m *EmailList) Valid() error

type EmailListResult

type EmailListResult struct {
	Items []*EmailItem `json:"items"`
}

type EmailSend

type EmailSend struct {
	Project string      `json:"project" yaml:"project"`
	From    EmailAddr   `json:"from" yaml:"from"`
	To      []EmailAddr `json:"to" yaml:"to"`
	Subject string      `json:"subject" yaml:"subject"`
	Body    EmailBody   `json:"body" yaml:"body"`
}

func (*EmailSend) Valid

func (m *EmailSend) Valid() error

type EmailType

type EmailType string
const (
	EmailTypeText EmailType = "text/plain"
	EmailTypeHTML EmailType = "text/html"
)

func (EmailType) Valid

func (t EmailType) Valid() bool

type Empty

type Empty struct{}

func (*Empty) Table

func (*Empty) Table() [][]string

func (*Empty) UnmarshalRequest

func (*Empty) UnmarshalRequest(r *http.Request) error

type GetCommandsResult

type GetCommandsResult []*DeployerCommandItem

type Interface

type Interface interface {
	Me() Me
	Billing() Billing
	Location() Location
	Project() Project
	Role() Role
	Deployment() Deployment
	Domain() Domain
	Route() Route
	Disk() Disk
	PullSecret() PullSecret
	WorkloadIdentity() WorkloadIdentity
	ServiceAccount() ServiceAccount
	Email() Email
	Collector() Collector
	Deployer() Deployer
}

type Location

type Location interface {
	List(ctx context.Context, m *LocationList) (*LocationListResult, error)
	Get(ctx context.Context, m *LocationGet) (*LocationItem, error)
}

type LocationFeatures

type LocationFeatures struct {
	WorkloadIdentity bool      `json:"workloadIdentity,omitempty" yaml:"workloadIdentity"`
	Disk             *struct{} `json:"disk,omitempty" yaml:"disk"`
}

type LocationGet

type LocationGet struct {
	ID string `json:"id" yaml:"id"`
}

func (*LocationGet) Valid

func (m *LocationGet) Valid() error

type LocationItem

type LocationItem struct {
	ID                string           `json:"id" yaml:"id"`
	DomainSuffix      string           `json:"domainSuffix" yaml:"domainSuffix"`
	Endpoint          string           `json:"endpoint" yaml:"endpoint"`
	CName             string           `json:"cname" yaml:"cname"`
	FreeTier          bool             `json:"freeTier" yaml:"freeTier"`
	CPUAllocatable    []string         `json:"cpuAllocatable" yaml:"cpuAllocatable"`
	MemoryAllocatable []string         `json:"memoryAllocatable" yaml:"memoryAllocatable"`
	Features          LocationFeatures `json:"features" yaml:"features"`
	CreatedAt         time.Time        `json:"createdAt" yaml:"createdAt"`
}

func (*LocationItem) Table

func (m *LocationItem) Table() [][]string

type LocationList

type LocationList struct {
	Project string `json:"project" yaml:"project"` // optional
}

type LocationListResult

type LocationListResult struct {
	Items []*LocationItem `json:"items" yaml:"items"`
}

func (*LocationListResult) Table

func (m *LocationListResult) Table() [][]string

type Me

type Me interface {
	Get(ctx context.Context, _ *Empty) (*MeItem, error)
	Authorized(ctx context.Context, m *MeAuthorized) (*MeAuthorizedResult, error)
	UploadKYCDocument(ctx context.Context, m *MeUploadKYCDocument) (*MeUploadKYCDocumentResult, error)
}

type MeAuthorized

type MeAuthorized struct {
	ProjectID   int64    `json:"projectId,string" yaml:"projectId"`
	Project     string   `json:"project" yaml:"project"`
	Permissions []string `json:"permissions" yaml:"permissions"`
}

type MeAuthorizedResult

type MeAuthorizedResult struct {
	Authorized bool `json:"authorized" yaml:"authorized"`
	Project    struct {
		ID             int64  `json:"id,string" yaml:"id"`
		Project        string `json:"project" yaml:"project"`
		BillingAccount struct {
			Active bool `json:"active" yaml:"active"`
		} `json:"billingAccount" yaml:"billingAccount"`
	} `json:"project" yaml:"project"`
}

func (*MeAuthorizedResult) Table

func (m *MeAuthorizedResult) Table() [][]string

type MeItem

type MeItem struct {
	Email string `json:"email" yaml:"email"`
	KYC   bool   `json:"kyc" yaml:"kyc"`
}

func (*MeItem) Table

func (m *MeItem) Table() [][]string

type MeUploadKYCDocument

type MeUploadKYCDocument struct {
	File *multipart.FileHeader
}

func (*MeUploadKYCDocument) UnmarshalMultipartForm

func (m *MeUploadKYCDocument) UnmarshalMultipartForm(v *multipart.Form) error

type MeUploadKYCDocumentResult

type MeUploadKYCDocumentResult struct {
	DocumentID int64 `json:"documentId" yaml:"documentId"`
}

type Project

type Project interface {
	Create(ctx context.Context, m *ProjectCreate) (*Empty, error)
	Get(ctx context.Context, m *ProjectGet) (*ProjectItem, error)
	List(ctx context.Context, m *Empty) (*ProjectListResult, error)
	Update(ctx context.Context, m *ProjectUpdate) (*Empty, error)
	Delete(ctx context.Context, m *ProjectDelete) (*Empty, error)
	Usage(ctx context.Context, m *ProjectUsage) (*ProjectUsageResult, error)
}

type ProjectConfig

type ProjectConfig struct {
	DomainAllowDisableCDN bool `json:"domainAllowDisableCdn" yaml:"domainAllowDisableCDN"`
}

type ProjectCreate

type ProjectCreate struct {
	SID            string `json:"sid" yaml:"sid"`
	Name           string `json:"name" yaml:"name"`
	BillingAccount int64  `json:"billingAccount,string" yaml:"billingAccount"`
}

func (*ProjectCreate) Valid

func (m *ProjectCreate) Valid() error

type ProjectDelete

type ProjectDelete struct {
	Project string `json:"project" yaml:"project"`
}

type ProjectGet

type ProjectGet struct {
	Project string `json:"project" yaml:"project"`
}

type ProjectItem

type ProjectItem struct {
	ID             int64         `json:"id,string" yaml:"id"`
	Project        string        `json:"project" yaml:"project"`
	Name           string        `json:"name" yaml:"name"`
	BillingAccount int64         `json:"billingAccount,string" yaml:"billingAccount"`
	Quota          ProjectQuota  `json:"quota" yaml:"quota"`
	Config         ProjectConfig `json:"config" yaml:"config"`
	CreatedAt      time.Time     `json:"createdAt" yaml:"createdAt"`
}

func (*ProjectItem) Table

func (m *ProjectItem) Table() [][]string

type ProjectListResult

type ProjectListResult struct {
	Items []*ProjectItem `json:"items" yaml:"items"`
}

func (*ProjectListResult) Table

func (m *ProjectListResult) Table() [][]string

type ProjectQuota

type ProjectQuota struct {
	Deployments           int `json:"deployments" yaml:"deployments"`
	DeploymentMaxReplicas int `json:"deploymentMaxReplicas" yaml:"deploymentMaxReplicas"`
}

type ProjectUpdate

type ProjectUpdate struct {
	Project        string  `json:"project" yaml:"project"`
	Name           *string `json:"name" yaml:"name"`
	BillingAccount *int64  `json:"billingAccount,string" yaml:"billingAccount"`
}

func (*ProjectUpdate) Valid

func (m *ProjectUpdate) Valid() error

type ProjectUsage

type ProjectUsage struct {
	Project string `json:"project" yaml:"project"`
}

type ProjectUsageResult

type ProjectUsageResult struct {
	CPUUsage float64 `json:"cpuUsage" yaml:"cpuUsage"`
	CPU      float64 `json:"cpu" yaml:"cpu"`
	Memory   float64 `json:"memory" yaml:"memory"`
	Egress   float64 `json:"egress" yaml:"egress"`
	Disk     float64 `json:"disk" yaml:"disk"`
	Replica  float64 `json:"replica" yaml:"replica"`
}

func (*ProjectUsageResult) Table

func (m *ProjectUsageResult) Table() [][]string

type PullSecret

type PullSecret interface {
	Create(ctx context.Context, m *PullSecretCreate) (*Empty, error)
	Get(ctx context.Context, m *PullSecretGet) (*PullSecretItem, error)
	List(ctx context.Context, m *PullSecretList) (*PullSecretListResult, error)
	Delete(ctx context.Context, m *PullSecretDelete) (*Empty, error)
}

type PullSecretCreate

type PullSecretCreate struct {
	Project  string         `json:"project" yaml:"project"`
	Location string         `json:"location" yaml:"location"`
	Name     string         `json:"name" yaml:"name"`
	Spec     PullSecretSpec `json:"spec" yaml:"spec"`
}

func (*PullSecretCreate) Valid

func (m *PullSecretCreate) Valid() error

type PullSecretDelete

type PullSecretDelete struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
}

func (*PullSecretDelete) Valid

func (m *PullSecretDelete) Valid() error

type PullSecretGet

type PullSecretGet struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
}

func (*PullSecretGet) Valid

func (m *PullSecretGet) Valid() error

type PullSecretItem

type PullSecretItem struct {
	Name      string         `json:"name" yaml:"name"`
	Value     string         `json:"value" yaml:"value"`
	Spec      PullSecretSpec `json:"spec" yaml:"spec"`
	Location  string         `json:"location" yaml:"location"`
	Action    Action         `json:"action" yaml:"action"`
	Status    Status         `json:"status" yaml:"status"`
	CreatedAt time.Time      `json:"createdAt" yaml:"createdAt"`
	CreatedBy string         `json:"createdBy" yaml:"createdBy"`
}

func (*PullSecretItem) Table

func (m *PullSecretItem) Table() [][]string

type PullSecretList

type PullSecretList struct {
	Project  string `json:"project" yaml:"project"`
	Location string `json:"location" yaml:"location"`
}

func (*PullSecretList) Valid

func (m *PullSecretList) Valid() error

type PullSecretListResult

type PullSecretListResult struct {
	Project  string            `json:"project" yaml:"project"`
	Location string            `json:"location" yaml:"location"`
	Items    []*PullSecretItem `json:"items" yaml:"items"`
}

func (*PullSecretListResult) Table

func (m *PullSecretListResult) Table() [][]string

type PullSecretSpec

type PullSecretSpec struct {
	Server   string `json:"server" yaml:"server"`
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
}

type ReportProjectListItem

type ReportProjectListItem struct {
	SID  string `json:"sid" yaml:"sid"`
	Name string `json:"name" yaml:"name"`
}

type ResourceItem

type ResourceItem struct {
	// CPU    string `json:"cpu" yaml:"cpu"`
	Memory string `json:"memory" yaml:"memory"`
}

type Role

type Role interface {
	Create(ctx context.Context, m *RoleCreate) (*Empty, error)
	List(ctx context.Context, m *RoleList) (*RoleListResult, error)
	Get(ctx context.Context, m *RoleGet) (*RoleGetResult, error)
	Delete(ctx context.Context, m *RoleDelete) (*Empty, error)
	Grant(ctx context.Context, m *RoleGrant) (*Empty, error)
	Revoke(ctx context.Context, m *RoleRevoke) (*Empty, error)
	Users(ctx context.Context, m *RoleUsers) (*RoleUsersResult, error)
	Bind(ctx context.Context, m *RoleBind) (*Empty, error)
	Permissions(ctx context.Context, _ *Empty) ([]string, error)
}

type RoleBind

type RoleBind struct {
	Project string   `json:"project" yaml:"project"`
	Email   string   `json:"email" yaml:"email"`
	Roles   []string `json:"roles" yaml:"roles"`
}

type RoleCreate

type RoleCreate struct {
	Project     string   `json:"project" yaml:"project"` // project sid
	Role        string   `json:"role" yaml:"role"`       // role sid
	Name        string   `json:"name" yaml:"name"`       // role name (free text)
	Permissions []string `json:"permissions" yaml:"permissions"`
}

func (*RoleCreate) Valid

func (m *RoleCreate) Valid() error

type RoleDelete

type RoleDelete struct {
	Project string `json:"project" yaml:"project"`
	Role    string `json:"role" yaml:"role"`
}

func (*RoleDelete) Valid

func (m *RoleDelete) Valid() error

type RoleGet

type RoleGet struct {
	Project string `json:"project" yaml:"project"` // project sid
	Role    string `json:"role" yaml:"role"`       // role sid
}

type RoleGetResult

type RoleGetResult struct {
	Role        string    `json:"role" yaml:"role"`       // role sid
	Project     string    `json:"project" yaml:"project"` // project sid
	Name        string    `json:"name" yaml:"name"`       // role name
	Permissions []string  `json:"permissions" yaml:"permissions"`
	CreatedAt   time.Time `json:"createdAt" yaml:"createdAt"`
}

func (*RoleGetResult) Table

func (m *RoleGetResult) Table() [][]string

type RoleGrant

type RoleGrant struct {
	Project string `json:"project" yaml:"project"` // project sid
	Role    string `json:"role" yaml:"role"`       // role sid
	Email   string `json:"email" yaml:"email"`     // user email
}

func (*RoleGrant) Valid

func (m *RoleGrant) Valid() error

type RoleList

type RoleList struct {
	Project string // project sid
}

type RoleListItem

type RoleListItem struct {
	Role        string    `json:"role" yaml:"role"` // role sid
	Name        string    `json:"name" yaml:"name"` // role name
	Permissions []string  `json:"permissions" yaml:"permissions"`
	CreatedAt   time.Time `json:"createdAt" yaml:"createdAt"`
	CreatedBy   string    `json:"createdBy" yaml:"createdBy"`
}

type RoleListResult

type RoleListResult struct {
	Project string          `json:"project" yaml:"project"`
	Items   []*RoleListItem `json:"items" yaml:"items"`
}

func (*RoleListResult) Table

func (m *RoleListResult) Table() [][]string

type RoleRevoke

type RoleRevoke struct {
	Project string `json:"project" yaml:"project"` // project sid
	Role    string `json:"role" yaml:"role"`       // role sid
	Email   string `json:"email" yaml:"email"`     // user email
}

func (*RoleRevoke) Valid

func (m *RoleRevoke) Valid() error

type RoleUsers

type RoleUsers struct {
	Project string `json:"project" yaml:"project"` // project sid
}

func (*RoleUsers) Valid

func (m *RoleUsers) Valid() error

type RoleUsersItem

type RoleUsersItem struct {
	Email string   `json:"email" yaml:"email"`
	Roles []string `json:"roles" yaml:"roles"`
}

type RoleUsersResult

type RoleUsersResult struct {
	Project string           `json:"project" yaml:"project"`
	Items   []*RoleUsersItem `json:"items" yaml:"items"`
	Users   []*RoleUsersItem `json:"users" yaml:"users"`
}

func (*RoleUsersResult) Table

func (m *RoleUsersResult) Table() [][]string

type Route

type Route interface {
	Create(ctx context.Context, m *RouteCreate) (*Empty, error)
	CreateV2(ctx context.Context, m *RouteCreateV2) (*Empty, error)
	Get(ctx context.Context, m *RouteGet) (*RouteItem, error)
	List(ctx context.Context, m *RouteList) (*RouteListResult, error)
	Delete(ctx context.Context, m *RouteDelete) (*Empty, error)
}

type RouteConfig

type RouteConfig struct {
	BasicAuth   *RouteConfigBasicAuth   `json:"basicAuth" yaml:"basicAuth"`
	ForwardAuth *RouteConfigForwardAuth `json:"forwardAuth" yaml:"forwardAuth"`
}

type RouteConfigBasicAuth

type RouteConfigBasicAuth struct {
	User     string `json:"user" yaml:"user"`
	Password string `json:"password" yaml:"password"`
}

type RouteConfigForwardAuth

type RouteConfigForwardAuth struct {
	Target              string   `json:"target" yaml:"target"`
	AuthRequestHeaders  []string `json:"authRequestHeaders" yaml:"authRequestHeaders"`
	AuthResponseHeaders []string `json:"authResponseHeaders" yaml:"authResponseHeaders"`
}

type RouteCreate

type RouteCreate struct {
	Project    string `json:"project" yaml:"project"`
	Location   string `json:"location" yaml:"location"`
	Domain     string `json:"domain" yaml:"domain"`
	Path       string `json:"path" yaml:"path"`
	Deployment string `json:"deployment" yaml:"deployment"`
}

func (*RouteCreate) Valid

func (m *RouteCreate) Valid() error

type RouteCreateV2

type RouteCreateV2 struct {
	Project  string      `json:"project" yaml:"project"`
	Location string      `json:"location" yaml:"location"`
	Domain   string      `json:"domain" yaml:"domain"`
	Path     string      `json:"path" yaml:"path"`
	Target   string      `json:"target" yaml:"target"`
	Config   RouteConfig `json:"config" yaml:"config"`
}

func (*RouteCreateV2) Valid

func (m *RouteCreateV2) Valid() error

type RouteDelete

type RouteDelete struct {
	Project  string `json:"project" yaml:"project"`
	Location string `json:"location" yaml:"location"`
	Domain   string `json:"domain" yaml:"domain"`
	Path     string `json:"path" yaml:"path"`
}

func (*RouteDelete) Valid

func (m *RouteDelete) Valid() error

type RouteGet

type RouteGet struct {
	Project  string `json:"project" yaml:"project"`
	Location string `json:"location" yaml:"location"`
	Domain   string `json:"domain" yaml:"domain"`
	Path     string `json:"path" yaml:"path"`
}

func (*RouteGet) Valid

func (m *RouteGet) Valid() error

type RouteItem

type RouteItem struct {
	Location   string      `json:"location" yaml:"location"`
	Domain     string      `json:"domain" yaml:"domain"`
	Path       string      `json:"path" yaml:"path"`
	Target     string      `json:"target" yaml:"target"`
	Deployment string      `json:"deployment" yaml:"deployment"`
	Config     RouteConfig `json:"config" yaml:"config"`
	CreatedAt  time.Time   `json:"createdAt" yaml:"createdAt"`
	CreatedBy  string      `json:"createdBy" yaml:"createdBy"`
}

func (*RouteItem) Table

func (m *RouteItem) Table() [][]string

type RouteList

type RouteList struct {
	Project  string `json:"project" yaml:"project"`
	Location string `json:"location" yaml:"location"`
}

func (*RouteList) Valid

func (m *RouteList) Valid() error

type RouteListResult

type RouteListResult struct {
	Items []*RouteItem `json:"items" yaml:"items"`
}

func (*RouteListResult) Table

func (m *RouteListResult) Table() [][]string

type ServiceAccountCreate

type ServiceAccountCreate struct {
	Project     string `json:"project" yaml:"project"`
	SID         string `json:"sid" yaml:"sid"`
	Name        string `json:"name" yaml:"name"`
	Description string `json:"description" yaml:"description"`
}

func (*ServiceAccountCreate) Valid

func (m *ServiceAccountCreate) Valid() error

type ServiceAccountCreateKey

type ServiceAccountCreateKey struct {
	Project string `json:"project" yaml:"project"`
	ID      string `json:"id" yaml:"id"` // TODO: sid
}

func (*ServiceAccountCreateKey) Valid

func (m *ServiceAccountCreateKey) Valid() error

type ServiceAccountDelete

type ServiceAccountDelete struct {
	Project string `json:"project" yaml:"project"`
	ID      string `json:"id" yaml:"id"` // TODO: sid
}

func (*ServiceAccountDelete) Valid

func (m *ServiceAccountDelete) Valid() error

type ServiceAccountDeleteKey

type ServiceAccountDeleteKey struct {
	Project string `json:"project" yaml:"project"`
	ID      string `json:"id" yaml:"id"` // TODO: sid
	Secret  string `json:"secret" yaml:"secret"`
}

func (*ServiceAccountDeleteKey) Valid

func (m *ServiceAccountDeleteKey) Valid() error

type ServiceAccountGet

type ServiceAccountGet struct {
	Project string `json:"project" yaml:"project"`
	ID      string `json:"id" yaml:"id"` // TODO: sid
}

func (*ServiceAccountGet) Valid

func (m *ServiceAccountGet) Valid() error

type ServiceAccountGetResult

type ServiceAccountGetResult struct {
	SID         string               `json:"sid" yaml:"sid"`
	Project     string               `json:"project" yaml:"project"`
	Email       string               `json:"email" yaml:"email"`
	Name        string               `json:"name" yaml:"name"`
	Description string               `json:"description" yaml:"description"`
	CreatedAt   time.Time            `json:"createdAt" yaml:"createdAt"`
	CreatedBy   string               `json:"createdBy" yaml:"createdBy"`
	Keys        []*ServiceAccountKey `json:"keys" yaml:"keys"`
}

func (*ServiceAccountGetResult) Table

func (m *ServiceAccountGetResult) Table() [][]string

type ServiceAccountKey

type ServiceAccountKey struct {
	Secret    string    `json:"secret" yaml:"secret"`
	CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
	CreatedBy string    `json:"createdBy" yaml:"createdBy"`
}

type ServiceAccountList

type ServiceAccountList struct {
	Project string `json:"project" yaml:"project"`
}

func (*ServiceAccountList) Valid

func (m *ServiceAccountList) Valid() error

type ServiceAccountListItem

type ServiceAccountListItem struct {
	SID         string    `json:"sid" yaml:"sid"`
	Email       string    `json:"email" yaml:"email"`
	Name        string    `json:"name" yaml:"name"`
	Description string    `json:"description" yaml:"description"`
	CreatedAt   time.Time `json:"createdAt" yaml:"createdAt"`
	CreatedBy   string    `json:"createdBy" yaml:"createdBy"`
}

type ServiceAccountListResult

type ServiceAccountListResult struct {
	Project string                    `json:"project" yaml:"project"`
	Items   []*ServiceAccountListItem `json:"items" yaml:"items"`
}

func (*ServiceAccountListResult) Table

func (m *ServiceAccountListResult) Table() [][]string

type ServiceAccountUpdate

type ServiceAccountUpdate struct {
	Project     string `json:"project" yaml:"project"`
	SID         string `json:"sid" yaml:"sid"`
	Name        string `json:"name" yaml:"name"`
	Description string `json:"description" yaml:"description"`
}

func (*ServiceAccountUpdate) Valid

func (m *ServiceAccountUpdate) Valid() error

type Sidecar

type Sidecar struct {
	CloudSQLProxy *CloudSQLProxySidecar `json:"cloudSqlProxy" yaml:"cloudSqlProxy"`
}

func (*Sidecar) Config

func (s *Sidecar) Config() *SidecarConfig

func (*Sidecar) Valid

func (s *Sidecar) Valid() error

type SidecarConfig

type SidecarConfig struct {
	Name      string
	Image     string
	Env       map[string]string
	Command   []string
	Args      []string
	Port      *int
	MountData map[string]string
}

type Status

type Status int
const (
	Pending Status = iota
	Success
	Error
	Cancelled
	ErrorPendingCleanupResource // TODO: remove ?
	StatusNone
)

func (Status) MarshalJSON

func (s Status) MarshalJSON() ([]byte, error)

func (Status) MarshalYAML

func (s Status) MarshalYAML() (any, error)

func (Status) String

func (s Status) String() string

func (Status) Text

func (s Status) Text() string

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(b []byte) error

func (*Status) UnmarshalYAML

func (s *Status) UnmarshalYAML(unmarshal func(any) error) error

type ValidateError

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

func (*ValidateError) Error

func (err *ValidateError) Error() string

func (*ValidateError) Items

func (err *ValidateError) Items() []error

func (*ValidateError) MarshalJSON

func (err *ValidateError) MarshalJSON() ([]byte, error)

func (*ValidateError) OKError

func (err *ValidateError) OKError()

type WorkloadIdentityCreate

type WorkloadIdentityCreate struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
	GSA      string `json:"gsa" yaml:"gsa"`
}

func (*WorkloadIdentityCreate) Valid

func (m *WorkloadIdentityCreate) Valid() error

type WorkloadIdentityDelete

type WorkloadIdentityDelete struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
}

func (*WorkloadIdentityDelete) Valid

func (m *WorkloadIdentityDelete) Valid() error

type WorkloadIdentityGet

type WorkloadIdentityGet struct {
	Location string `json:"location" yaml:"location"`
	Project  string `json:"project" yaml:"project"`
	Name     string `json:"name" yaml:"name"`
}

func (*WorkloadIdentityGet) Valid

func (m *WorkloadIdentityGet) Valid() error

type WorkloadIdentityItem

type WorkloadIdentityItem struct {
	Project   string    `json:"project" yaml:"project"`
	Location  string    `json:"location" yaml:"location"`
	Name      string    `json:"name" yaml:"name"`
	GSA       string    `json:"gsa" yaml:"gsa"`
	Status    Status    `json:"status" yaml:"status"`
	Action    Action    `json:"action" yaml:"action"`
	CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
	CreatedBy string    `json:"createdBy" yaml:"createdBy"`
}

func (*WorkloadIdentityItem) Table

func (m *WorkloadIdentityItem) Table() [][]string

type WorkloadIdentityList

type WorkloadIdentityList struct {
	Project  string `json:"project" yaml:"project"`
	Location string `json:"location" yaml:"location"`
}

func (*WorkloadIdentityList) Valid

func (m *WorkloadIdentityList) Valid() error

type WorkloadIdentityListResult

type WorkloadIdentityListResult struct {
	Items []*WorkloadIdentityItem `json:"items" yaml:"items"`
}

func (*WorkloadIdentityListResult) Table

func (m *WorkloadIdentityListResult) Table() [][]string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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