providers

package
v0.0.0-...-7759ae7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Gce          string = "gce"
	DigitalOcean string = "digitalocean"
	Packet       string = "packet"
	Aws          string = "aws"
	Azure        string = "azure"
	Vultr        string = "vultr"
	Linode       string = "linode"
	Scaleway     string = "scaleway"
)

Variables

This section is empty.

Functions

func AddKubernetesSupport

func AddKubernetesSupport(opts *options.KubernetesData) error

func GetCloudData

func GetCloudData(cloudInterface CloudInterface) (*data.CloudData, error)

get data from api

func MergeAndWriteCloudData

func MergeAndWriteCloudData(cloudInterface CloudInterface) error

get data from api , merge it with previous data and write the data previous data written in cloud_old.json

func MergeCloudData

func MergeCloudData(oldData, curData *data.CloudData) (*data.CloudData, error)

region merge rule:

if region doesn't exist in old data, but exists in cur data, then add it
if region exists in old data, but doesn't exists in cur data, then delete it
if region exist in both, then
	if field data exists in both cur and old data , then take the cur data
	otherwise, take data from (old or cur)whichever contains it

instanceType merge rule: same as region rule, except

if instance exists in old data, but doesn't exists in cur data, then add it , set the deprecated true

In MergeCloudData, we merge only the region and instanceType data

func MergeKubernetesSupport

func MergeKubernetesSupport(data *data.CloudData, kubeData *data.Kubernetes) (*data.CloudData, error)

If kubeData.version exists in old data, then

		if kubeData.Envs is empty, then delete it,
     otherwise, replace it

If kubeData.version doesn't exists in old data, then append it

func WriteCloudData

func WriteCloudData(cloudData *data.CloudData, fileName string) error

write data in [path to pharmer]/data/files/[provider]/

Types

type CloudInterface

type CloudInterface interface {
	GetName() string
	GetEnvs() []string
	GetCredentials() []data.CredentialFormat
	GetKubernets() []data.Kubernetes
	GetRegions() ([]data.Region, error)
	GetZones() ([]string, error)
	GetInstanceTypes() ([]data.InstanceType, error)
}

func NewCloudProvider

func NewCloudProvider(opts *options.GenData) (CloudInterface, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL