-
Notifications
You must be signed in to change notification settings - Fork 6
/
connection_config.go
36 lines (30 loc) · 1.04 KB
/
connection_config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package salesforce
import (
"github.com/turbot/steampipe-plugin-sdk/v5/plugin"
)
type NamingConventionEnum string
const (
API_NATIVE NamingConventionEnum = "api_native"
SNAKE_CASE NamingConventionEnum = "snake_case"
)
type salesforceConfig struct {
URL *string `hcl:"url"`
Username *string `hcl:"username"`
Password *string `hcl:"password"`
Token *string `hcl:"token"`
ClientId *string `hcl:"client_id"`
APIVersion *string `hcl:"api_version"`
Objects *[]string `hcl:"objects"`
NamingConvention *NamingConventionEnum `hcl:"naming_convention"`
}
func ConfigInstance() interface{} {
return &salesforceConfig{}
}
// GetConfig :: retrieve and cast connection config from query data
func GetConfig(connection *plugin.Connection) salesforceConfig {
if connection == nil || connection.Config == nil {
return salesforceConfig{}
}
config, _ := connection.Config.(salesforceConfig)
return config
}