Documentation
¶
Index ¶
- Constants
- Variables
- func NewCreateEndpoint(s Service) goa.Endpoint
- func NewDeleteEndpoint(s Service) goa.Endpoint
- func NewGetEndpoint(s Service) goa.Endpoint
- func NewListEndpoint(s Service) goa.Endpoint
- func NewViewedSshkey(res *Sshkey, view string) *sshkeysviews.Sshkey
- type AlreadyExists
- type Client
- func (c *Client) Create(ctx context.Context, p *CreateSSHKeyPayload) (res *Sshkey, err error)
- func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
- func (c *Client) Get(ctx context.Context, p *GetPayload) (res *Sshkey, err error)
- func (c *Client) List(ctx context.Context, p *ListPayload) (res []*Sshkey, err error)
- type CreateSSHKeyPayload
- type DeletePayload
- type Endpoints
- type GetPayload
- type Invalid
- type ListPayload
- type NotFound
- type Service
- type Sshkey
Constants ¶
const APIName = "kube-workspaces"
APIName is the name of the API as defined in the design.
const APIVersion = "1.0.0"
APIVersion is the version of the API as defined in the design.
const ServiceName = "sshkeys"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [4]string{"list", "get", "create", "delete"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func NewCreateEndpoint ¶
NewCreateEndpoint returns an endpoint function that calls the method "create" of service "sshkeys".
func NewDeleteEndpoint ¶
NewDeleteEndpoint returns an endpoint function that calls the method "delete" of service "sshkeys".
func NewGetEndpoint ¶
NewGetEndpoint returns an endpoint function that calls the method "get" of service "sshkeys".
func NewListEndpoint ¶
NewListEndpoint returns an endpoint function that calls the method "list" of service "sshkeys".
func NewViewedSshkey ¶
func NewViewedSshkey(res *Sshkey, view string) *sshkeysviews.Sshkey
NewViewedSshkey initializes viewed result type Sshkey from result type Sshkey using the given view.
Types ¶
type AlreadyExists ¶
type AlreadyExists string
SSH key already exists
func (AlreadyExists) Error ¶
func (e AlreadyExists) Error() string
Error returns an error description.
func (AlreadyExists) ErrorName
deprecated
func (e AlreadyExists) ErrorName() string
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (AlreadyExists) GoaErrorName ¶
func (e AlreadyExists) GoaErrorName() string
GoaErrorName returns the error name.
type Client ¶
type Client struct {
ListEndpoint goa.Endpoint
GetEndpoint goa.Endpoint
CreateEndpoint goa.Endpoint
DeleteEndpoint goa.Endpoint
}
Client is the "sshkeys" service client.
func (*Client) Create ¶
Create calls the "create" endpoint of the "sshkeys" service. Create may return the following errors:
- "already_exists" (type AlreadyExists)
- "invalid" (type Invalid)
- error: internal error
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
Delete calls the "delete" endpoint of the "sshkeys" service. Delete may return the following errors:
- "not_found" (type NotFound)
- error: internal error
type CreateSSHKeyPayload ¶
type CreateSSHKeyPayload struct {
// Resource name for the SshKey CR
Name string
// Target namespace (defaults to the user's personal namespace)
Namespace *string
// Human-friendly label for the key
KeyName *string
// SSH public key line (e.g. ssh-ed25519 AAAA... user@host)
PublicKey string
}
CreateSSHKeyPayload is the payload type of the sshkeys service create method.
type DeletePayload ¶
DeletePayload is the payload type of the sshkeys service delete method.
type Endpoints ¶
type Endpoints struct {
List goa.Endpoint
Get goa.Endpoint
Create goa.Endpoint
Delete goa.Endpoint
}
Endpoints wraps the "sshkeys" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "sshkeys" service with endpoints.
type GetPayload ¶
GetPayload is the payload type of the sshkeys service get method.
type Invalid ¶
type Invalid string
Invalid SSH key
func (Invalid) ErrorName
deprecated
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (Invalid) GoaErrorName ¶
GoaErrorName returns the error name.
type ListPayload ¶
type ListPayload struct {
// Filter by namespace
Namespace *string
}
ListPayload is the payload type of the sshkeys service list method.
type NotFound ¶
type NotFound string
SSH key not found
func (NotFound) ErrorName
deprecated
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (NotFound) GoaErrorName ¶
GoaErrorName returns the error name.
type Service ¶
type Service interface {
// List the user's SSH public keys
List(context.Context, *ListPayload) (res []*Sshkey, err error)
// Get an SSH public key by name
Get(context.Context, *GetPayload) (res *Sshkey, err error)
// Store a new SSH public key
Create(context.Context, *CreateSSHKeyPayload) (res *Sshkey, err error)
// Delete an SSH public key
Delete(context.Context, *DeletePayload) (err error)
}
SSH public key management service
type Sshkey ¶
type Sshkey struct {
// Resource name of the SshKey CR
Name string
// Kubernetes namespace
Namespace string
// Human-friendly label
KeyName *string
// SSH public key line
PublicKey string
// SHA256 fingerprint of the key
Fingerprint *string
// Creation timestamp
CreatedAt *string
}
Sshkey is the result type of the sshkeys service get method.
func NewSshkey ¶
func NewSshkey(vres *sshkeysviews.Sshkey) *Sshkey
NewSshkey initializes result type Sshkey from viewed result type Sshkey.