Documentation ¶
Index ¶
- Constants
- func CheckIfResourcesYAMLExistsAndReturnPath() (bool, string)
- func CreateSockV5erDirectory() string
- func GetExternalIP() (string, error)
- func ReadFileContent(filepath string) ([]byte, error)
- func StartWorker()
- func ToMap(a *AWSResource) map[string]string
- func WriteFileContent(filepath string, fileContent []byte) error
- type AWSRepository
- func (repo *AWSRepository) CheckIfInstanceExists(instanceID string) (bool, error)
- func (repo *AWSRepository) CheckIfInstanceIsInState(instanceId string, state InstanceState) bool
- func (repo *AWSRepository) CreateEC2Instance() (string, error)
- func (repo *AWSRepository) CreateKeyPair() error
- func (repo *AWSRepository) CreateResources(region string, s *Settings, tracker *ResourceTracker) error
- func (repo *AWSRepository) CreateSecurityGroup() error
- func (repo *AWSRepository) DeleteKeyPair(keyPairId string) error
- func (repo *AWSRepository) DeleteResources(region string, s *Settings, tracker *ResourceTracker) error
- func (repo *AWSRepository) DeleteSecurityGroup(securityGroupId string) error
- func (repo *AWSRepository) GetDefaultVPC() error
- func (repo *AWSRepository) GetHostIP() string
- func (repo *AWSRepository) GetPrivateKey() []byte
- func (repo *AWSRepository) GetRegions(s *Settings) []map[string]string
- func (repo *AWSRepository) Initialize(s *Settings) error
- func (repo *AWSRepository) PrepareResourcesForDeletion(resource map[string]string)
- func (repo *AWSRepository) SetRegion(region string, s *Settings) error
- func (repo *AWSRepository) TerminateEC2Instance(instanceId string) error
- func (repo *AWSRepository) UpdateTracker(resources map[string]string, op TrackingOp, tracker *ResourceTracker)
- func (repo *AWSRepository) WaitUntilInstanceIsActive(instanceId string) bool
- func (repo *AWSRepository) WaitUntilInstanceIsTerminated(instanceId string) bool
- type AWSResource
- type CloudProvider
- type ConfigFileData
- type ENVData
- type GeoHelper
- type IP2LocationFinder
- type InstanceState
- type Reader
- type ResourceTracker
- type SSHConfig
- type Settings
- type SockV5erResources
- type SocksV5Er
- type TrackingOp
Constants ¶
View Source
const ( Running InstanceState = "running" Stopped = "stopped" Terminated = "terminated" )
Variables ¶
This section is empty.
Functions ¶
func CreateSockV5erDirectory ¶
func CreateSockV5erDirectory() string
func GetExternalIP ¶
func ReadFileContent ¶
func StartWorker ¶
func StartWorker()
func ToMap ¶
func ToMap(a *AWSResource) map[string]string
func WriteFileContent ¶
Types ¶
type AWSRepository ¶
type AWSRepository struct { Client *ec2.Client Region string KeyPairId string SecurityGroupID string Ec2InstanceId string InstanceIP string KeyPairKey string // contains filtered or unexported fields }
func (*AWSRepository) CheckIfInstanceExists ¶
func (repo *AWSRepository) CheckIfInstanceExists(instanceID string) (bool, error)
func (*AWSRepository) CheckIfInstanceIsInState ¶
func (repo *AWSRepository) CheckIfInstanceIsInState(instanceId string, state InstanceState) bool
func (*AWSRepository) CreateEC2Instance ¶
func (repo *AWSRepository) CreateEC2Instance() (string, error)
func (*AWSRepository) CreateKeyPair ¶
func (repo *AWSRepository) CreateKeyPair() error
func (*AWSRepository) CreateResources ¶
func (repo *AWSRepository) CreateResources(region string, s *Settings, tracker *ResourceTracker) error
func (*AWSRepository) CreateSecurityGroup ¶
func (repo *AWSRepository) CreateSecurityGroup() error
func (*AWSRepository) DeleteKeyPair ¶
func (repo *AWSRepository) DeleteKeyPair(keyPairId string) error
func (*AWSRepository) DeleteResources ¶
func (repo *AWSRepository) DeleteResources(region string, s *Settings, tracker *ResourceTracker) error
func (*AWSRepository) DeleteSecurityGroup ¶
func (repo *AWSRepository) DeleteSecurityGroup(securityGroupId string) error
func (*AWSRepository) GetDefaultVPC ¶
func (repo *AWSRepository) GetDefaultVPC() error
func (*AWSRepository) GetHostIP ¶
func (repo *AWSRepository) GetHostIP() string
func (*AWSRepository) GetPrivateKey ¶
func (repo *AWSRepository) GetPrivateKey() []byte
func (*AWSRepository) GetRegions ¶
func (repo *AWSRepository) GetRegions(s *Settings) []map[string]string
func (*AWSRepository) Initialize ¶
func (repo *AWSRepository) Initialize(s *Settings) error
func (*AWSRepository) PrepareResourcesForDeletion ¶
func (repo *AWSRepository) PrepareResourcesForDeletion(resource map[string]string)
func (*AWSRepository) SetRegion ¶
func (repo *AWSRepository) SetRegion(region string, s *Settings) error
func (*AWSRepository) TerminateEC2Instance ¶
func (repo *AWSRepository) TerminateEC2Instance(instanceId string) error
func (*AWSRepository) UpdateTracker ¶
func (repo *AWSRepository) UpdateTracker(resources map[string]string, op TrackingOp, tracker *ResourceTracker)
func (*AWSRepository) WaitUntilInstanceIsActive ¶
func (repo *AWSRepository) WaitUntilInstanceIsActive(instanceId string) bool
func (*AWSRepository) WaitUntilInstanceIsTerminated ¶
func (repo *AWSRepository) WaitUntilInstanceIsTerminated(instanceId string) bool
type AWSResource ¶
type AWSResource struct { Region string `yaml:"region"` InstanceId string `yaml:"instanceId"` SecurityGroupId string `yaml:"securityGroupId"` KeyPairId string `yaml:"keyPairId"` }
func FromAWSRepository ¶
func FromAWSRepository(a *AWSRepository) *AWSResource
func FromMap ¶
func FromMap(resourceMap map[string]string) *AWSResource
type CloudProvider ¶
type CloudProvider interface { Initialize(s *Settings) error GetRegions(s *Settings) []map[string]string CreateResources(region string, s *Settings, tracker *ResourceTracker) error DeleteResources(region string, s *Settings, tracker *ResourceTracker) error PrepareResourcesForDeletion(resources map[string]string) UpdateTracker(resources map[string]string, op TrackingOp, tracker *ResourceTracker) GetHostIP() string GetPrivateKey() []byte }
func NewAWSProvider ¶
func NewAWSProvider() CloudProvider
type ConfigFileData ¶
type ConfigFileData struct{}
func (*ConfigFileData) Read ¶
func (s *ConfigFileData) Read() *Settings
type GeoHelper ¶
type GeoHelper struct {
Settings *Settings
}
func (*GeoHelper) GetCountryShortName ¶
type IP2LocationFinder ¶
type InstanceState ¶
type InstanceState string
type ResourceTracker ¶
type ResourceTracker struct {
// contains filtered or unexported fields
}
func GetNewTracker ¶
func GetNewTracker(trackerFilepath string) *ResourceTracker
func (*ResourceTracker) AddAWSResource ¶
func (rt *ResourceTracker) AddAWSResource(resource *AWSResource)
func (*ResourceTracker) GetResources ¶
func (rt *ResourceTracker) GetResources() *[]AWSResource
func (*ResourceTracker) ReadResourcesFile ¶
func (rt *ResourceTracker) ReadResourcesFile() error
func (*ResourceTracker) RemoveAWSResource ¶
func (rt *ResourceTracker) RemoveAWSResource(resource *AWSResource)
func (*ResourceTracker) WriteResourcesFile ¶
func (rt *ResourceTracker) WriteResourcesFile() error
type SSHConfig ¶
type SSHConfig struct { PrivateKey []byte KnownHostsFilepath string SSHHost string SSHPort string SSHUsername string SocksV5IP string SocksV5Port string }
func (*SSHConfig) GetNewSSHSession ¶
func (*SSHConfig) IssueCommandsViaSSH ¶
func (*SSHConfig) StartSocksV5Server ¶
func (config *SSHConfig) StartSocksV5Server()
type SockV5erResources ¶
type SockV5erResources struct { Version string `yaml:"version"` Generator string `yaml:"generator"` AWSResources []AWSResource `yaml:"awsResources"` }
Click to show internal directories.
Click to hide internal directories.