Documentation ¶
Index ¶
- Variables
- func ServeHTTP() error
- type AWSCluster
- func (c *AWSCluster) Base() *BaseCluster
- func (c *AWSCluster) Delete()
- func (c *AWSCluster) FindCredentials() (aws.CredentialsProvider, error)
- func (c *AWSCluster) Run()
- func (c *AWSCluster) SetBase(base *BaseCluster)
- func (c *AWSCluster) SetCreds(creds *Credential) error
- func (c *AWSCluster) SetDefaultsAndValidate() error
- func (c *AWSCluster) Type() string
- type AzureCluster
- func (c *AzureCluster) Base() *BaseCluster
- func (c *AzureCluster) Delete()
- func (c *AzureCluster) Run()
- func (c *AzureCluster) SetBase(base *BaseCluster)
- func (c *AzureCluster) SetCreds(creds *Credential) error
- func (c *AzureCluster) SetDefaultsAndValidate() error
- func (c *AzureCluster) Type() string
- type BareCluster
- type BaseCluster
- func (c *BaseCluster) Abort()
- func (c *BaseCluster) ChoicePrompt(choice Choice) (string, error)
- func (c *BaseCluster) ClusterConfig() *cfg.Cluster
- func (c *BaseCluster) CredentialPrompt(msg string) string
- func (c *BaseCluster) DashboardLoginMsg() (string, error)
- func (c *BaseCluster) FindCredentials() (*Credential, error)
- func (c *BaseCluster) HandleAuthenticationFailure(cluster Cluster, err error) bool
- func (c *BaseCluster) IsAborted() bool
- func (c *BaseCluster) IsRestoringBackup() bool
- func (c *BaseCluster) MarkDeleted() (err error)
- func (c *BaseCluster) NewBackupReceiver(backup io.Reader, size int) *ClusterBackupReceiver
- func (c *BaseCluster) PromptFileInput(msg string) (int, io.Reader, chan<- error)
- func (c *BaseCluster) PromptInput(msg string) string
- func (c *BaseCluster) PromptProtectedInput(msg string) string
- func (c *BaseCluster) ReceiveBackup(backup io.Reader, size int) error
- func (c *BaseCluster) SendError(err error)
- func (c *BaseCluster) SendLog(description string)
- func (c *BaseCluster) SendProgress(event *ProgressEvent)
- func (c *BaseCluster) SetDefaultsAndValidate() error
- func (c *BaseCluster) StackAddCmd() (string, error)
- func (c *BaseCluster) YesNoPrompt(msg string) bool
- type Choice
- type ChoiceOption
- type Cluster
- type ClusterBackupReceiver
- type Credential
- type DigitalOceanCluster
- func (c *DigitalOceanCluster) Base() *BaseCluster
- func (c *DigitalOceanCluster) Delete()
- func (c *DigitalOceanCluster) Run()
- func (c *DigitalOceanCluster) SetBase(base *BaseCluster)
- func (c *DigitalOceanCluster) SetCreds(creds *Credential) error
- func (c *DigitalOceanCluster) SetDefaultsAndValidate() error
- func (c *DigitalOceanCluster) Type() string
- type DigitalOceanDroplet
- type Domain
- type Event
- type Installer
- func (i *Installer) ClusterDeleted(id string)
- func (i *Installer) DeleteCluster(id string) error
- func (i *Installer) DeleteCredentials(id string) error
- func (i *Installer) FindAWSCluster(id string) (*AWSCluster, error)
- func (i *Installer) FindAzureCluster(id string) (*AzureCluster, error)
- func (i *Installer) FindBaseCluster(id string) (*BaseCluster, error)
- func (i *Installer) FindCluster(id string) (cluster Cluster, err error)
- func (i *Installer) FindCredentials(id string) (*Credential, error)
- func (i *Installer) FindDigitalOceanCluster(id string) (*DigitalOceanCluster, error)
- func (i *Installer) FindSSHCluster(id string) (*SSHCluster, error)
- func (i *Installer) GetEventsSince(eventID string) []*Event
- func (i *Installer) LaunchCluster(c Cluster) error
- func (i *Installer) ListAzureRegions(creds *Credential) (interface{}, error)
- func (i *Installer) ListDigitalOceanRegions(creds *Credential) (interface{}, error)
- func (i *Installer) SaveCluster(c Cluster) error
- func (i *Installer) SaveCredentials(creds *Credential) error
- func (i *Installer) SendEvent(event *Event)
- func (i *Installer) Subscribe(eventChan chan *Event, lastEventID string) *Subscription
- func (i *Installer) Unsubscribe(sub *Subscription)
- type InstanceIPs
- type OAuthCredential
- type ProgressEvent
- type Prompt
- type PromptType
- type SSHCluster
- type StackEventSort
- type Subscription
- type TargetServer
Constants ¶
This section is empty.
Variables ¶
View Source
var ClusterNotFoundError = errors.New("Cluster not found")
View Source
var DefaultInstanceType = "m4.large"
View Source
var DisallowedEC2InstanceTypes = []string{"t1.micro", "t2.micro", "t2.small", "m1.small"}
View Source
var StackNotFoundError = errors.New("Stack does not exist")
Functions ¶
Types ¶
type AWSCluster ¶
type AWSCluster struct { ClusterID string `json:"cluster_id" ql:"index xCluster"` StackID string `json:"stack_id"` StackName string `json:"stack_name"` ImageID string `json:"image_id,omitempty"` Region string `json:"region"` InstanceType string `json:"instance_type"` VpcCIDR string `json:"vpc_cidr"` SubnetCIDR string `json:"subnet_cidr"` DNSZoneID string `json:"dns_zone_id"` DeletedAt *time.Time `json:"deleted_at,omitempty"` // contains filtered or unexported fields }
func (*AWSCluster) Base ¶
func (c *AWSCluster) Base() *BaseCluster
func (*AWSCluster) Delete ¶
func (c *AWSCluster) Delete()
func (*AWSCluster) FindCredentials ¶
func (c *AWSCluster) FindCredentials() (aws.CredentialsProvider, error)
func (*AWSCluster) Run ¶
func (c *AWSCluster) Run()
func (*AWSCluster) SetBase ¶
func (c *AWSCluster) SetBase(base *BaseCluster)
func (*AWSCluster) SetCreds ¶
func (c *AWSCluster) SetCreds(creds *Credential) error
func (*AWSCluster) SetDefaultsAndValidate ¶
func (c *AWSCluster) SetDefaultsAndValidate() error
func (*AWSCluster) Type ¶
func (c *AWSCluster) Type() string
type AzureCluster ¶
type AzureCluster struct { ClusterID string `json:"cluster_id" ql:"index xCluster"` SubscriptionID string `json:"subscription_id"` Region string `json:"region"` Size string `json:"size"` DeletedAt *time.Time `json:"deleted_at,omitempty"` // contains filtered or unexported fields }
func (*AzureCluster) Base ¶
func (c *AzureCluster) Base() *BaseCluster
func (*AzureCluster) Delete ¶
func (c *AzureCluster) Delete()
func (*AzureCluster) Run ¶
func (c *AzureCluster) Run()
func (*AzureCluster) SetBase ¶
func (c *AzureCluster) SetBase(base *BaseCluster)
func (*AzureCluster) SetCreds ¶
func (c *AzureCluster) SetCreds(creds *Credential) error
func (*AzureCluster) SetDefaultsAndValidate ¶
func (c *AzureCluster) SetDefaultsAndValidate() error
func (*AzureCluster) Type ¶
func (c *AzureCluster) Type() string
type BareCluster ¶
type BareCluster struct { Targets []*TargetServer Base *BaseCluster // contains filtered or unexported fields }
func (*BareCluster) InstallFlynn ¶
func (c *BareCluster) InstallFlynn() error
type BaseCluster ¶
type BaseCluster struct { ID string `json:"id"` CredentialID string `json:"credential_id"` Type string `json:"type"` // enum(aws, digital_ocean, azure, ssh) State string `json:"state" ql:"index xState"` // enum(starting, error, running, deleting) Name string `json:"name" ql:"-"` NumInstances int64 `json:"num_instances"` ControllerKey string `json:"controller_key,omitempty"` ControllerPin string `json:"controller_pin,omitempty"` DashboardLoginToken string `json:"dashboard_login_token,omitempty"` Domain *Domain `json:"domain" ql:"-"` CACert string `json:"ca_cert"` SSHKey *sshkeygen.SSHKey `json:"-" ql:"-"` SSHKeyName string `json:"ssh_key_name,omitempty"` SSHUsername string `json:"-" ql:"-"` DiscoveryToken string `json:"discovery_token"` InstanceIPs []string `json:"instance_ips,omitempty" ql:"-"` DeletedAt *time.Time `json:"deleted_at,omitempty"` HasBackup bool `json:"has_backup,omitempty" ql:"-"` // contains filtered or unexported fields }
func (*BaseCluster) Abort ¶
func (c *BaseCluster) Abort()
func (*BaseCluster) ChoicePrompt ¶
func (c *BaseCluster) ChoicePrompt(choice Choice) (string, error)
func (*BaseCluster) ClusterConfig ¶
func (c *BaseCluster) ClusterConfig() *cfg.Cluster
func (*BaseCluster) CredentialPrompt ¶
func (c *BaseCluster) CredentialPrompt(msg string) string
func (*BaseCluster) DashboardLoginMsg ¶
func (c *BaseCluster) DashboardLoginMsg() (string, error)
func (*BaseCluster) FindCredentials ¶
func (c *BaseCluster) FindCredentials() (*Credential, error)
func (*BaseCluster) HandleAuthenticationFailure ¶
func (c *BaseCluster) HandleAuthenticationFailure(cluster Cluster, err error) bool
func (*BaseCluster) IsAborted ¶
func (c *BaseCluster) IsAborted() bool
func (*BaseCluster) IsRestoringBackup ¶
func (c *BaseCluster) IsRestoringBackup() bool
func (*BaseCluster) MarkDeleted ¶
func (c *BaseCluster) MarkDeleted() (err error)
func (*BaseCluster) NewBackupReceiver ¶
func (c *BaseCluster) NewBackupReceiver(backup io.Reader, size int) *ClusterBackupReceiver
func (*BaseCluster) PromptFileInput ¶
func (*BaseCluster) PromptInput ¶
func (c *BaseCluster) PromptInput(msg string) string
func (*BaseCluster) PromptProtectedInput ¶
func (c *BaseCluster) PromptProtectedInput(msg string) string
func (*BaseCluster) ReceiveBackup ¶
func (c *BaseCluster) ReceiveBackup(backup io.Reader, size int) error
func (*BaseCluster) SendError ¶
func (c *BaseCluster) SendError(err error)
func (*BaseCluster) SendLog ¶
func (c *BaseCluster) SendLog(description string)
func (*BaseCluster) SendProgress ¶
func (c *BaseCluster) SendProgress(event *ProgressEvent)
func (*BaseCluster) SetDefaultsAndValidate ¶
func (c *BaseCluster) SetDefaultsAndValidate() error
func (*BaseCluster) StackAddCmd ¶
func (c *BaseCluster) StackAddCmd() (string, error)
func (*BaseCluster) YesNoPrompt ¶
func (c *BaseCluster) YesNoPrompt(msg string) bool
type Choice ¶
type Choice struct { Message string `json:"message"` Options []ChoiceOption `json:"options"` }
type ChoiceOption ¶
type Cluster ¶
type Cluster interface { Base() *BaseCluster SetDefaultsAndValidate() error Run() Delete() Type() string SetBase(*BaseCluster) SetCreds(*Credential) error }
type ClusterBackupReceiver ¶
type ClusterBackupReceiver struct {
// contains filtered or unexported fields
}
func (*ClusterBackupReceiver) Close ¶
func (cbr *ClusterBackupReceiver) Close() error
func (*ClusterBackupReceiver) Error ¶
func (cbr *ClusterBackupReceiver) Error() error
func (*ClusterBackupReceiver) UploadComplete ¶
func (cbr *ClusterBackupReceiver) UploadComplete(err error)
func (*ClusterBackupReceiver) Wait ¶
func (cbr *ClusterBackupReceiver) Wait() error
type Credential ¶
type Credential struct { ID string `json:"id"` Secret string `json:"secret"` Name string `json:"name"` Type string `json:"type"` // enum(aws, digital_ocean, azure) Endpoint string `json:"endpoint"` // token endpoint OAuthCreds []*OAuthCredential `json:"oauth_creds,omitempty" ql:"-"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
type DigitalOceanCluster ¶
type DigitalOceanCluster struct { ClusterID string `json:"cluster_id" ql:"index xCluster"` Region string `json:"region"` Size string `json:"size"` KeyFingerprint string `json:"key_fingerprint"` DropletIDs []int64 `json:"droplet_ids" ql:"-"` DeletedAt *time.Time `json:"deleted_at,omitempty"` // contains filtered or unexported fields }
func (*DigitalOceanCluster) Base ¶
func (c *DigitalOceanCluster) Base() *BaseCluster
func (*DigitalOceanCluster) Delete ¶
func (c *DigitalOceanCluster) Delete()
func (*DigitalOceanCluster) Run ¶
func (c *DigitalOceanCluster) Run()
func (*DigitalOceanCluster) SetBase ¶
func (c *DigitalOceanCluster) SetBase(base *BaseCluster)
func (*DigitalOceanCluster) SetCreds ¶
func (c *DigitalOceanCluster) SetCreds(creds *Credential) error
func (*DigitalOceanCluster) SetDefaultsAndValidate ¶
func (c *DigitalOceanCluster) SetDefaultsAndValidate() error
func (*DigitalOceanCluster) Type ¶
func (c *DigitalOceanCluster) Type() string
type DigitalOceanDroplet ¶
type Domain ¶
type Domain struct { ClusterID string `json:"-"` Name string `json:"domain"` Token string `json:"token"` DeletedAt *time.Time `json:"deleted_at,omitempty"` // contains filtered or unexported fields }
func AllocateDomain ¶
func (*Domain) ConfigureIPAddresses ¶
type Event ¶
type Event struct { ID string `json:"id"` Timestamp time.Time `json:"timestamp"` Type string `json:"type"` ClusterID string `json:"cluster_id,omitempty"` Cluster *BaseCluster `json:"cluster,omitempty" ql:"-"` ResourceType string `json:"resource_type,omitempty"` ResourceID string `json:"resource_id,omitempty"` Resource interface{} `json:"resource,omitempty" ql:"-"` Description string `json:"description,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
func NewInstaller ¶
func (*Installer) ClusterDeleted ¶
func (*Installer) DeleteCluster ¶
func (*Installer) DeleteCredentials ¶
func (*Installer) FindAWSCluster ¶
func (i *Installer) FindAWSCluster(id string) (*AWSCluster, error)
func (*Installer) FindAzureCluster ¶
func (i *Installer) FindAzureCluster(id string) (*AzureCluster, error)
func (*Installer) FindBaseCluster ¶
func (i *Installer) FindBaseCluster(id string) (*BaseCluster, error)
func (*Installer) FindCluster ¶
func (*Installer) FindCredentials ¶
func (i *Installer) FindCredentials(id string) (*Credential, error)
func (*Installer) FindDigitalOceanCluster ¶
func (i *Installer) FindDigitalOceanCluster(id string) (*DigitalOceanCluster, error)
func (*Installer) FindSSHCluster ¶
func (i *Installer) FindSSHCluster(id string) (*SSHCluster, error)
func (*Installer) GetEventsSince ¶
func (*Installer) LaunchCluster ¶
func (*Installer) ListAzureRegions ¶
func (i *Installer) ListAzureRegions(creds *Credential) (interface{}, error)
func (*Installer) ListDigitalOceanRegions ¶
func (i *Installer) ListDigitalOceanRegions(creds *Credential) (interface{}, error)
func (*Installer) SaveCluster ¶
func (*Installer) SaveCredentials ¶
func (i *Installer) SaveCredentials(creds *Credential) error
func (*Installer) Subscribe ¶
func (i *Installer) Subscribe(eventChan chan *Event, lastEventID string) *Subscription
func (*Installer) Unsubscribe ¶
func (i *Installer) Unsubscribe(sub *Subscription)
type InstanceIPs ¶
type OAuthCredential ¶
type ProgressEvent ¶
type Prompt ¶
type Prompt struct { ID string `json:"id"` Type PromptType `json:"type,omitempty"` Message string `json:"message,omitempty"` Yes bool `json:"yes,omitempty"` Input string `json:"input,omitempty"` File io.Reader `json:"-" ql:"-"` FileSize int `json:"-" ql:"-"` Resolved bool `json:"resolved,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` // contains filtered or unexported fields }
type PromptType ¶
type PromptType string
var ( PromptTypeYesNo PromptType = "yes_no" PromptTypeChoice PromptType = "choice" PromptTypeCredential PromptType = "credential" PromptTypeInput PromptType = "input" PromptTypeProtectedInput PromptType = "protected_input" PromptTypeFile PromptType = "file" )
type SSHCluster ¶
type SSHCluster struct { ClusterID string `json:"cluster_id" ql:"index xCluster"` DeletedAt *time.Time `json:"deleted_at,omitempty"` SSHLogin string `json:"ssh_login"` Targets []*TargetServer `json:"targets" ql:"-"` TargetsJSON string `json:"-"` // contains filtered or unexported fields }
func (*SSHCluster) Base ¶
func (c *SSHCluster) Base() *BaseCluster
func (*SSHCluster) Delete ¶
func (c *SSHCluster) Delete()
func (*SSHCluster) Run ¶
func (c *SSHCluster) Run()
func (*SSHCluster) SetBase ¶
func (c *SSHCluster) SetBase(base *BaseCluster)
func (*SSHCluster) SetCreds ¶
func (c *SSHCluster) SetCreds(creds *Credential) error
func (*SSHCluster) SetDefaultsAndValidate ¶
func (c *SSHCluster) SetDefaultsAndValidate() error
func (*SSHCluster) Type ¶
func (c *SSHCluster) Type() string
type StackEventSort ¶
type StackEventSort []cloudformation.StackEvent
func (StackEventSort) Len ¶
func (e StackEventSort) Len() int
func (StackEventSort) Less ¶
func (e StackEventSort) Less(i, j int) bool
func (StackEventSort) Swap ¶
func (e StackEventSort) Swap(i, j int)
type Subscription ¶
type Subscription struct { LastEventID string EventChan chan *Event DoneChan chan struct{} // contains filtered or unexported fields }
func (*Subscription) SendEvents ¶
func (sub *Subscription) SendEvents(i *Installer)
type TargetServer ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.