Documentation
¶
Index ¶
- func Base64Encode(message []byte) string
- func CmdHelp(cmd *cobra.Command, _ []string)
- func ConvertInt64PToFloat64P(i *int64) *float64
- func ConvertStringMapToInterfaceMap(m *map[string]string) *map[string]interface{}
- func ConvertTimePToDateTimeString(t *time.Time) string
- func Float64Ptr(f float64) *float64
- func Int64Ptr(i int64) *int64
- func JoinStringKeys(m map[string]any, sep string) string
- func JoinStringKeysPtr(m map[string]any, sep string) string
- func JoinStringPtr(vals *[]string, sep string) string
- func Ptr[T any](v T) *T
- func PtrByteSizeDefault(size *int64, defaultValue string) string
- func PtrGigaByteSizeDefault(size *int64, defaultValue string) string
- func PtrString[T any](t *T) string
- func PtrStringDefault[T any](v *T, defaultValue string) string
- func PtrValue[T any](t *T) (r T)
- func Truncate(s *string, maxLen int) string
- func UserAgentConfigOption(cliVersion string) sdkConfig.ConfigurationOption
- func ValidateURLDomain(value string) error
- func ValidateUUID(value string) error
- type Base64Bytes
- type Base64PatchedServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Encode ¶ added in v0.27.0
Base64Encode encodes a []byte to a base64 representation as string
func CmdHelp ¶
CmdHelp is used to explicitly set the Run function for non-leaf commands to the command help function, so that we can catch invalid commands This is a workaround needed due to the open issue on the Cobra repo: https://github.com/spf13/cobra/issues/706
func ConvertInt64PToFloat64P ¶ added in v0.2.3
ConvertInt64PToFloat64P converts an int64 pointer to a float64 pointer This function will return nil if the input is nil
func ConvertStringMapToInterfaceMap ¶ added in v0.34.0
ConvertStringMapToInterfaceMap converts a map[string]string to a pointer to map[string]interface{}. Returns nil if the input map is empty.
func ConvertTimePToDateTimeString ¶ added in v0.22.0
ConvertTimePToDateTimeString converts a time.Time pointer to a string represented as "2006-01-02 15:04:05" This function will return an empty string if the input is nil
func Float64Ptr ¶ added in v0.2.3
Float64Ptr returns a pointer to a float64 Needed because the Ptr function only returns pointer to float
func Int64Ptr ¶ added in v0.2.3
Int64Ptr returns a pointer to an int64 Needed because the Ptr function only returns pointer to int
func JoinStringKeys ¶ added in v0.21.0
JoinStringKeys concatenates the string keys of a map, each separatore by the [sep] string.
func JoinStringKeysPtr ¶ added in v0.21.0
JoinStringKeysPtr concatenates the string keys of a map pointer, each separatore by the [sep] string.
func JoinStringPtr ¶ added in v0.24.0
JoinStringPtr concatenates the strings of a string slice pointer, each separatore by the [sep] string.
func PtrByteSizeDefault ¶ added in v0.24.0
PtrByteSizeDefault return the value of an in64 pointer to a string representation of bytesize. If the pointer is nil, it returns the [defaultValue].
func PtrGigaByteSizeDefault ¶ added in v0.35.0
PtrGigaByteSizeDefault return the value of an int64 pointer to a string representation of gigabytes. If the pointer is nil, it returns the [defaultValue].
func PtrString ¶ added in v0.20.0
PtrString creates a string representation of a passed object pointer or returns an empty string, if the passed object is _nil_.
func PtrStringDefault ¶ added in v0.24.0
PtrStringDefault return the value of a pointer [v] as string. If the pointer is nil, it returns the [defaultValue].
func PtrValue ¶ added in v0.26.0
func PtrValue[T any](t *T) (r T)
PtrValue returns the dereferenced value if the pointer is not nil. Otherwise the types zero element is returned
func Truncate ¶ added in v0.31.0
Truncate trims the passed string (if it is not nil). If the input string is longer than the given length, it is truncated to _maxLen_ and a ellipsis (…) is attached. Therefore the resulting string has at most length _maxLen-1_
func UserAgentConfigOption ¶ added in v0.32.0
func UserAgentConfigOption(cliVersion string) sdkConfig.ConfigurationOption
func ValidateURLDomain ¶ added in v0.12.0
func ValidateUUID ¶
ValidateUUID validates if the provided string is a valid UUID
Types ¶
type Base64Bytes ¶ added in v0.43.0
type Base64Bytes []byte
Base64Bytes implements yaml.Marshaler to convert []byte to base64 strings ref: https://carlosbecker.com/posts/go-custom-marshaling
func (Base64Bytes) MarshalYAML ¶ added in v0.43.0
func (b Base64Bytes) MarshalYAML() (interface{}, error)
MarshalYAML implements yaml.Marshaler
type Base64PatchedServer ¶ added in v0.43.0
type Base64PatchedServer struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` Status *string `json:"status,omitempty"` AvailabilityZone *string `json:"availabilityZone,omitempty"` BootVolume *iaas.CreateServerPayloadBootVolume `json:"bootVolume,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` ErrorMessage *string `json:"errorMessage,omitempty"` PowerStatus *string `json:"powerStatus,omitempty"` AffinityGroup *string `json:"affinityGroup,omitempty"` ImageId *string `json:"imageId,omitempty"` KeypairName *string `json:"keypairName,omitempty"` MachineType *string `json:"machineType,omitempty"` Labels *map[string]interface{} `json:"labels,omitempty"` LaunchedAt *time.Time `json:"launchedAt,omitempty"` MaintenanceWindow *iaas.ServerMaintenance `json:"maintenanceWindow,omitempty"` Metadata *map[string]interface{} `json:"metadata,omitempty"` Networking *iaas.CreateServerPayloadNetworking `json:"networking,omitempty"` Nics *[]iaas.ServerNetwork `json:"nics,omitempty"` SecurityGroups *[]string `json:"securityGroups,omitempty"` ServiceAccountMails *[]string `json:"serviceAccountMails,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` UserData *Base64Bytes `json:"userData,omitempty"` Volumes *[]string `json:"volumes,omitempty"` }
func ConvertToBase64PatchedServer ¶ added in v0.43.0
func ConvertToBase64PatchedServer(server *iaas.Server) *Base64PatchedServer
ConvertToBase64PatchedServer converts an iaas.Server to Base64PatchedServer This is a temporary workaround to get the desired base64 encoded yaml output for userdata and will be replaced by a fix in the Go-SDK ref: https://jira.schwarz/browse/STACKITSDK-246
func ConvertToBase64PatchedServers ¶ added in v0.43.0
func ConvertToBase64PatchedServers(servers []iaas.Server) []Base64PatchedServer
ConvertToBase64PatchedServers converts a slice of iaas.Server to a slice of Base64PatchedServer This is a temporary workaround to get the desired base64 encoded yaml output for userdata and will be replaced by a fix in the Go-SDK ref: https://jira.schwarz/browse/STACKITSDK-246