credential

package
v0.0.0-...-a991970 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	// Cloud is the cloud name that the credential applies to. Key is valid when
	// this value is set.
	Cloud string

	// Owner is the owner of the credential. Key is valid when this value is set.
	Owner user.Name

	// Name is the name of the credential. It is valid when this value is set.
	Name string
}

Key represents the natural key of a cloud credential.

func KeyFromTag

func KeyFromTag(tag names.CloudCredentialTag) Key

KeyFromTag provides a utility for converting a CloudCredentialTag into a Key struct. If the tags IsZero() returns true then a zero value Key struct is returned.

func (Key) IsZero

func (k Key) IsZero() bool

IsZero returns true if the Key struct is its zero value with no values set.

func (Key) String

func (k Key) String() string

String implements the stringer interface.

func (Key) Tag

func (k Key) Tag() (names.CloudCredentialTag, error)

Tag will convert this Key struct to a juju names CloudCredentialTag. Errors in parsing of the tag will be returned. If the Key struct is it's zero value then a zero value Tag will be returned.

func (Key) Validate

func (k Key) Validate() error

Validate is responsible for checking all of the fields of Key are in a set state that is valid for use. You can also use IsZero() to test if the Key is currently set to it's zero value.

type UUID

type UUID string

UUID represents a unique id within the juju controller for a cloud credential.

func NewUUID

func NewUUID() (UUID, error)

NewUUID generates a new credential UUID

func (UUID) String

func (u UUID) String() string

String implements the stringer interface returning a string representation of the credential UUID.

func (UUID) Validate

func (u UUID) Validate() error

Validate ensures the consistency of the uuid. If the UUID is invalid an error satisfying errors.NotValid will be returned.

Jump to

Keyboard shortcuts

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