Documentation
¶
Index ¶
- func CountDeployedAppsPerRegion(apps []ScaleState) map[string]int
- func NewDefaultDeployParams() []string
- func NewDefaultLaunchParams(appName string, orgSlug string) []string
- type AppAtFsNode
- type AppConfig
- type AppDeployFailure
- type AppDeploySuccess
- type CommonAppConfig
- type Concurrency
- type DeployConfig
- type DeployResult
- type FsNode
- func (s FsNode) Apps() []AppAtFsNode
- func (s FsNode) Flatten() []FsNode
- func (s FsNode) HasAppNode() bool
- func (s FsNode) HasProjectNode() bool
- func (s FsNode) IsAppSyntaxValid() bool
- func (s FsNode) IsValidApp() bool
- func (s FsNode) Projects() []ProjectAtFsNode
- func (s FsNode) Traverse(t func(node FsNode) error) error
- func (s FsNode) TraverseNoErr(t func(node FsNode))
- type FsNodeShallow
- type GitRef
- type HttpService
- type IpConfig
- type Ipv
- type MachineConfig
- type MergeCfg
- type Mount
- type NetworkConfig
- type Port
- type PreCalculatedAppConfig
- type ProjectAtFsNode
- type ProjectConfig
- type ProjectProcessingFailure
- type ScaleState
- type SecretRef
- type SecretSourceType
- type Service
- type SingleAppDeploySuccessType
- type Source
- type SourceType
- type TraverseAppTreeContext
- type ValidateAppConfigOptions
- type VolumeConfig
- type VolumeState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountDeployedAppsPerRegion ¶
func CountDeployedAppsPerRegion(apps []ScaleState) map[string]int
func NewDefaultDeployParams ¶
func NewDefaultDeployParams() []string
func NewDefaultLaunchParams ¶
Types ¶
type AppAtFsNode ¶
type AppAtFsNode struct {
Path string
AppYaml string
AppConfigUntyped map[string]any
AppConfig AppConfig
AppConfigErr error
}
func (AppAtFsNode) ErrCause ¶
func (s AppAtFsNode) ErrCause() error
func (AppAtFsNode) IsAppNode ¶
func (s AppAtFsNode) IsAppNode() bool
func (AppAtFsNode) IsAppSyntaxValid ¶
func (s AppAtFsNode) IsAppSyntaxValid() bool
func (AppAtFsNode) IsValidApp ¶
func (s AppAtFsNode) IsValidApp() bool
func (AppAtFsNode) ToPreCalculatedApoConf ¶
func (s AppAtFsNode) ToPreCalculatedApoConf() *PreCalculatedAppConfig
type AppConfig ¶
type AppConfig struct {
App string `yaml:"app" toml:"app"`
Org string `yaml:"org" toml:"org,omitempty"`
PrimaryRegion string `yaml:"primary_region" toml:"primary_region,omitempty"`
ExtraRegions []string `yaml:"extra_regions,omitempty" toml:"extra_regions,omitempty"`
Source Source `yaml:"source,omitempty" toml:"source"`
MergeCfg MergeCfg `yaml:"merge_cfg,omitempty" toml:"merge_cfg" json:"merge_cfg,omitempty"`
Services []Service `yaml:"services,omitempty" toml:"services,omitempty"`
HttpService *HttpService `yaml:"http_service,omitempty" toml:"http_service,omitempty"`
LaunchParams []string `yaml:"launch_params,omitempty" toml:"launch_params,omitempty"`
DeployParams []string `yaml:"deploy_params,omitempty" toml:"deploy_params"`
Env map[string]string `yaml:"env,omitempty" toml:"env,omitempty"`
Build map[string]any `yaml:"build,omitempty" toml:"build,omitempty"`
Mounts []Mount `yaml:"mounts,omitempty" toml:"mounts,omitempty"` // fly.io only supports one mount :S
Volumes []VolumeConfig `yaml:"volumes,omitempty" toml:"volumes,omitempty"`
Machines MachineConfig `yaml:"machines,omitempty" toml:"machines,omitempty"`
Secrets []SecretRef `yaml:"secrets,omitempty" toml:"secrets,omitempty"`
NetworkConfig NetworkConfig `yaml:"network,omitempty" toml:"network,omitempty"`
KillTimeout *int `yaml:"kill_timeout,omitempty" toml:"kill_timeout,omitempty"`
}
func (*AppConfig) MinMachinesFromServices ¶ added in v0.0.41
func (*AppConfig) RegionsWPrimaryLast ¶
func (*AppConfig) Validate ¶
func (a *AppConfig) Validate(options ...ValidateAppConfigOptions) error
func (AppConfig) WithKillTimeout ¶ added in v0.0.43
type AppDeployFailure ¶
type AppDeployFailure struct {
Spec AppAtFsNode
Cause error
}
type AppDeploySuccess ¶
type AppDeploySuccess struct {
Spec AppAtFsNode
SuccessType SingleAppDeploySuccessType
}
type CommonAppConfig ¶
type CommonAppConfig struct {
AppDefaults map[string]any `yaml:"app_defaults" toml:"app_defaults"` // default yaml tree for all apps
AppSubstitutions map[string]any `yaml:"substitutions" toml:"substitutions"` // raw text substitution regexes
AppOverrides map[string]any `yaml:"app_overrides" toml:"app_overrides"` // yaml overrides for all apps
}
CommonAppConfig is configuration defined in project.yaml files that applies to all apps in the project
func (CommonAppConfig) MakeAppConfig ¶
func (c CommonAppConfig) MakeAppConfig(appYaml []byte, validate ...bool) (AppConfig, map[string]any, error)
MakeAppConfig creates an AppConfig from a raw app.yaml file, applying all substitutions and overrides, from the parent projects and their CommonAppConfig's.
func (CommonAppConfig) Plus ¶
func (c CommonAppConfig) Plus(other CommonAppConfig) CommonAppConfig
Plus merges two CommonAppConfig's, used when traversing the project tree with projects-in-projects.
type Concurrency ¶
type DeployConfig ¶
type DeployConfig struct {
Force bool
Retries int
AttemptTimeout time.Duration
AbortOnFirstError bool
}
func NewDefaultDeployConfig ¶
func NewDefaultDeployConfig() DeployConfig
func (DeployConfig) WithAbortOnFirstError ¶
func (c DeployConfig) WithAbortOnFirstError(state ...bool) DeployConfig
func (DeployConfig) WithAttemptTimeout ¶
func (c DeployConfig) WithAttemptTimeout(timeout ...time.Duration) DeployConfig
func (DeployConfig) WithForce ¶
func (c DeployConfig) WithForce(force ...bool) DeployConfig
func (DeployConfig) WithRetries ¶
func (c DeployConfig) WithRetries(retries ...int) DeployConfig
type DeployResult ¶
type DeployResult struct {
SucceededApps []AppDeploySuccess
FailedApps []AppDeployFailure
ProcessedProjects []ProjectAtFsNode
FailedProjects []ProjectProcessingFailure
}
func NewEmptyDeployResult ¶
func NewEmptyDeployResult() DeployResult
func (DeployResult) HasErrors ¶
func (r DeployResult) HasErrors() bool
func (DeployResult) Plus ¶
func (r DeployResult) Plus(other DeployResult) DeployResult
func (DeployResult) Success ¶
func (r DeployResult) Success() bool
type FsNode ¶
type FsNode struct {
Path string
App *AppAtFsNode
Project *ProjectAtFsNode
Children []FsNode
}
func (FsNode) Apps ¶
func (s FsNode) Apps() []AppAtFsNode
func (FsNode) HasAppNode ¶
func (FsNode) HasProjectNode ¶
func (FsNode) IsAppSyntaxValid ¶
func (FsNode) IsValidApp ¶
func (FsNode) Projects ¶
func (s FsNode) Projects() []ProjectAtFsNode
func (FsNode) TraverseNoErr ¶
type FsNodeShallow ¶
type GitRef ¶
type HttpService ¶
type HttpService struct {
InternalPort int `yaml:"internal_port" toml:"internal_port"`
ForceHttps bool `yaml:"force_https" toml:"force_https"`
AutoStopMachines bool `yaml:"auto_stop_machines" toml:"auto_stop_machines"`
AutoStartMachines bool `yaml:"auto_start_machines" toml:"auto_start_machines"`
MinMachinesRunning int `yaml:"min_machines_running" toml:"min_machines_running"`
Concurrency Concurrency `yaml:"concurrency" toml:"concurrency,omitempty"`
Processes []string `yaml:"processes" toml:"processes,omitempty"`
}
func (HttpService) IsEmpty ¶
func (s HttpService) IsEmpty() bool
type IpConfig ¶ added in v0.0.41
type MachineConfig ¶
type MachineConfig struct {
Count int `yaml:"count" toml:"count"` // default
CountPerRegion map[string]int `yaml:"count_per_region" toml:"count_per_region"`
RamMB int `yaml:"ram_mb" toml:"ram_mb"`
CpuCores int `yaml:"cpu_cores" toml:"cpu_cores"`
CpuType string `yaml:"cpu_type" toml:"cpu_type"`
}
func (MachineConfig) CountInRegion ¶
func (m MachineConfig) CountInRegion(region string) int
type NetworkConfig ¶ added in v0.0.41
type NetworkConfig struct {
Ips []IpConfig `yaml:"ips" toml:"ips"`
AutoPruneIps bool `yaml:"auto_prune_ips" toml:"auto_prune_ips"`
}
func (NetworkConfig) IsEmpty ¶ added in v0.0.41
func (c NetworkConfig) IsEmpty() bool
func (NetworkConfig) Validate ¶ added in v0.0.41
func (c NetworkConfig) Validate() error
type PreCalculatedAppConfig ¶
type ProjectAtFsNode ¶
type ProjectAtFsNode struct {
Path string
ProjectYaml string
ProjectConfig ProjectConfig
ProjectConfigSyntaxErr error
ProjectConfigSemErr error
}
func (ProjectAtFsNode) ErrCause ¶
func (s ProjectAtFsNode) ErrCause() error
func (ProjectAtFsNode) IsProjectNode ¶
func (s ProjectAtFsNode) IsProjectNode() bool
func (ProjectAtFsNode) IsProjectSyntaxValid ¶
func (s ProjectAtFsNode) IsProjectSyntaxValid() bool
func (ProjectAtFsNode) IsValidProject ¶
func (s ProjectAtFsNode) IsValidProject() bool
type ProjectConfig ¶
type ProjectConfig struct {
Project string `yaml:"project" toml:"project"` // Name Required. Unique name of the project
Source Source `yaml:"source" toml:"source"` // Source Required. Where the app configs of the project are located
Common CommonAppConfig `yaml:"common" toml:"common"` // Common Optional. Common config for all apps in the project
}
func (*ProjectConfig) Validate ¶
func (cfg *ProjectConfig) Validate() error
type ProjectProcessingFailure ¶
type ProjectProcessingFailure struct {
Spec ProjectAtFsNode
Cause error
}
type ScaleState ¶
type ScaleState struct {
Process string `json:"Process"`
Count int `json:"Count"`
CPUKind string `json:"CPUKind"`
CPUs int `json:"CPUs"`
MemoryMB int `json:"Memory"`
Regions map[string]int `json:"Regions"`
}
func (ScaleState) CountInRegion ¶
func (s ScaleState) CountInRegion(region string) int
func (ScaleState) IncludesRegion ¶
func (s ScaleState) IncludesRegion(region string) bool
type SecretRef ¶
type SecretRef struct {
Name string `yaml:"name" toml:"name"`
Type SecretSourceType `yaml:"type" toml:"type"`
Env string `yaml:"env" toml:"env"`
Raw string `yaml:"raw" toml:"raw"`
}
func (SecretRef) GetSecretValue ¶
type SecretSourceType ¶
type SecretSourceType string
const ( SecretSourceTypeEnv SecretSourceType = "env" SecretSourceTypeRaw SecretSourceType = "raw" // not recommended )
type Service ¶
type Service struct {
InternalPort int `yaml:"internal_port" toml:"internal_port"`
Protocol string `yaml:"protocol" toml:"protocol"`
ForceHttps bool `yaml:"force_https" toml:"force_https"`
AutoStopMachines bool `yaml:"auto_stop_machines" toml:"auto_stop_machines"`
AutoStartMachines bool `yaml:"auto_start_machines" toml:"auto_start_machines"`
MinMachinesRunning int `yaml:"min_machines_running" toml:"min_machines_running"`
Concurrency Concurrency `yaml:"concurrency" toml:"concurrency,omitempty"`
Ports []Port `yaml:"ports" toml:"ports,omitempty"`
Processes []string `yaml:"processes" toml:"processes,omitempty"`
}
func NewDefaultServiceConfig ¶
func NewDefaultServiceConfig() Service
func (Service) WithMinScale ¶ added in v0.0.43
type SingleAppDeploySuccessType ¶
type SingleAppDeploySuccessType string
const ( SingleAppDeployCreated SingleAppDeploySuccessType = "created" SingleAppDeployUpdated SingleAppDeploySuccessType = "updated" SingleAppDeployNoChange SingleAppDeploySuccessType = "no-change" )
type Source ¶
type Source struct {
Repo string `yaml:"repo,omitempty" toml:"repo" json:"repo,omitempty"`
Path string `yaml:"path,omitempty" toml:"path" json:"path,omitempty"`
Ref GitRef `yaml:"ref,omitempty" toml:"ref" json:"ref,omitempty"`
Type SourceType `yaml:"type,omitempty" toml:"type" json:"type,omitempty"`
Inline string `yaml:"inline,omitempty" toml:"inline" json:"inline,omitempty"`
}
func NewLocalFolderSource ¶
func (*Source) AsGitCloneSource ¶
func (s *Source) AsGitCloneSource() util_git.CloneSource
type SourceType ¶
type SourceType string
const ( SourceTypeGit SourceType = "git" SourceTypeLocal SourceType = "local" SourceTypeInlineDockerFile SourceType = "inline-docker-file" )
type TraverseAppTreeContext ¶
type TraverseAppTreeContext struct {
context.Context
ValidAppCb func(TraverseAppTreeContext, AppAtFsNode) error
InvalidAppCb func(TraverseAppTreeContext, AppAtFsNode) error
SkippedAppCb func(TraverseAppTreeContext, AppAtFsNode) error
BeginProjectCb func(TraverseAppTreeContext, ProjectAtFsNode) error
EndProjectCb func(TraverseAppTreeContext, ProjectAtFsNode) error
SkippedProjectCb func(TraverseAppTreeContext, ProjectAtFsNode) error
Seen struct {
Apps map[string]bool
Projects map[string]bool
}
Parents []ProjectConfig
CommonAppCfg CommonAppConfig
}
type ValidateAppConfigOptions ¶
type ValidateAppConfigOptions struct {
ValidateSource bool
}
func NewValidateAppConfigOptions ¶
func NewValidateAppConfigOptions() ValidateAppConfigOptions
func (ValidateAppConfigOptions) WithValidateSource ¶
func (opts ValidateAppConfigOptions) WithValidateSource(validateSource ...bool) ValidateAppConfigOptions
type VolumeConfig ¶
Click to show internal directories.
Click to hide internal directories.