Documentation
¶
Index ¶
- Constants
- Variables
- func FileExists(fileName string) bool
- func HTTPURLEnhancer(address string) string
- type Config
- type Connectable
- type Connection
- type ConnectionType
- type Destroyable
- type DirectConnection
- type DockerConfig
- type DockerImageResolver
- type Environment
- type EnvironmentID
- type GitConfig
- type GitProvider
- type HashiConnConfig
- type JobConfig
- type SSHConnection
- type SSHConnectionConfig
Constants ¶
View Source
const ( DeploymentDir = "deployment" SSHPort = 22 )
View Source
const ( DefaultProjectsDir = "./projects" DefaultTemplateDir = "./deploy-template/nomad/deployment" )
Variables ¶
View Source
var (
ErrNoConnection = errors.New("no connection defined")
)
Functions ¶
func FileExists ¶
func HTTPURLEnhancer ¶
Types ¶
type Config ¶
type Config struct { TemplateDir string `hcl:"template_dir,optional"` GitProjectDir string `hcl:"git_project_dir,optional"` Job *JobConfig `hcl:"job,block"` Environments []*Environment `hcl:"env,block"` // contains filtered or unexported fields }
func LoadConfig ¶
func NewDefaultConfig ¶
func (*Config) GetEnvironment ¶
func (c *Config) GetEnvironment(envKey string) *Environment
func (*Config) GetTemplateFile ¶
func (*Config) GetVarFilesForEnv ¶
type Connectable ¶
type Connection ¶
type ConnectionType ¶
type ConnectionType string
const ( ConnDirect ConnectionType = "direct" ConnSSH ConnectionType = "ssh" )
type Destroyable ¶
type Destroyable interface {
Destroy() error
}
type DirectConnection ¶
type DirectConnection struct {
// contains filtered or unexported fields
}
func (*DirectConnection) Destroy ¶
func (c *DirectConnection) Destroy() error
func (*DirectConnection) GetAddress ¶
func (c *DirectConnection) GetAddress() (string, error)
func (*DirectConnection) Init ¶
func (c *DirectConnection) Init(address string) error
type DockerConfig ¶
type DockerConfig struct {
Registry string `hcl:"registry"`
}
type DockerImageResolver ¶
type DockerImageResolver interface {
Resolve() string
}
type Environment ¶
type Environment struct { Name string `hcl:"name,label"` Nomad *HashiConnConfig `hcl:"nomad,block"` Consul *HashiConnConfig `hcl:"consul,block"` Git *GitConfig `hcl:"git,block"` Docker *DockerConfig `hcl:"docker,block"` }
func (*Environment) Destroy ¶
func (e *Environment) Destroy() error
func (*Environment) ID ¶
func (e *Environment) ID() string
type EnvironmentID ¶
type EnvironmentID string
type GitConfig ¶
type GitConfig struct { DefaultRef string `hcl:"default_ref,optional"` DefaultProvider GitProvider `hcl:"default_provider,optional"` }
type GitProvider ¶
type GitProvider string
func (GitProvider) NormalizeSlug ¶
func (p GitProvider) NormalizeSlug(slug string) string
type HashiConnConfig ¶
type HashiConnConfig struct { Address string `hcl:"address"` Token string `hcl:"acl_token"` ConnectionConfig *conn `hcl:"connection,block"` // contains filtered or unexported fields }
func (*HashiConnConfig) Connect ¶
func (c *HashiConnConfig) Connect() (string, error)
func (*HashiConnConfig) Destroy ¶
func (c *HashiConnConfig) Destroy() error
type SSHConnection ¶
type SSHConnection struct { Config *SSHConnectionConfig // contains filtered or unexported fields }
SSHConnection is holding a ssh tunnel to remote address Dont use this in critical section
func (*SSHConnection) Destroy ¶
func (conn *SSHConnection) Destroy() error
func (*SSHConnection) GetAddress ¶
func (conn *SSHConnection) GetAddress() (string, error)
func (*SSHConnection) Init ¶
func (conn *SSHConnection) Init(address string) error
type SSHConnectionConfig ¶
Click to show internal directories.
Click to hide internal directories.