Documentation ¶
Index ¶
- func ExtractKeyPairsInto(r pagination.Page, v interface{}) error
- func List(c *edgecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type GetResult
- type KeyPair
- type KeyPairPage
- type ListOpts
- type ListOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractKeyPairsInto ¶
func ExtractKeyPairsInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *edgecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
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 ¶
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 ¶
func Create(c *edgecloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create accepts a CreateOpts struct and creates a new keypair using the values provided.
func (CreateResult) Extract ¶
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 ¶
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 ¶
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 ¶
ListOpts allows the filtering and sorting of paginated collections through the API.
func (ListOpts) ToKeyPairListQuery ¶
ToKeyPairListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
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 ¶
Extract is a function that accepts a result and extracts a keypair resource.
func (UpdateResult) ExtractInto ¶
func (r UpdateResult) ExtractInto(v interface{}) error