Documentation ¶
Index ¶
- Constants
- Variables
- func MakeExitServerUserdata(authToken, version string) string
- type AzureProvisioner
- type BasicHost
- type CivoProvisioner
- type DigitalOceanProvisioner
- func (p *DigitalOceanProvisioner) Delete(request HostDeleteRequest) error
- func (p *DigitalOceanProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
- func (p *DigitalOceanProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
- func (p *DigitalOceanProvisioner) Status(id string) (*ProvisionedHost, error)
- type EC2Provisioner
- type EquinixMetalProvisioner
- func (p *EquinixMetalProvisioner) Delete(request HostDeleteRequest) error
- func (p *EquinixMetalProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
- func (p *EquinixMetalProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
- func (p *EquinixMetalProvisioner) Status(id string) (*ProvisionedHost, error)
- type GCEProvisioner
- type HetznerProvisioner
- func (p *HetznerProvisioner) Delete(request HostDeleteRequest) error
- func (p *HetznerProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
- func (p *HetznerProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
- func (p *HetznerProvisioner) Status(id string) (*ProvisionedHost, error)
- type HostDeleteRequest
- type LinodeClient
- func (p *LinodeClient) CreateInstance(instance linodego.InstanceCreateOptions) (*linodego.Instance, error)
- func (p *LinodeClient) CreateStackscript(createOpts linodego.StackscriptCreateOptions) (*linodego.Stackscript, error)
- func (p *LinodeClient) DeleteInstance(linodeID int) error
- func (p *LinodeClient) DeleteStackscript(id int) error
- func (p *LinodeClient) GetInstance(linodeID int) (*linodego.Instance, error)
- type LinodeInterface
- type LinodeProvisioner
- type ListFilter
- type Network
- type ProvisionedHost
- type Provisioner
- type ScalewayProvisioner
- func (p *ScalewayProvisioner) Delete(request HostDeleteRequest) error
- func (p *ScalewayProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
- func (p *ScalewayProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
- func (p *ScalewayProvisioner) Status(id string) (*ProvisionedHost, error)
- type TokenSource
- type VultrProvisioner
Constants ¶
const ActiveStatus = "active"
ActiveStatus is the status returned by an active exit node
const AzureStatusSucceeded = "Succeeded"
Variables ¶
var Status = "running"
Functions ¶
func MakeExitServerUserdata ¶
MakeExitServerUserdata makes a user-data script in bash to setup inlets PRO with a systemd service and the given version.
Types ¶
type AzureProvisioner ¶
type AzureProvisioner struct {
// contains filtered or unexported fields
}
func NewAzureProvisioner ¶
func NewAzureProvisioner(subscriptionId, authFileContents string) (*AzureProvisioner, error)
func (*AzureProvisioner) Delete ¶
func (p *AzureProvisioner) Delete(request HostDeleteRequest) error
Delete deletes the Azure exit node
func (*AzureProvisioner) Provision ¶
func (p *AzureProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
Provision provisions a new Azure instance as an exit node
func (*AzureProvisioner) Status ¶
func (p *AzureProvisioner) Status(id string) (*ProvisionedHost, error)
Status checks the status of the provisioning Azure exit node
type BasicHost ¶
type BasicHost struct { Region string Plan string OS string Name string UserData string Additional map[string]string }
BasicHost contains the data required to deploy a exit node
type CivoProvisioner ¶
type CivoProvisioner struct {
APIKey string
}
CivoProvisioner creates instances on civo.com
func NewCivoProvisioner ¶
func NewCivoProvisioner(accessKey string) (*CivoProvisioner, error)
NewCivoProvisioner with an accessKey
func (*CivoProvisioner) Delete ¶
func (p *CivoProvisioner) Delete(request HostDeleteRequest) error
Delete terminates the exit node
func (*CivoProvisioner) List ¶
func (p *CivoProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
List returns a list of exit nodes
func (*CivoProvisioner) Provision ¶
func (p *CivoProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
Provision creates a new exit node
func (*CivoProvisioner) Status ¶
func (p *CivoProvisioner) Status(id string) (*ProvisionedHost, error)
Status gets the status of the exit node
type DigitalOceanProvisioner ¶
type DigitalOceanProvisioner struct {
// contains filtered or unexported fields
}
DigitalOceanProvisioner provision a VM on digitalocean.com
func NewDigitalOceanProvisioner ¶
func NewDigitalOceanProvisioner(accessKey string) (*DigitalOceanProvisioner, error)
NewDigitalOceanProvisioner with an accessKey
func (*DigitalOceanProvisioner) Delete ¶
func (p *DigitalOceanProvisioner) Delete(request HostDeleteRequest) error
Delete terminates an exit node
func (*DigitalOceanProvisioner) List ¶
func (p *DigitalOceanProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
List returns a list of exit nodes
func (*DigitalOceanProvisioner) Provision ¶
func (p *DigitalOceanProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
Provision creates an exit node
func (*DigitalOceanProvisioner) Status ¶
func (p *DigitalOceanProvisioner) Status(id string) (*ProvisionedHost, error)
Status returns the status of an exit node
type EC2Provisioner ¶
type EC2Provisioner struct {
// contains filtered or unexported fields
}
EC2Provisioner contains the EC2 client
func NewEC2Provisioner ¶
func NewEC2Provisioner(region, accessKey, secretKey, sessionToken string) (*EC2Provisioner, error)
NewEC2Provisioner creates an EC2Provisioner and initialises an EC2 client
func (*EC2Provisioner) Delete ¶
func (p *EC2Provisioner) Delete(request HostDeleteRequest) error
Delete removes the exit node
func (*EC2Provisioner) List ¶
func (p *EC2Provisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
List returns a list of exit nodes
func (*EC2Provisioner) Provision ¶
func (p *EC2Provisioner) Provision(host BasicHost) (*ProvisionedHost, error)
Provision deploys an exit node into AWS EC2
func (*EC2Provisioner) Status ¶
func (p *EC2Provisioner) Status(id string) (*ProvisionedHost, error)
Status returns the ID, Status and IP of the exit node
type EquinixMetalProvisioner ¶
type EquinixMetalProvisioner struct {
// contains filtered or unexported fields
}
EquinixMetalProvisioner provisions a host to Equinix Metal
func NewEquinixMetalProvisioner ¶
func NewEquinixMetalProvisioner(accessKey string) (*EquinixMetalProvisioner, error)
NewEquinixMetalProvisioner create a EquinixMetalProvisioner with an accessKey
func (*EquinixMetalProvisioner) Delete ¶
func (p *EquinixMetalProvisioner) Delete(request HostDeleteRequest) error
Delete terminates the exit node
func (*EquinixMetalProvisioner) List ¶
func (p *EquinixMetalProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
List returns a list of exit nodes
func (*EquinixMetalProvisioner) Provision ¶
func (p *EquinixMetalProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
Provision a host
func (*EquinixMetalProvisioner) Status ¶
func (p *EquinixMetalProvisioner) Status(id string) (*ProvisionedHost, error)
Status returns the IP, ID and Status of the exit node
type GCEProvisioner ¶
type GCEProvisioner struct {
// contains filtered or unexported fields
}
GCEProvisioner holds reference to the compute service to provision compute resources
func NewGCEProvisioner ¶
func NewGCEProvisioner(accessKey string) (*GCEProvisioner, error)
NewGCEProvisioner returns a new GCEProvisioner
func (*GCEProvisioner) Delete ¶
func (p *GCEProvisioner) Delete(request HostDeleteRequest) error
Delete deletes the GCE exit node
func (*GCEProvisioner) List ¶
func (p *GCEProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
List returns a list of exit nodes
func (*GCEProvisioner) Provision ¶
func (p *GCEProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
Provision provisions a new GCE instance as an exit node
func (*GCEProvisioner) Status ¶
func (p *GCEProvisioner) Status(id string) (*ProvisionedHost, error)
Status checks the status of the provisioning GCE exit node
type HetznerProvisioner ¶
type HetznerProvisioner struct {
// contains filtered or unexported fields
}
func NewHetznerProvisioner ¶
func NewHetznerProvisioner(authToken string) (*HetznerProvisioner, error)
Creates a new Hetzner provisioner using an auth token.
func (*HetznerProvisioner) Delete ¶
func (p *HetznerProvisioner) Delete(request HostDeleteRequest) error
Delete a specific server from the Hetzner cloud.
func (*HetznerProvisioner) List ¶
func (p *HetznerProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
List all nodes that are managed by inlets.
func (*HetznerProvisioner) Provision ¶
func (p *HetznerProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
Provision a new server on Hetzner cloud to use as an inlet node.
func (*HetznerProvisioner) Status ¶
func (p *HetznerProvisioner) Status(id string) (*ProvisionedHost, error)
Get status of a specific server by id.
type HostDeleteRequest ¶
HostDeleteRequest contains the data required to delete an exit node by either IP or ID
type LinodeClient ¶
type LinodeClient struct {
// contains filtered or unexported fields
}
func (*LinodeClient) CreateInstance ¶
func (p *LinodeClient) CreateInstance(instance linodego.InstanceCreateOptions) (*linodego.Instance, error)
func (*LinodeClient) CreateStackscript ¶
func (p *LinodeClient) CreateStackscript(createOpts linodego.StackscriptCreateOptions) (*linodego.Stackscript, error)
func (*LinodeClient) DeleteInstance ¶
func (p *LinodeClient) DeleteInstance(linodeID int) error
func (*LinodeClient) DeleteStackscript ¶
func (p *LinodeClient) DeleteStackscript(id int) error
func (*LinodeClient) GetInstance ¶
func (p *LinodeClient) GetInstance(linodeID int) (*linodego.Instance, error)
type LinodeInterface ¶
type LinodeInterface interface { CreateStackscript(createOpts linodego.StackscriptCreateOptions) (*linodego.Stackscript, error) CreateInstance(instance linodego.InstanceCreateOptions) (*linodego.Instance, error) GetInstance(linodeID int) (*linodego.Instance, error) DeleteInstance(linodeID int) error DeleteStackscript(id int) error }
type LinodeProvisioner ¶
type LinodeProvisioner struct {
// contains filtered or unexported fields
}
func NewLinodeProvisioner ¶
func NewLinodeProvisioner(apiKey string) (*LinodeProvisioner, error)
func (*LinodeProvisioner) Delete ¶
func (p *LinodeProvisioner) Delete(request HostDeleteRequest) error
Delete deletes the Linode exit node
func (*LinodeProvisioner) Provision ¶
func (p *LinodeProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
Provision provisions a new Linode instance as an exit node
func (*LinodeProvisioner) Status ¶
func (p *LinodeProvisioner) Status(id string) (*ProvisionedHost, error)
Status checks the status of the provisioning Linode exit node
type ListFilter ¶
ListFilter is used to filter results to return only exit nodes
type Network ¶
type Network struct { ID string `json:"id"` Name string `json:"name,omitempty"` Default bool `json:"default,omitempty"` CIDR string `json:"cidr,omitempty"` Label string `json:"label,omitempty"` }
Network represents a network for civo vm instances to connect to
type ProvisionedHost ¶
ProvisionedHost contains the IP, ID and Status of an exit node
type Provisioner ¶
type Provisioner interface { Provision(BasicHost) (*ProvisionedHost, error) Status(id string) (*ProvisionedHost, error) Delete(HostDeleteRequest) error }
Provisioner is an interface used for deploying exit nodes into cloud providers
type ScalewayProvisioner ¶
type ScalewayProvisioner struct {
// contains filtered or unexported fields
}
ScalewayProvisioner provision a VM on scaleway.com
func NewScalewayProvisioner ¶
func NewScalewayProvisioner(accessKey, secretKey, organizationID, region string) (*ScalewayProvisioner, error)
NewScalewayProvisioner with an accessKey and secretKey
func (*ScalewayProvisioner) Delete ¶
func (p *ScalewayProvisioner) Delete(request HostDeleteRequest) error
Delete deletes the provisionned instance by ID We should first poweroff the instance, otherwise we'll have: http error 400 Bad Request: instance should be powered off. Then we have to delete the server and attached volumes
func (*ScalewayProvisioner) List ¶
func (p *ScalewayProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
List returns a list of exit nodes
func (*ScalewayProvisioner) Provision ¶
func (p *ScalewayProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
Provision creates a new scaleway instance from the BasicHost type To provision the instance we first create the server, then set its user-data and power it on
func (*ScalewayProvisioner) Status ¶
func (p *ScalewayProvisioner) Status(id string) (*ProvisionedHost, error)
Status returns the status of the scaleway instance
type TokenSource ¶
type TokenSource struct {
AccessToken string
}
TokenSource contains an access token
type VultrProvisioner ¶
type VultrProvisioner struct {
// contains filtered or unexported fields
}
func NewVultrProvisioner ¶
func NewVultrProvisioner(accessKey string) (*VultrProvisioner, error)
func (*VultrProvisioner) Delete ¶
func (v *VultrProvisioner) Delete(request HostDeleteRequest) error
func (*VultrProvisioner) List ¶
func (v *VultrProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error)
List returns a list of exit nodes
func (*VultrProvisioner) Provision ¶
func (v *VultrProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
func (*VultrProvisioner) Status ¶
func (v *VultrProvisioner) Status(id string) (*ProvisionedHost, error)