keypairs

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MPL-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractKeyPairsInto

func ExtractKeyPairsInto(r pagination.Page, v interface{}) error

Types

type CreateOpts

type CreateOpts struct {
	Name      string `json:"sshkey_name" required:"true"`
	PublicKey string `json:"public_key,omitempty" required:"true"`
	ProjectID int    `json:"project_id" required:"true"`
}

CreateOpts represents options used to create a keypair.

func (CreateOpts) ToKeyPairCreateMap

func (opts CreateOpts) ToKeyPairCreateMap() (map[string]interface{}, error)

ToKeyPairCreateMap builds a request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToKeyPairCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a KeyPair.

func Create

Create accepts a CreateOpts struct and creates a new keypair using the values provided.

func (CreateResult) Extract

func (r CreateResult) Extract() (*KeyPair, error)

Extract is a function that accepts a result and extracts a keypair resource.

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

type DeleteResult

type DeleteResult struct {
	edgecloud.ErrResult
}

DeleteResult represents the result of a delete operation.

func Delete

func Delete(c *edgecloud.ServiceClient, keypairID string) (r DeleteResult)

Delete accepts a unique ID and deletes the keypair associated with it.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents the result of a get operation. Call its Extract method to interpret it as a KeyPair.

func Get

func Get(c *edgecloud.ServiceClient, id string) (r GetResult)

Get retrieves a specific keypair based on its name or ID.

func (GetResult) Extract

func (r GetResult) Extract() (*KeyPair, error)

Extract is a function that accepts a result and extracts a keypair resource.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type KeyPair

type KeyPair struct {
	Name        string  `json:"sshkey_name"`
	ID          string  `json:"sshkey_id"`
	Fingerprint string  `json:"fingerprint"`
	PublicKey   string  `json:"public_key"`
	PrivateKey  *string `json:"private_key"`
	ProjectID   int     `json:"project_id"`
}

KeyPair represents a keypair structure.

func ExtractKeyPairs

func ExtractKeyPairs(r pagination.Page) ([]KeyPair, error)

ExtractKeyPair accepts a Page struct, specifically a KeyPairPage struct, and extracts the elements into a slice of KeyPair structs. In other words, a generic collection is mapped into a relevant slice.

func ListAll

func ListAll(c *edgecloud.ServiceClient, opts ListOptsBuilder) ([]KeyPair, error)

type KeyPairPage

type KeyPairPage struct {
	pagination.LinkedPageBase
}

KeyPairPage is the page returned by a pager when traversing over a collection of keypairs.

func (KeyPairPage) IsEmpty

func (r KeyPairPage) IsEmpty() (bool, error)

IsEmpty checks whether a KeyPairPage struct is empty.

func (KeyPairPage) NextPageURL

func (r KeyPairPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of keypairs has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type ListOpts

type ListOpts struct {
	UserID    string `q:"user_id"`
	ProjectID int    `q:"project_id"`
}

ListOpts allows the filtering and sorting of paginated collections through the API.

func (ListOpts) ToKeyPairListQuery

func (opts ListOpts) ToKeyPairListQuery() (string, error)

ToKeyPairListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToKeyPairListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a KeyPair.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*KeyPair, error)

Extract is a function that accepts a result and extracts a keypair resource.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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