spotinst

package
Version: v1.103.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 9 Imported by: 224

Documentation

Index

Constants

View Source
const SDKName = "spotinst-sdk-go"

SDKName is the name of the SDK.

View Source
const SDKVersion = "1.103.0"

SDKVersion is the current version of the SDK.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool returns a pointer to of the bool value passed in.

func BoolMap

func BoolMap(src map[string]bool) map[string]*bool

BoolMap converts a string map of bool values into a string map of bool pointers

func BoolSlice

func BoolSlice(src []bool) []*bool

BoolSlice converts a slice of bool values into a slice of bool pointers

func BoolValue

func BoolValue(v *bool) bool

BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.

func BoolValueMap

func BoolValueMap(src map[string]*bool) map[string]bool

BoolValueMap converts a string map of bool pointers into a string map of bool values

func BoolValueSlice

func BoolValueSlice(src []*bool) []bool

BoolValueSlice converts a slice of bool pointers into a slice of bool values

func DefaultBaseURL

func DefaultBaseURL() *url.URL

DefaultBaseURL returns the default base URL.

func DefaultContentType added in v1.39.1

func DefaultContentType() string

DefaultContentType returns the default Content-Type header.

func DefaultHTTPClient

func DefaultHTTPClient() *http.Client

DefaultHTTPClient returns a new http.Client with similar default values to http.Client, but with a non-shared Transport, idle connections disabled, and KeepAlives disabled.

func DefaultTransport

func DefaultTransport() *http.Transport

DefaultTransport returns a new http.Transport with similar default values to http.DefaultTransport. Do not use this for transient transports as it can leak file descriptors over time. Only use this for transports that will be re-used for the same host(s).

func DefaultUserAgent added in v1.39.0

func DefaultUserAgent() string

DefaultUserAgent returns the default User-Agent header.

func Float64

func Float64(v float64) *float64

Float64 returns a pointer to of the float64 value passed in.

func Float64Map

func Float64Map(src map[string]float64) map[string]*float64

Float64Map converts a string map of float64 values into a string map of float64 pointers.

func Float64Slice

func Float64Slice(src []float64) []*float64

Float64Slice converts a slice of float64 values into a slice of float64 pointers.

func Float64Value

func Float64Value(v *float64) float64

Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.

func Float64ValueMap

func Float64ValueMap(src map[string]*float64) map[string]float64

Float64ValueMap converts a string map of float64 pointers into a string map of float64 values.

func Float64ValueSlice

func Float64ValueSlice(src []*float64) []float64

Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values.

func Int

func Int(v int) *int

Int returns a pointer to of the int value passed in.

func Int64

func Int64(v int64) *int64

Int64 returns a pointer to of the int64 value passed in.

func Int64Map

func Int64Map(src map[string]int64) map[string]*int64

Int64Map converts a string map of int64 values into a string map of int64 pointers.

func Int64Slice

func Int64Slice(src []int64) []*int64

Int64Slice converts a slice of int64 values into a slice of int64 pointers.

func Int64Value

func Int64Value(v *int64) int64

Int64Value returns the value of the int64 pointer passed in or 0 if the pointer is nil.

func Int64ValueMap

func Int64ValueMap(src map[string]*int64) map[string]int64

Int64ValueMap converts a string map of int64 pointers into a string map of int64 values.

func Int64ValueSlice

func Int64ValueSlice(src []*int64) []int64

Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values.

func IntMap

func IntMap(src map[string]int) map[string]*int

IntMap converts a string map of int values into a string map of int pointers.

func IntSlice

func IntSlice(src []int) []*int

IntSlice converts a slice of int values into a slice of int pointers.

func IntValue

func IntValue(v *int) int

IntValue returns the value of the int pointer passed in or 0 if the pointer is nil.

func IntValueMap

func IntValueMap(src map[string]*int) map[string]int

IntValueMap converts a string map of int pointers into a string map of int values.

