Пример #1
0
func registerTestProvider() *providers.TestProvider {
	if os.Getenv("TEST_PROVIDER") != "" {
		providerFile, err := os.Open(os.Getenv("TEST_PROVIDER"))
		if err != nil {
			panic(err)
		}
		dec := gob.NewDecoder(providerFile)
		var testProvider providers.TestProvider
		err = dec.Decode(&testProvider)
		if err != nil {
			panic(err)
		}
		providerFile.Close()
		providerName = "test"
		providers.Register(&testProvider, "test")
		return &testProvider
	}
	return nil
}
Пример #2
0
func init() {
	readEnv()
	providers.Register(new(digitalOceanProvider), "digitalocean")
}
Пример #3
0
func init() {
	providers.Register(&awsProvider{}, "aws")
}