Documentation ¶
Index ¶
- Constants
- Variables
- func NewControlShutdownEndpoint(s Service) goa.Endpoint
- func NewControlStartEndpoint(s Service) goa.Endpoint
- func NewControlStopEndpoint(s Service) goa.Endpoint
- func NewVMCreateEndpoint(s Service) goa.Endpoint
- func NewVMDeleteEndpoint(s Service) goa.Endpoint
- func NewVMGetEndpoint(s Service) goa.Endpoint
- func NewVMListEndpoint(s Service) goa.Endpoint
- func NewVMUpdateEndpoint(s Service) goa.Endpoint
- type Client
- func (c *Client) ControlShutdown(ctx context.Context, p *ControlShutdownPayload) (err error)
- func (c *Client) ControlStart(ctx context.Context, p *ControlStartPayload) (err error)
- func (c *Client) ControlStop(ctx context.Context, p *ControlStopPayload) (err error)
- func (c *Client) VMCreate(ctx context.Context, p *CreateVM) (res uint64, err error)
- func (c *Client) VMDelete(ctx context.Context, p *VMDeletePayload) (err error)
- func (c *Client) VMGet(ctx context.Context, p *VMGetPayload) (res *UpdatedVM, err error)
- func (c *Client) VMList(ctx context.Context) (res []uint64, err error)
- func (c *Client) VMUpdate(ctx context.Context, p *VMUpdatePayload) (err error)
- type ControlShutdownPayload
- type ControlStartPayload
- type ControlStopPayload
- type CreateVM
- type Endpoints
- type Image
- type Service
- type Storage
- type UpdatedVM
- type VMDeletePayload
- type VMGetPayload
- type VMUpdatePayload
Constants ¶
const ServiceName = "spin-apiserver"
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 = [8]string{"vm_create", "vm_delete", "vm_list", "vm_get", "vm_update", "control_start", "control_stop", "control_shutdown"}
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 NewControlShutdownEndpoint ¶
NewControlShutdownEndpoint returns an endpoint function that calls the method "control_shutdown" of service "spin-apiserver".
func NewControlStartEndpoint ¶
NewControlStartEndpoint returns an endpoint function that calls the method "control_start" of service "spin-apiserver".
func NewControlStopEndpoint ¶
NewControlStopEndpoint returns an endpoint function that calls the method "control_stop" of service "spin-apiserver".
func NewVMCreateEndpoint ¶
NewVMCreateEndpoint returns an endpoint function that calls the method "vm_create" of service "spin-apiserver".
func NewVMDeleteEndpoint ¶
NewVMDeleteEndpoint returns an endpoint function that calls the method "vm_delete" of service "spin-apiserver".
func NewVMGetEndpoint ¶
NewVMGetEndpoint returns an endpoint function that calls the method "vm_get" of service "spin-apiserver".
func NewVMListEndpoint ¶
NewVMListEndpoint returns an endpoint function that calls the method "vm_list" of service "spin-apiserver".
func NewVMUpdateEndpoint ¶
NewVMUpdateEndpoint returns an endpoint function that calls the method "vm_update" of service "spin-apiserver".
Types ¶
type Client ¶
type Client struct { VMCreateEndpoint goa.Endpoint VMDeleteEndpoint goa.Endpoint VMListEndpoint goa.Endpoint VMGetEndpoint goa.Endpoint VMUpdateEndpoint goa.Endpoint ControlStartEndpoint goa.Endpoint ControlStopEndpoint goa.Endpoint ControlShutdownEndpoint goa.Endpoint }
Client is the "spin-apiserver" service client.
func NewClient ¶
func NewClient(vMCreate, vMDelete, vMList, vMGet, vMUpdate, controlStart, controlStop, controlShutdown goa.Endpoint) *Client
NewClient initializes a "spin-apiserver" service client given the endpoints.
func (*Client) ControlShutdown ¶
func (c *Client) ControlShutdown(ctx context.Context, p *ControlShutdownPayload) (err error)
ControlShutdown calls the "control_shutdown" endpoint of the "spin-apiserver" service.
func (*Client) ControlStart ¶
func (c *Client) ControlStart(ctx context.Context, p *ControlStartPayload) (err error)
ControlStart calls the "control_start" endpoint of the "spin-apiserver" service.
func (*Client) ControlStop ¶
func (c *Client) ControlStop(ctx context.Context, p *ControlStopPayload) (err error)
ControlStop calls the "control_stop" endpoint of the "spin-apiserver" service.
func (*Client) VMDelete ¶
func (c *Client) VMDelete(ctx context.Context, p *VMDeletePayload) (err error)
VMDelete calls the "vm_delete" endpoint of the "spin-apiserver" service.
type ControlShutdownPayload ¶
type ControlShutdownPayload struct { // ID of VM to shutdown ID uint64 }
ControlShutdownPayload is the payload type of the spin-apiserver service control_shutdown method.
type ControlStartPayload ¶
type ControlStartPayload struct { // ID of VM to start ID uint64 }
ControlStartPayload is the payload type of the spin-apiserver service control_start method.
type ControlStopPayload ¶
type ControlStopPayload struct { // ID of VM to stop ID uint64 }
ControlStopPayload is the payload type of the spin-apiserver service control_stop method.
type CreateVM ¶
type CreateVM struct { // Storage references Storage []*Storage // Name of VM; does not need to be unique Name string // CPU count Cpus uint // Memory (in megabytes) Memory uint }
CreateVM is the payload type of the spin-apiserver service vm_create method.
type Endpoints ¶
type Endpoints struct { VMCreate goa.Endpoint VMDelete goa.Endpoint VMList goa.Endpoint VMGet goa.Endpoint VMUpdate goa.Endpoint ControlStart goa.Endpoint ControlStop goa.Endpoint ControlShutdown goa.Endpoint }
Endpoints wraps the "spin-apiserver" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "spin-apiserver" service with endpoints.
type Service ¶
type Service interface { // VMCreate implements vm_create. VMCreate(context.Context, *CreateVM) (res uint64, err error) // VMDelete implements vm_delete. VMDelete(context.Context, *VMDeletePayload) (err error) // VMList implements vm_list. VMList(context.Context) (res []uint64, err error) // VMGet implements vm_get. VMGet(context.Context, *VMGetPayload) (res *UpdatedVM, err error) // VMUpdate implements vm_update. VMUpdate(context.Context, *VMUpdatePayload) (err error) // ControlStart implements control_start. ControlStart(context.Context, *ControlStartPayload) (err error) // ControlStop implements control_stop. ControlStop(context.Context, *ControlStopPayload) (err error) // ControlShutdown implements control_shutdown. ControlShutdown(context.Context, *ControlShutdownPayload) (err error) }
Bridge between the outer-facing UIs and the internals
type UpdatedVM ¶
type UpdatedVM struct { // Image references Images []*Image // Name of VM; does not need to be unique Name string // CPU count Cpus uint // Memory (in megabytes) Memory uint }
UpdatedVM is the result type of the spin-apiserver service vm_get method.
type VMDeletePayload ¶
type VMDeletePayload struct { // ID of VM to delete ID uint64 }
VMDeletePayload is the payload type of the spin-apiserver service vm_delete method.
type VMGetPayload ¶
type VMGetPayload struct { // ID of VM to retrieve ID uint64 }
VMGetPayload is the payload type of the spin-apiserver service vm_get method.
type VMUpdatePayload ¶
type VMUpdatePayload struct { // ID of VM to Update ID uint64 // VM Manifest to Update VM *UpdatedVM }
VMUpdatePayload is the payload type of the spin-apiserver service vm_update method.