Documentation ¶
Index ¶
- Constants
- Variables
- func BuildInitialLocalSSHCfgHostnameForEnv(envName string) string
- func BuildSlugForEnv(rawString string) string
- func CheckDomainValidity(domain string) error
- func CheckEnvNameValidity(envName string) error
- func CheckPortValidity(port string, reservedPorts []string) error
- type CloudService
- type CloudServiceBuilder
- type Cluster
- type ClusterStatus
- type Config
- func (c *Config) ClusterExists(clusterName string) bool
- func (c *Config) CountEnvsInCluster(clusterName string) (int, error)
- func (c *Config) EnvExists(clusterName, envName string) bool
- func (c *Config) GetCluster(clusterName string) (*Cluster, error)
- func (c *Config) GetEnv(clusterName, envName string) (*Env, error)
- func (c *Config) RemoveCluster(clusterName string) error
- func (c *Config) RemoveEnv(clusterName, envName string) error
- func (c *Config) SetCluster(cluster *Cluster) error
- func (c *Config) SetEnv(clusterName string, env *Env) error
- type DomainReachabilityChecker
- type Env
- func (e *Env) AddServedPortBinding(servedPort EnvServedPort, binding string, redirectToHTTPS bool)
- func (e *Env) DoesServedPortBindingExist(targetBinding string) bool
- func (e *Env) DoesServedPortExist(servedPort EnvServedPort) bool
- func (e *Env) GetNameSlug() string
- func (e *Env) GetSSHKeyPairName() string
- func (e *Env) RemoveServedPort(servedPort EnvServedPort)
- func (e *Env) RemoveServedPortBinding(servedPort EnvServedPort, targetBinding string)
- func (e *Env) SetAdditionalPropertiesJSON(additionalProps interface{}) error
- func (e *Env) SetInfrastructureJSON(infrastructure interface{}) error
- type EnvRepository
- type EnvRepositoryGitURL
- type EnvRuntimes
- type EnvSSHHostKey
- type EnvServedPort
- type EnvServedPortBinding
- type EnvServedPortBindingType
- type EnvServedPorts
- type EnvStatus
- type ErrCloudflareSSLFull
- type ErrClusterAlreadyExists
- type ErrClusterNotExists
- type ErrEditCreatingEnv
- type ErrEditRemovingEnv
- type ErrEnvCloudInitError
- type ErrEnvDuplicatedRepositories
- type ErrEnvDuplicatedRuntimes
- type ErrEnvInvalidRuntime
- type ErrEnvInvalidRuntimeVersion
- type ErrEnvNotExists
- type ErrEnvRepositoryNotFound
- type ErrInitRemovingEnv
- type ErrInvalidDomain
- type ErrInvalidEnvName
- type ErrInvalidPort
- type ErrLetsEncryptTimedOut
- type ErrProxyForceHTTPS
- type ErrReservedPort
- type ErrServeCreatingEnv
- type ErrServeRemovingEnv
- type ErrUnresolvableDomain
- type ErrUnserveCreatingEnv
- type ErrUnserveRemovingEnv
- type ErrUpdateInstanceTypeCreatingEnv
- type HookRunner
Constants ¶
View Source
const ( EnvNameRegExp = `^[a-z0-9]+(-[a-z0-9]+)*$` EnvNameMaxLength = 16 )
View Source
const (
DefaultClusterName = "default"
)
Variables ¶
View Source
var ( ErrElevenNotInstalled = errors.New("ErrElevenNotInstalled") ErrUninstallExistingEnvs = errors.New("ErrUninstallExistingEnvs") )
Functions ¶
func BuildSlugForEnv ¶
func CheckDomainValidity ¶
func CheckEnvNameValidity ¶
func CheckPortValidity ¶
Types ¶
type CloudService ¶
type CloudService interface { CreateElevenConfigStorage(stepper.Stepper) error RemoveElevenConfigStorage(stepper.Stepper) error LookupElevenConfig(stepper.Stepper) (*Config, error) SaveElevenConfig(stepper.Stepper, *Config) error CreateCluster(stepper.Stepper, *Config, *Cluster) error RemoveCluster(stepper.Stepper, *Config, *Cluster) error CheckInstanceTypeValidity(stepper.Stepper, string) error CreateEnv(stepper.Stepper, *Config, *Cluster, *Env) error RemoveEnv(stepper.Stepper, *Config, *Cluster, *Env) error OpenPort(stepper.Stepper, *Config, *Cluster, *Env, string) error ClosePort(stepper.Stepper, *Config, *Cluster, *Env, string) error }
type CloudServiceBuilder ¶
type CloudServiceBuilder interface {
Build() (CloudService, error)
}
type Cluster ¶
type Cluster struct { ID string `json:"id"` Name string `json:"name"` DefaultInstanceType string `json:"default_instance_type"` InfrastructureJSON string `json:"infrastructure_json"` Envs map[string]*Env `json:"envs"` IsDefault bool `json:"is_default"` Status ClusterStatus `json:"status"` CreatedAtTimestamp int64 `json:"created_at_timestamp"` }
func NewCluster ¶
func (*Cluster) GetNameSlug ¶
func (*Cluster) SetInfrastructureJSON ¶
type ClusterStatus ¶
type ClusterStatus string
const ( ClusterStatusCreating ClusterStatus = "creating" ClusterStatusCreated ClusterStatus = "created" ClusterStatusRemoving ClusterStatus = "removing" )
type Config ¶
type Config struct { ID string `json:"id"` Clusters map[string]*Cluster `json:"clusters"` CreatedAtTimestamp int64 `json:"created_at_timestamp"` }
func (*Config) ClusterExists ¶
func (*Config) CountEnvsInCluster ¶
func (*Config) RemoveCluster ¶
func (*Config) SetCluster ¶
type Env ¶
type Env struct { ID string `json:"id"` Name string `json:"name"` LocalSSHConfigHostname string `json:"local_ssh_config_hostname"` InfrastructureJSON string `json:"infrastructure_json"` InstanceType string `json:"instance_type"` InstancePublicIPAddress string `json:"instance_public_ip_address"` SSHHostKeys []EnvSSHHostKey `json:"ssh_host_keys"` SSHKeyPairPEMContent string `json:"ssh_key_pair_pem_content"` Repositories []EnvRepository `json:"repositories"` Runtimes EnvRuntimes `json:"runtimes"` ServedPorts EnvServedPorts `json:"served_ports"` Status EnvStatus `json:"status"` AdditionalPropertiesJSON string `json:"additional_properties_json"` CreatedAtTimestamp int64 `json:"created_at_timestamp"` }
func NewEnv ¶
func NewEnv( envName string, localSSHCfgDupHostCt int, instanceType string, repositories []EnvRepository, runtimes EnvRuntimes, ) *Env
func (*Env) AddServedPortBinding ¶
func (e *Env) AddServedPortBinding( servedPort EnvServedPort, binding string, redirectToHTTPS bool, )
func (*Env) DoesServedPortBindingExist ¶
func (*Env) DoesServedPortExist ¶
func (e *Env) DoesServedPortExist(servedPort EnvServedPort) bool
func (*Env) GetNameSlug ¶
func (*Env) GetSSHKeyPairName ¶
func (*Env) RemoveServedPort ¶
func (e *Env) RemoveServedPort(servedPort EnvServedPort)
func (*Env) RemoveServedPortBinding ¶
func (e *Env) RemoveServedPortBinding(servedPort EnvServedPort, targetBinding string)
func (*Env) SetAdditionalPropertiesJSON ¶
func (*Env) SetInfrastructureJSON ¶
type EnvRepository ¶
type EnvRepository struct { Name string `json:"name"` Owner string `json:"owner"` ExplicitOwner bool `json:"explicit_owner"` GitURL EnvRepositoryGitURL `json:"git_url"` GitHTTPURL EnvRepositoryGitURL `json:"git_http_url"` }
type EnvRepositoryGitURL ¶
type EnvRepositoryGitURL string
type EnvRuntimes ¶
func ParseEnvRuntimes ¶
func ParseEnvRuntimes(runtimes []string) (EnvRuntimes, error)
type EnvSSHHostKey ¶
type EnvSSHHostKey struct { Algorithm string `json:"algorithm"` Fingerprint string `json:"fingerprint"` }
func ParseSSHHostKeysForEnv ¶
func ParseSSHHostKeysForEnv(hostKeysContent string) ([]EnvSSHHostKey, error)
type EnvServedPort ¶
type EnvServedPort string
type EnvServedPortBinding ¶
type EnvServedPortBinding struct { Value string `json:"value"` Type EnvServedPortBindingType `json:"type"` RedirectToHTTPS bool `json:"redirect_to_https"` }
type EnvServedPortBindingType ¶
type EnvServedPortBindingType string
const ( EnvServedPortBindingTypePort EnvServedPortBindingType = "port" EnvServedPortBindingTypeDomain EnvServedPortBindingType = "domain" )
type EnvServedPorts ¶
type EnvServedPorts map[EnvServedPort][]EnvServedPortBinding
type ErrCloudflareSSLFull ¶
type ErrCloudflareSSLFull struct {
Domain string
}
func (ErrCloudflareSSLFull) Error ¶
func (ErrCloudflareSSLFull) Error() string
type ErrClusterAlreadyExists ¶
type ErrClusterAlreadyExists struct {
ClusterName string
}
func (ErrClusterAlreadyExists) Error ¶
func (e ErrClusterAlreadyExists) Error() string
type ErrClusterNotExists ¶
type ErrClusterNotExists struct {
ClusterName string
}
func (ErrClusterNotExists) Error ¶
func (e ErrClusterNotExists) Error() string
type ErrEditCreatingEnv ¶
type ErrEditCreatingEnv struct {
EnvName string
}
func (ErrEditCreatingEnv) Error ¶
func (ErrEditCreatingEnv) Error() string
type ErrEditRemovingEnv ¶
type ErrEditRemovingEnv struct {
EnvName string
}
func (ErrEditRemovingEnv) Error ¶
func (ErrEditRemovingEnv) Error() string
type ErrEnvCloudInitError ¶
func (ErrEnvCloudInitError) Error ¶
func (ErrEnvCloudInitError) Error() string
type ErrEnvDuplicatedRepositories ¶
func (ErrEnvDuplicatedRepositories) Error ¶
func (ErrEnvDuplicatedRepositories) Error() string
type ErrEnvDuplicatedRuntimes ¶
type ErrEnvDuplicatedRuntimes struct {
Runtime string
}
func (ErrEnvDuplicatedRuntimes) Error ¶
func (ErrEnvDuplicatedRuntimes) Error() string
type ErrEnvInvalidRuntime ¶
type ErrEnvInvalidRuntime struct {
Runtime string
}
func (ErrEnvInvalidRuntime) Error ¶
func (ErrEnvInvalidRuntime) Error() string
type ErrEnvInvalidRuntimeVersion ¶
type ErrEnvInvalidRuntimeVersion struct { Runtime string RuntimeVersion string RuntimeVersionExamples []string }
func (ErrEnvInvalidRuntimeVersion) Error ¶
func (ErrEnvInvalidRuntimeVersion) Error() string
type ErrEnvNotExists ¶
func (ErrEnvNotExists) Error ¶
func (ErrEnvNotExists) Error() string
type ErrEnvRepositoryNotFound ¶
func (ErrEnvRepositoryNotFound) Error ¶
func (ErrEnvRepositoryNotFound) Error() string
type ErrInitRemovingEnv ¶
type ErrInitRemovingEnv struct {
EnvName string
}
func (ErrInitRemovingEnv) Error ¶
func (ErrInitRemovingEnv) Error() string
type ErrInvalidDomain ¶
type ErrInvalidDomain struct {
Domain string
}
func (ErrInvalidDomain) Error ¶
func (ErrInvalidDomain) Error() string
type ErrInvalidEnvName ¶
func (ErrInvalidEnvName) Error ¶
func (ErrInvalidEnvName) Error() string
type ErrInvalidPort ¶
type ErrInvalidPort struct {
InvalidPort string
}
func (ErrInvalidPort) Error ¶
func (ErrInvalidPort) Error() string
type ErrLetsEncryptTimedOut ¶
func (ErrLetsEncryptTimedOut) Error ¶
func (ErrLetsEncryptTimedOut) Error() string
type ErrProxyForceHTTPS ¶
type ErrProxyForceHTTPS struct {
Domain string
}
func (ErrProxyForceHTTPS) Error ¶
func (ErrProxyForceHTTPS) Error() string
type ErrReservedPort ¶
type ErrReservedPort struct {
ReservedPort string
}
func (ErrReservedPort) Error ¶
func (ErrReservedPort) Error() string
type ErrServeCreatingEnv ¶
type ErrServeCreatingEnv struct {
EnvName string
}
func (ErrServeCreatingEnv) Error ¶
func (ErrServeCreatingEnv) Error() string
type ErrServeRemovingEnv ¶
type ErrServeRemovingEnv struct {
EnvName string
}
func (ErrServeRemovingEnv) Error ¶
func (ErrServeRemovingEnv) Error() string
type ErrUnresolvableDomain ¶
func (ErrUnresolvableDomain) Error ¶
func (ErrUnresolvableDomain) Error() string
type ErrUnserveCreatingEnv ¶
type ErrUnserveCreatingEnv struct {
EnvName string
}
func (ErrUnserveCreatingEnv) Error ¶
func (ErrUnserveCreatingEnv) Error() string
type ErrUnserveRemovingEnv ¶
type ErrUnserveRemovingEnv struct {
EnvName string
}
func (ErrUnserveRemovingEnv) Error ¶
func (ErrUnserveRemovingEnv) Error() string
type ErrUpdateInstanceTypeCreatingEnv ¶
type ErrUpdateInstanceTypeCreatingEnv struct {
EnvName string
}
func (ErrUpdateInstanceTypeCreatingEnv) Error ¶
func (ErrUpdateInstanceTypeCreatingEnv) Error() string
type HookRunner ¶
type HookRunner interface { Run( cloudService CloudService, config *Config, cluster *Cluster, env *Env, ) error }
Click to show internal directories.
Click to hide internal directories.