Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AuthOrder = []AuthSource{ AuthSourceEnvBearer, AuthSourceEnvBasic, AuthSourceCfgBearer, AuthSourceCfgBasic, }
all possible sources in priority order
Functions ¶
func EnforceClient ¶ added in v6.7.2
func EnforceClient(user, pass, token, hostUrl string)
EnforceClient sets the global client instance to a new client with the given credentials ( use only for testing/special cases)
Types ¶
type AuthSource ¶ added in v6.9.0
type AuthSource string
AuthSource represents a human-readable description of where the client's authentication credentials were sourced from.
const ( AuthSourceEnvBearer AuthSource = "environment variable: IONOS_TOKEN" AuthSourceEnvBasic AuthSource = "environment variables: IONOS_USERNAME, IONOS_PASSWORD" AuthSourceCfgBearer AuthSource = "credentials from config file: token" AuthSourceCfgBasic AuthSource = "credentials from config file: username, password" AuthSourceNone AuthSource = "no authentication provided" )
type Client ¶
type Client struct {
Config *fileconfiguration.FileConfig
ConfigPath string // Path to the config file used to create this client, if any.
AuthSource AuthSource
URLOverride string // If the client was created with a specific URL override, this will hold that value. If we notice a change in the URL, we need to re-create the client.
CloudClient *cloudv6.APIClient
AuthClient *auth.APIClient
CertManagerClient *cert.APIClient
RegistryClient *containerregistry.APIClient
DnsClient *dns.APIClient
LoggingServiceClient *logging.APIClient
VMAscClient *vmasc.AutoScalingGroupsApiService
VPNClient *vpn.APIClient
CDNClient *cdn.APIClient
Kafka *kafka.APIClient
Monitoring *monitoring.APIClient
PostgresClient *psql.APIClient
MongoClient *mongo.APIClient
MariaClient *mariadb.APIClient
InMemoryDBClient *inmemorydb.APIClient
}
func Must ¶
Must gets the client obj or fatally dies You can provide some optional custom error handlers as params. The err is sent to each error handler in order. The default error handler is die.Die which exits with code 1 and violently terminates the program
func NewClient ¶ added in v6.7.0
NewClient creates a new client with the given credentials. It is used for testing purposes or when you want to create a client with specific credentials. It is highly recommended to use the Get() or Must() functions instead, as they handle the configuration file and environment variables automatically.
type ConfigSource ¶ added in v6.9.1
type ConfigSource struct {
Config *fileconfiguration.FileConfig
Path string
}
ConfigSource holds a loaded FileConfig (or nil) plus the path it came from.