Documentation
¶
Index ¶
- Constants
- func IsNotFound(err error) bool
- func LateInitializeBoolPtr(in *bool, from *bool) *bool
- func LateInitializeIntPtr(in *int, from *int) *int
- func LateInitializeString(in string, from *string) string
- func LateInitializeStringPtr(in *string, from *string) *string
- type Client
- type Credentials
- func (c *Credentials) GetAPIKey(apiKey string) string
- func (c *Credentials) GetFacilityID(facilityID string) string
- func (c *Credentials) GetProjectID(projectID string) string
- func (c *Credentials) SetAPIKey(apiKey string)
- func (c *Credentials) SetFacilityID(facilityID string)
- func (c *Credentials) SetProjectID(projectID string)
- type DefaultGetter
- type DefaultSetter
- type Defaulter
Constants ¶
const ( CredentialAPIKey = "" CredentialProjectID = "" CredentialFacilityID = "" )
Using these constants causes Credential methods to return the credential configured values
Variables ¶
This section is empty.
Functions ¶
func LateInitializeBoolPtr ¶
LateInitializeBoolPtr returns in if it's non-nil, otherwise returns from
func LateInitializeIntPtr ¶
LateInitializeIntPtr returns in if it's non-nil, otherwise returns from
func LateInitializeString ¶
LateInitializeString returns `from` if `in` is empty and in other cases it returns `in`.
func LateInitializeStringPtr ¶
LateInitializeStringPtr returns `from` if `in` is empty and in other cases it returns `in`.
Types ¶
type Client ¶
type Client struct { *Credentials Client *packngo.Client }
Client is a structure that embeds Credentials for the purposes of defaulting to those credential supplied values during Equinix Metal API usage. This allows for the Device resource to not require a ProjectID, for example, since the provider was configured with a ProjectID.
type Credentials ¶
type Credentials struct { APIKey string `json:"apiKey"` ProjectID string `json:"projectID"` FacilityID string `json:"facilityID"` }
Credentials is a common credential format used by various Equinix Metal Kubernetes providers
func GetAuthInfo ¶ added in v0.0.6
func GetAuthInfo(ctx context.Context, c client.Client, mg resource.Managed) (credentials *Credentials, err error)
GetAuthInfo returns the necessary authentication information that is necessary to use when the controller connects to Equinix Metal API in order to reconcile the managed resource.
func NewCredentialsFromJSON ¶ added in v0.0.6
func NewCredentialsFromJSON(j []byte) (*Credentials, error)
NewCredentialsFromJSON parses JSON bytes returning an Equinix Metal Credentials configuration
func UseProviderConfig ¶ added in v0.0.6
func UseProviderConfig(ctx context.Context, c client.Client, mg resource.Managed) (credentials *Credentials, err error)
UseProviderConfig to return GCP authentication information.
func (*Credentials) GetAPIKey ¶
func (c *Credentials) GetAPIKey(apiKey string) string
GetAPIKey returns the supplied APIKey or the APIKey included with the Client credentials (if any)
func (*Credentials) GetFacilityID ¶
func (c *Credentials) GetFacilityID(facilityID string) string
GetFacilityID returns the supplied FacilityID or the FacilityID included with the Client credentials (if any)
func (*Credentials) GetProjectID ¶
func (c *Credentials) GetProjectID(projectID string) string
GetProjectID returns the supplied ProjectID or the ProjectID included with the Client credentials (if any)
func (*Credentials) SetAPIKey ¶
func (c *Credentials) SetAPIKey(apiKey string)
SetAPIKey sets the default APIKey for the client
func (*Credentials) SetFacilityID ¶
func (c *Credentials) SetFacilityID(facilityID string)
SetFacilityID sets the default FacilityID for the client
func (*Credentials) SetProjectID ¶
func (c *Credentials) SetProjectID(projectID string)
SetProjectID sets the default ProjectID for the client
type DefaultGetter ¶
DefaultGetter provides setters for common Equinix Metal client properties
type DefaultSetter ¶
DefaultSetter provides setters for common Equinix Metal client properties
type Defaulter ¶
type Defaulter interface { DefaultGetter DefaultSetter }
Defaulter provides getter and setters for common Equinix Metal client properties