transcoder

package
v0.2.24 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0, BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package transcoder is used for API related object transformations

Package transcoder is used for API related object transformations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeProviderSpecFromMachineClass

func DecodeProviderSpecFromMachineClass(machineClass *v1alpha1.MachineClass, secret *corev1.Secret) (*apis.ProviderSpec, error)

DecodeProviderSpecFromMachineClass decodes the given MachineClass to receive the ProviderSpec.

PARAMETERS machineClass *v1alpha1.MachineClass MachineClass backing the machine object secret *corev1.Secret Kubernetes secret that contains any sensitive data/credentials

func DecodeServerIDAsStringFromProviderID

func DecodeServerIDAsStringFromProviderID(providerID string) (string, error)

DecodeServerIDAsStringFromProviderID decodes the given ProviderID to extract the server ID.

PARAMETERS providerID string Provider ID to parse

func DecodeServerIDFromProviderID

func DecodeServerIDFromProviderID(providerID string) (int, error)

DecodeServerIDFromProviderID decodes the given ProviderID to extract the server ID.

PARAMETERS providerID string Provider ID to parse

func DecodeZoneFromProviderID added in v0.2.0

func DecodeZoneFromProviderID(providerID string) (string, error)

DecodeZoneFromProviderID decodes the given ProviderID to extract the datacenter zone.

PARAMETERS providerID string Provider ID to parse

func EncodeProviderID

func EncodeProviderID(zone string, serverID int) string

EncodeProviderID encodes the ProviderID string based on the given zone and server ID.

PARAMETERS zone string Datacenter zone serverID string Server ID

Types

type ServerData

type ServerData struct {
	ID   int
	Zone string
}

ProviderSpec is the spec to be used while parsing the calls.

func DecodeServerDataFromProviderID

func DecodeServerDataFromProviderID(providerID string) (*ServerData, error)

DecodeServerDataFromProviderID decodes the given provider ID to extract the server specific data.

PARAMETERS providerID string Provider ID to parse

Jump to

Keyboard shortcuts

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