Skip to content

Commit

Permalink
Removed azure backend (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
guscarreon authored Aug 20, 2021
1 parent 0410bc7 commit e249061
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 293 deletions.
201 changes: 0 additions & 201 deletions backends/azure_table.go

This file was deleted.

61 changes: 0 additions & 61 deletions backends/azure_table_test.go

This file was deleted.

2 changes: 0 additions & 2 deletions backends/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ func newBaseBackend(cfg config.Backend, appMetrics *metrics.Metrics) backends.Ba
return backends.NewMemoryBackend()
case config.BackendMemcache:
return backends.NewMemcacheBackend(cfg.Memcache)
case config.BackendAzure:
return backends.NewAzureBackend(cfg.Azure.Account, cfg.Azure.Key)
case config.BackendAerospike:
return backends.NewAerospikeBackend(cfg.Aerospike, appMetrics)
case config.BackendRedis:
Expand Down
5 changes: 1 addition & 4 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ request_limits:
max_num_values: 10
max_ttl_seconds: 3600
backend:
type: "memory" # Can also be "aerospike", "azure", "cassandra", "memcache" or "redis"
type: "memory" # Can also be "aerospike", "cassandra", "memcache" or "redis"
aerospike:
host: "aerospike.prebid.com"
port: 3000
namespace: "whatever"
azure:
account: "azure-account-here"
key: "azure-key-here"
cassandra:
hosts: "127.0.0.1"
keyspace: "prebid"
Expand Down
17 changes: 1 addition & 16 deletions config/backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
type Backend struct {
Type BackendType `mapstructure:"type"`
Aerospike Aerospike `mapstructure:"aerospike"`
Azure Azure `mapstructure:"azure"`
Cassandra Cassandra `mapstructure:"cassandra"`
Memcache Memcache `mapstructure:"memcache"`
Redis Redis `mapstructure:"redis"`
Expand All @@ -21,8 +20,6 @@ func (cfg *Backend) validateAndLog() error {
switch cfg.Type {
case BackendAerospike:
return cfg.Aerospike.validateAndLog()
case BackendAzure:
return cfg.Azure.validateAndLog()
case BackendCassandra:
return cfg.Cassandra.validateAndLog()
case BackendMemcache:
Expand All @@ -32,7 +29,7 @@ func (cfg *Backend) validateAndLog() error {
case BackendMemory:
return nil
default:
return fmt.Errorf(`invalid config.backend.type: %s. It must be "aerospike", "azure", "cassandra", "memcache", "redis", or "memory".`, cfg.Type)
return fmt.Errorf(`invalid config.backend.type: %s. It must be "aerospike", "cassandra", "memcache", "redis", or "memory".`, cfg.Type)
}
return nil
}
Expand All @@ -41,7 +38,6 @@ type BackendType string

const (
BackendAerospike BackendType = "aerospike"
BackendAzure BackendType = "azure"
BackendCassandra BackendType = "cassandra"
BackendMemcache BackendType = "memcache"
BackendMemory BackendType = "memory"
Expand Down Expand Up @@ -76,17 +72,6 @@ func (cfg *Aerospike) validateAndLog() error {
return nil
}

type Azure struct {
Account string `mapstructure:"account"`
Key string `mapstructure:"key"`
}

func (cfg *Azure) validateAndLog() error {
log.Infof("config.backend.azure.account: %s", cfg.Account)
log.Infof("config.backend.azure.key: %s", cfg.Key)
return nil
}

type Cassandra struct {
Hosts string `mapstructure:"hosts"`
Keyspace string `mapstructure:"keyspace"`
Expand Down
2 changes: 0 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ func setConfigDefaults(v *viper.Viper) {
v.SetDefault("backend.aerospike.user", "")
v.SetDefault("backend.aerospike.password", "")
v.SetDefault("backend.aerospike.default_ttl_seconds", 0)
v.SetDefault("backend.azure.account", "")
v.SetDefault("backend.azure.key", "")
v.SetDefault("backend.cassandra.hosts", "")
v.SetDefault("backend.cassandra.keyspace", "")
v.SetDefault("backend.memcache.hosts", []string{})
Expand Down
4 changes: 0 additions & 4 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1110,10 +1110,6 @@ func getExpectedFullConfigForTestFile() Configuration {
User: "foo",
Password: "bar",
},
Azure: Azure{
Account: "azure-account-here",
Key: "azure-key-here",
},
Cassandra: Cassandra{
Hosts: "127.0.0.1",
Keyspace: "prebid",
Expand Down
3 changes: 0 additions & 3 deletions config/configtest/sample_full_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ backend:
namespace: "whatever"
user: "foo"
password: "bar"
azure:
account: "azure-account-here"
key: "azure-key-here"
cassandra:
hosts: "127.0.0.1"
keyspace: "prebid"
Expand Down

0 comments on commit e249061

Please sign in to comment.