Documentation ¶
Index ¶
- Constants
- type ApplicationUpdate
- type ApplicationUpdateExactVersion
- type ApplicationUpdateInput
- type ApplicationUpdateProgress
- type CaughtEmail
- type CaughtEmailList
- type CommandCronjobExecution
- type ComputeMetricPoint
- type ComputeMetricPointList
- type ConnectOption
- type Cronjob
- type CronjobJob
- type DatabaseUser
- type DatabaseUserInput
- type DatabaseUserList
- type Empty
- type Envelope
- type Header
- type InitStep
- type InitializationProgress
- type Mail
- type MetricDateRange
- type MetricUsage
- type SoftwareRef
- type SoftwareVersionRef
- type Space
- type SpaceDeclaration
- type SpaceName
- type SpacePaymentLink
- type SpacePaymentLinkInput
- type SpacesClient
- type Stage
- type StageDeclaration
- type StageProtection
- type StageRef
- type StorageMetricPoint
- type StorageUsage
- type TeamRef
- type VersionRef
- type VirtualHost
- type VirtualHostCertificate
- type VirtualHostList
- type VirtualHostTLS
Constants ¶
View Source
const ( ScopeHour = "hour" ScopeToday = "today" ScopeWeek = "week" ScopeMonth = "month" ScopeYear = "year" )
View Source
const ( UnitBytes = 1 UnitKB = 1024 UnitMB = 1024 * 1024 UnitGB = 1024 * 1024 * 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationUpdate ¶ added in v1.2.0
type ApplicationUpdate struct { ID string `json:"id"` StartedAt time.Time `json:"startedAt"` CompletedAt time.Time `json:"completedAt"` Status string `json:"status"` VersionConstraint string `json:"versionConstraint"` ExactVersion ApplicationUpdateExactVersion `json:"exactVersion"` Progress ApplicationUpdateProgress `json:"progress"` SourceStage StageRef `json:"sourceStage"` TargetStage StageRef `json:"targetStage"` }
type ApplicationUpdateExactVersion ¶ added in v1.2.0
type ApplicationUpdateExactVersion struct {
Number string `json:"number"`
}
type ApplicationUpdateInput ¶ added in v1.2.0
type ApplicationUpdateProgress ¶ added in v1.2.0
type CaughtEmail ¶ added in v1.5.0
type CaughtEmail struct { ID string `json:"id"` Envelope Envelope `json:"envelope"` Date time.Time `json:"date"` Mail Mail `json:"mail"` }
func (*CaughtEmail) Header ¶ added in v1.5.0
func (c *CaughtEmail) Header(name string) string
func (*CaughtEmail) Headers ¶ added in v1.5.0
func (c *CaughtEmail) Headers(name string) []string
type CaughtEmailList ¶ added in v1.5.0
type CaughtEmailList []CaughtEmail
func (CaughtEmailList) ByID ¶ added in v1.5.0
func (l CaughtEmailList) ByID(id string) *CaughtEmail
type CommandCronjobExecution ¶ added in v1.1.0
type ComputeMetricPoint ¶ added in v1.6.0
type ComputeMetricPoint struct { Date MetricDateRange `json:"date"` Stage string `json:"stage"` CPU MetricUsage `json:"cpu"` Memory MetricUsage `json:"memory"` }
type ComputeMetricPointList ¶ added in v1.6.0
type ComputeMetricPointList []ComputeMetricPoint
func (ComputeMetricPointList) CPUUsage ¶ added in v1.6.0
func (l ComputeMetricPointList) CPUUsage() []float64
func (ComputeMetricPointList) DateStrings ¶ added in v1.6.0
func (l ComputeMetricPointList) DateStrings(layout string) []string
func (ComputeMetricPointList) Dates ¶ added in v1.6.0
func (l ComputeMetricPointList) Dates() []time.Time
func (ComputeMetricPointList) MemoryUsage ¶ added in v1.6.0
func (l ComputeMetricPointList) MemoryUsage(unit int) []float64
type ConnectOption ¶ added in v1.11.2
type ConnectOption func(in *SpacePaymentLinkInput) error
func WithBackupIntervalMinutes ¶ added in v1.12.0
func WithBackupIntervalMinutes(interval uint64) ConnectOption
func WithPods ¶ added in v1.11.2
func WithPods(pods uint64) ConnectOption
func WithStages ¶ added in v1.11.2
func WithStages(stages uint64) ConnectOption
func WithStorage ¶ added in v1.11.2
func WithStorage(storageBytes uint64) ConnectOption
func WithStorageStr ¶ added in v1.11.2
func WithStorageStr(storage string) ConnectOption
func WithoutTestingPeriod ¶ added in v1.12.0
func WithoutTestingPeriod() ConnectOption
type Cronjob ¶ added in v1.1.0
type Cronjob struct { ID string `json:"id,omitempty"` Schedule string `json:"schedule"` AllowParallel bool `json:"allowParallel"` Job CronjobJob `json:"job"` Timezone string `json:"timezone"` }
type CronjobJob ¶ added in v1.1.0
type CronjobJob struct { Type string `json:"type"` Command string `json:"command,omitempty"` Arguments []string `json:"arguments,omitempty"` WorkingDirectory string `json:"workingDirectory,omitempty"` NextExecution *CommandCronjobExecution `json:"nextExecution,omitempty"` LastExecution *CommandCronjobExecution `json:"lastExecution,omitempty"` }
type DatabaseUser ¶ added in v1.10.0
type DatabaseUserInput ¶ added in v1.10.0
type DatabaseUserList ¶ added in v1.10.0
type DatabaseUserList []DatabaseUser
type InitializationProgress ¶ added in v1.5.0
type MetricDateRange ¶ added in v1.6.0
type MetricUsage ¶ added in v1.6.0
type SoftwareRef ¶
type SoftwareVersionRef ¶ added in v1.3.0
type SoftwareVersionRef struct { Software SoftwareRef `json:"software"` VersionConstraint string `json:"versionConstraint"` UserData interface{} `json:"userData,omitempty"` }
type Space ¶
type Space struct { ID string `json:"id"` Links lowlevel.LinkList `json:"_links"` Name SpaceName `json:"name"` CreatedAt time.Time `json:"createdAt"` Status string `json:"status"` DNSNames []string `json:"dnsNames"` Stages []Stage `json:"stages"` Team TeamRef `json:"team"` Running bool `json:"running"` }
func (Space) StagesCount ¶
func (Space) StagesNames ¶
type SpaceDeclaration ¶
type SpaceDeclaration struct { Name SpaceName `json:"name"` PaymentLink SpacePaymentLinkInput `json:""` Stages []StageDeclaration `json:"stages"` }
type SpacePaymentLink ¶ added in v1.4.0
type SpacePaymentLink struct { Plan payment.Plan `json:"plan"` PaymentProfile payment.PaymentProfile `json:"paymentProfile"` }
type SpacePaymentLinkInput ¶ added in v1.4.0
type SpacePaymentLinkInput struct { Plan payment.PlanReferenceInput `json:"plan"` PaymentProfile payment.PaymentProfileReferenceInput `json:"paymentProfile"` Preprovisionings *payment.SpaceResourcePreprovisioningInput `json:"preprovisionings,omitempty"` Options *payment.SpaceOptionInput `json:"options,omitempty"` SkipTestingPeriod bool `json:"skipTestingPeriod"` }
type SpacesClient ¶
type SpacesClient interface { List() ([]Space, error) ListByTeam(teamID string) ([]Space, error) Declare(teamID string, declaration *SpaceDeclaration) (*Space, error) GetByID(spaceID string) (*Space, error) GetByTeamAndName(teamIDOrName string, spaceIDOrName string) (*Space, error) Delete(spaceID string) error UpdateApplication(spaceID, stage, targetStage, version string) (*ApplicationUpdate, error) ListApplicationUpdatesByStage(spaceID, stage string) ([]ApplicationUpdate, error) ListApplicationUpdatesBySpace(spaceID string) ([]ApplicationUpdate, error) GetPaymentLink(spaceID string) (*SpacePaymentLink, error) ConnectWithPaymentProfile(spaceID string, paymentProfileID string, planID string, opts ...ConnectOption) (*SpacePaymentLink, error) ListCaughtEmails(spaceID string) (CaughtEmailList, error) GetComputeMetrics(spaceID string, scope string) (ComputeMetricPointList, error) ListVirtualHostsByStage(spaceID, stage string) (VirtualHostList, error) UpdateVirtualHost(spaceID, stage string, vhost VirtualHost) (*VirtualHost, error) DeleteVirtualHost(spaceID, stage, hostname string) error GetStageProtection(spaceID, stage string) (*StageProtection, error) CreateStageProtection(spaceID, stage string, inputProtection StageProtection) (*StageProtection, error) DeleteStageProtection(spaceID, stage string) error ListDatabaseUsersByStage(spaceID, stage string) (DatabaseUserList, error) GetDatabaseUser(spaceID, stage, username string) (*DatabaseUser, error) CreateDatabaseUser(spaceID, stage string, dbUser DatabaseUserInput) (*DatabaseUser, error) DeleteDatabaseUser(spaceID, stage, name, dbType string) error }
func NewSpacesClient ¶
func NewSpacesClient(client *lowlevel.SpacesLowlevelClient, logger *log.Logger) SpacesClient
type Stage ¶
type Stage struct { Links lowlevel.LinkList `json:"_links"` Actions lowlevel.LinkList `json:"_actions"` Name string `json:"name"` Application SoftwareVersionRef `json:"application"` Databases []SoftwareVersionRef `json:"databases"` Cronjobs []Cronjob `json:"cronjobs"` Version VersionRef `json:"version"` VersionConstraint string `json:"versionConstraint"` UserData interface{} `json:"userData"` DNSNames []string `json:"dnsNames"` Status string `json:"status"` Running bool `json:"running"` Initialization InitializationProgress `json:"initializationProgress"` }
type StageDeclaration ¶
type StageDeclaration struct { Name string `json:"name"` Application SoftwareRef `json:"application"` Databases []SoftwareVersionRef `json:"databases"` Cronjobs []Cronjob `json:"cronjobs"` VersionConstraint string `json:"versionConstraint"` UserData interface{} `json:"userData"` }
type StageProtection ¶ added in v1.8.0
type StageProtection struct {
ProtectionType string `json:"type"`
}
type StorageMetricPoint ¶ added in v1.6.0
type StorageMetricPoint struct { Date MetricDateRange `json:"date"` Stage string `json:"stage"` Files StorageUsage `json:"files"` Database StorageUsage `json:"database"` }
type StorageUsage ¶ added in v1.6.0
type VersionRef ¶
type VersionRef struct {
Number string `json:"number"`
}
type VirtualHost ¶ added in v1.7.0
type VirtualHost struct { Hostname string `json:"hostname"` TLS VirtualHostTLS `json:"tls"` }
type VirtualHostCertificate ¶ added in v1.7.0
type VirtualHostCertificate struct {
ID string `json:"id"`
}
type VirtualHostList ¶ added in v1.7.0
type VirtualHostList []VirtualHost
func (VirtualHostList) Exists ¶ added in v1.7.0
func (l VirtualHostList) Exists(hostname string) bool
type VirtualHostTLS ¶ added in v1.7.0
type VirtualHostTLS struct { Type string `json:"type"` Certificate VirtualHostCertificate `json:"certificate"` }
Click to show internal directories.
Click to hide internal directories.