func IntValueSlice

func IntValueSlice(src []*int) []int

IntValueSlice converts a slice of int pointers into a slice of int values.

func String

func String(v string) *string

String returns a pointer to of the string value passed in.

func StringMap

func StringMap(src map[string]string) map[string]*string

StringMap converts a string map of string values into a string map of string pointers

func StringSlice

func StringSlice(src []string) []*string

StringSlice converts a slice of string values into a slice of string pointers

func StringValue

func StringValue(v *string) string

StringValue returns the value of the string pointer passed in or "" if the pointer is nil.

func StringValueMap

func StringValueMap(src map[string]*string) map[string]string

StringValueMap converts a string map of string pointers into a string map of string values

func StringValueSlice

func StringValueSlice(src []*string) []string

StringValueSlice converts a slice of string pointers into a slice of string values

func Time

func Time(v time.Time) *time.Time

Time returns a pointer to of the time.Time value passed in.

func TimeMap

func TimeMap(src map[string]time.Time) map[string]*time.Time

TimeMap converts a string map of time.Time values into a string map of time.Time pointers.

func TimeSlice

func TimeSlice(src []time.Time) []*time.Time

TimeSlice converts a slice of time.Time values into a slice of time.Time pointers.

func TimeValue

func TimeValue(v *time.Time) time.Time

TimeValue returns the value of the time.Time pointer passed in or time.Time{} if the pointer is nil.

func TimeValueMap

func TimeValueMap(src map[string]*time.Time) map[string]time.Time

TimeValueMap converts a string map of time.Time pointers into a string map of time.Time values.

func TimeValueSlice

func TimeValueSlice(src []*time.Time) []time.Time

TimeValueSlice converts a slice of time.Time pointers into a slice of time.Time values.

Types

type Config

type Config struct {
	// The base URL the SDK's HTTP client will use when invoking HTTP requests.
	BaseURL *url.URL

	// The HTTP Client the SDK's API clients will use to invoke HTTP requests.
	//
	// Defaults to a DefaultHTTPClient allowing API clients to create copies of
	// the HTTP client for service specific customizations.
	HTTPClient *http.Client

	// The credentials object to use when signing requests.
	//
	// Defaults to a chain of credential providers to search for credentials in
	// environment variables and shared credential file.
	Credentials *credentials.Credentials

	// The logger writer interface to write logging messages to.
	//
	// Defaults to standard out.
	Logger log.Logger

	// The User-Agent and Content-Type HTTP headers to set when invoking HTTP
	// requests.
	UserAgent, ContentType string
}

A Config provides Configuration to a service client instance.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default configuration for the client. By default this will pool and reuse idle connections to API. If you have a long-lived client object, this is the desired behavior and should make the most efficient use of the connections to API.

func (*Config) Merge

func (c *Config) Merge(cfgs ...*Config)

Merge merges the passed in configs into the existing config object.

func (*Config) WithBaseURL

func (c *Config) WithBaseURL(rawurl string) *Config

WithBaseURL defines the base URL of the Spotinst API.

func (*Config) WithContentType

func (c *Config) WithContentType(ct string) *Config

WithContentType defines the content type.

func (*Config) WithCredentials

func (c *Config) WithCredentials(creds *credentials.Credentials) *Config

WithCredentials defines the credentials.

func (*Config) WithHTTPClient

func (c *Config) WithHTTPClient(client *http.Client) *Config

WithHTTPClient defines the HTTP client.

func (*Config) WithLogger

func (c *Config) WithLogger(logger log.Logger) *Config

WithLogger defines the logger for informational messages, e.g. requests and their response times. It is nil by default.

func (*Config) WithUserAgent

func (c *Config) WithUserAgent(ua string) *Config

WithUserAgent defines the user agent.

Directories

Path Synopsis
util
uritemplates
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).

Jump to

Keyboard shortcuts

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