Documentation ¶
Index ¶
- Variables
- func RegisterNodeServer(s *grpc.Server, srv NodeServer)
- type ConnectResponse
- func (*ConnectResponse) Descriptor() ([]byte, []int)
- func (m *ConnectResponse) GetPath() string
- func (m *ConnectResponse) GetStatus() Status
- func (*ConnectResponse) ProtoMessage()
- func (m *ConnectResponse) Reset()
- func (m *ConnectResponse) String() string
- func (m *ConnectResponse) XXX_DiscardUnknown()
- func (m *ConnectResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ConnectResponse) XXX_Merge(src proto.Message)
- func (m *ConnectResponse) XXX_Size() int
- func (m *ConnectResponse) XXX_Unmarshal(b []byte) error
- type DriveResponse
- func (*DriveResponse) Descriptor() ([]byte, []int)
- func (m *DriveResponse) GetPath() string
- func (m *DriveResponse) GetSize() int64
- func (m *DriveResponse) GetStatus() Status
- func (*DriveResponse) ProtoMessage()
- func (m *DriveResponse) Reset()
- func (m *DriveResponse) String() string
- func (m *DriveResponse) XXX_DiscardUnknown()
- func (m *DriveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DriveResponse) XXX_Merge(src proto.Message)
- func (m *DriveResponse) XXX_Size() int
- func (m *DriveResponse) XXX_Unmarshal(b []byte) error
- type ImageName
- func (*ImageName) Descriptor() ([]byte, []int)
- func (m *ImageName) GetName() string
- func (*ImageName) ProtoMessage()
- func (m *ImageName) Reset()
- func (m *ImageName) String() string
- func (m *ImageName) XXX_DiscardUnknown()
- func (m *ImageName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ImageName) XXX_Merge(src proto.Message)
- func (m *ImageName) XXX_Size() int
- func (m *ImageName) XXX_Unmarshal(b []byte) error
- type Node
- func (n *Node) ConnectVolume(ctx context.Context, volume *Volume) (string, error)
- func (n *Node) CreateDrive(ctx context.Context, image string) (string, int64, error)
- func (n *Node) ListVMs(ctx context.Context) ([]uuid.UUID, error)
- func (n *Node) StartVM(ctx context.Context, vm model.VM) (*VmConfig, error)
- func (n *Node) StopVM(ctx context.Context, vmID uuid.UUID) error
- type NodeClient
- type NodeServer
- type NodeService
- type Response
- func (*Response) Descriptor() ([]byte, []int)
- func (m *Response) GetStatus() Status
- func (*Response) ProtoMessage()
- func (m *Response) Reset()
- func (m *Response) String() string
- func (m *Response) XXX_DiscardUnknown()
- func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Response) XXX_Merge(src proto.Message)
- func (m *Response) XXX_Size() int
- func (m *Response) XXX_Unmarshal(b []byte) error
- type Status
- type UUID
- func (*UUID) Descriptor() ([]byte, []int)
- func (m *UUID) GetValue() string
- func (*UUID) ProtoMessage()
- func (m *UUID) Reset()
- func (m *UUID) String() string
- func (m *UUID) XXX_DiscardUnknown()
- func (m *UUID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UUID) XXX_Merge(src proto.Message)
- func (m *UUID) XXX_Size() int
- func (m *UUID) XXX_Unmarshal(b []byte) error
- type UnimplementedNodeServer
- func (*UnimplementedNodeServer) ConnectVolume(ctx context.Context, req *Volume) (*ConnectResponse, error)
- func (*UnimplementedNodeServer) CreateDrive(ctx context.Context, req *ImageName) (*DriveResponse, error)
- func (*UnimplementedNodeServer) ListVMs(ctx context.Context, req *empty.Empty) (*VmList, error)
- func (*UnimplementedNodeServer) StartVM(ctx context.Context, req *VmConfig) (*VmResponse, error)
- func (*UnimplementedNodeServer) StopVM(ctx context.Context, req *UUID) (*Response, error)
- type VmConfig
- func (*VmConfig) Descriptor() ([]byte, []int)
- func (m *VmConfig) GetAddress() string
- func (m *VmConfig) GetKernelImage() string
- func (m *VmConfig) GetMemory() int64
- func (m *VmConfig) GetRootFileSystem() string
- func (m *VmConfig) GetVcpus() int64
- func (m *VmConfig) GetVmID() *UUID
- func (*VmConfig) ProtoMessage()
- func (m *VmConfig) Reset()
- func (m *VmConfig) String() string
- func (m *VmConfig) XXX_DiscardUnknown()
- func (m *VmConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VmConfig) XXX_Merge(src proto.Message)
- func (m *VmConfig) XXX_Size() int
- func (m *VmConfig) XXX_Unmarshal(b []byte) error
- type VmList
- func (*VmList) Descriptor() ([]byte, []int)
- func (m *VmList) GetVmID() []*UUID
- func (*VmList) ProtoMessage()
- func (m *VmList) Reset()
- func (m *VmList) String() string
- func (m *VmList) XXX_DiscardUnknown()
- func (m *VmList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VmList) XXX_Merge(src proto.Message)
- func (m *VmList) XXX_Size() int
- func (m *VmList) XXX_Unmarshal(b []byte) error
- type VmResponse
- func (*VmResponse) Descriptor() ([]byte, []int)
- func (m *VmResponse) GetConfig() *VmConfig
- func (m *VmResponse) GetStatus() Status
- func (*VmResponse) ProtoMessage()
- func (m *VmResponse) Reset()
- func (m *VmResponse) String() string
- func (m *VmResponse) XXX_DiscardUnknown()
- func (m *VmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VmResponse) XXX_Merge(src proto.Message)
- func (m *VmResponse) XXX_Size() int
- func (m *VmResponse) XXX_Unmarshal(b []byte) error
- type Volume
- func (*Volume) Descriptor() ([]byte, []int)
- func (m *Volume) GetImagePath() string
- func (m *Volume) GetPoolName() string
- func (m *Volume) GetVolumeID() string
- func (*Volume) ProtoMessage()
- func (m *Volume) Reset()
- func (m *Volume) String() string
- func (m *Volume) XXX_DiscardUnknown()
- func (m *Volume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Volume) XXX_Merge(src proto.Message)
- func (m *Volume) XXX_Size() int
- func (m *Volume) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Status_name = map[int32]string{
0: "SUCCESS",
1: "FAILED",
}
View Source
var Status_value = map[string]int32{
"SUCCESS": 0,
"FAILED": 1,
}
Functions ¶
func RegisterNodeServer ¶
func RegisterNodeServer(s *grpc.Server, srv NodeServer)
Types ¶
type ConnectResponse ¶
type ConnectResponse struct { Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=node.Status" json:"status,omitempty"` Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ConnectResponse) Descriptor ¶
func (*ConnectResponse) Descriptor() ([]byte, []int)
func (*ConnectResponse) GetPath ¶
func (m *ConnectResponse) GetPath() string
func (*ConnectResponse) GetStatus ¶
func (m *ConnectResponse) GetStatus() Status
func (*ConnectResponse) ProtoMessage ¶
func (*ConnectResponse) ProtoMessage()
func (*ConnectResponse) Reset ¶
func (m *ConnectResponse) Reset()
func (*ConnectResponse) String ¶
func (m *ConnectResponse) String() string
func (*ConnectResponse) XXX_DiscardUnknown ¶
func (m *ConnectResponse) XXX_DiscardUnknown()
func (*ConnectResponse) XXX_Marshal ¶
func (m *ConnectResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ConnectResponse) XXX_Merge ¶
func (m *ConnectResponse) XXX_Merge(src proto.Message)
func (*ConnectResponse) XXX_Size ¶
func (m *ConnectResponse) XXX_Size() int
func (*ConnectResponse) XXX_Unmarshal ¶
func (m *ConnectResponse) XXX_Unmarshal(b []byte) error
type DriveResponse ¶
type DriveResponse struct { Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=node.Status" json:"status,omitempty"` Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DriveResponse) Descriptor ¶
func (*DriveResponse) Descriptor() ([]byte, []int)
func (*DriveResponse) GetPath ¶
func (m *DriveResponse) GetPath() string
func (*DriveResponse) GetSize ¶
func (m *DriveResponse) GetSize() int64
func (*DriveResponse) GetStatus ¶
func (m *DriveResponse) GetStatus() Status
func (*DriveResponse) ProtoMessage ¶
func (*DriveResponse) ProtoMessage()
func (*DriveResponse) Reset ¶
func (m *DriveResponse) Reset()
func (*DriveResponse) String ¶
func (m *DriveResponse) String() string
func (*DriveResponse) XXX_DiscardUnknown ¶
func (m *DriveResponse) XXX_DiscardUnknown()
func (*DriveResponse) XXX_Marshal ¶
func (m *DriveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DriveResponse) XXX_Merge ¶
func (m *DriveResponse) XXX_Merge(src proto.Message)
func (*DriveResponse) XXX_Size ¶
func (m *DriveResponse) XXX_Size() int
func (*DriveResponse) XXX_Unmarshal ¶
func (m *DriveResponse) XXX_Unmarshal(b []byte) error
type ImageName ¶
type ImageName struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ImageName) Descriptor ¶
func (*ImageName) ProtoMessage ¶
func (*ImageName) ProtoMessage()
func (*ImageName) XXX_DiscardUnknown ¶
func (m *ImageName) XXX_DiscardUnknown()
func (*ImageName) XXX_Marshal ¶
func (*ImageName) XXX_Unmarshal ¶
type Node ¶
func (*Node) ConnectVolume ¶
func (*Node) CreateDrive ¶
type NodeClient ¶
type NodeClient interface { StartVM(ctx context.Context, in *VmConfig, opts ...grpc.CallOption) (*VmResponse, error) StopVM(ctx context.Context, in *UUID, opts ...grpc.CallOption) (*Response, error) ListVMs(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*VmList, error) CreateDrive(ctx context.Context, in *ImageName, opts ...grpc.CallOption) (*DriveResponse, error) ConnectVolume(ctx context.Context, in *Volume, opts ...grpc.CallOption) (*ConnectResponse, error) }
NodeClient is the client API for Node service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewNodeClient ¶
func NewNodeClient(cc *grpc.ClientConn) NodeClient
type NodeServer ¶
type NodeServer interface { StartVM(context.Context, *VmConfig) (*VmResponse, error) StopVM(context.Context, *UUID) (*Response, error) ListVMs(context.Context, *empty.Empty) (*VmList, error) CreateDrive(context.Context, *ImageName) (*DriveResponse, error) ConnectVolume(context.Context, *Volume) (*ConnectResponse, error) }
NodeServer is the server API for Node service.
type NodeService ¶
type NodeService interface { ListVMs(ctx context.Context) ([]uuid.UUID, error) StartVM(ctx context.Context, vm model.VM) (*VmConfig, error) StopVM(ctx context.Context, vmID uuid.UUID) error CreateDrive(ctx context.Context, image string) (string, int64, error) ConnectVolume(ctx context.Context, volume *Volume) (string, error) }
NodeService exposes operations to perform on a host
func NewNodeService ¶
func NewNodeService(host *model.Host, connManager *rpc.GRPCConnection) NodeService
NewNodeService creates a Node instance TODO add logger
type Response ¶
type Response struct { Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=node.Status" json:"status,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Response) Descriptor ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) XXX_DiscardUnknown ¶
func (m *Response) XXX_DiscardUnknown()
func (*Response) XXX_Marshal ¶
func (*Response) XXX_Unmarshal ¶
type UUID ¶
type UUID struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UUID) Descriptor ¶
func (*UUID) ProtoMessage ¶
func (*UUID) ProtoMessage()
func (*UUID) XXX_DiscardUnknown ¶
func (m *UUID) XXX_DiscardUnknown()
func (*UUID) XXX_Unmarshal ¶
type UnimplementedNodeServer ¶
type UnimplementedNodeServer struct { }
UnimplementedNodeServer can be embedded to have forward compatible implementations.
func (*UnimplementedNodeServer) ConnectVolume ¶
func (*UnimplementedNodeServer) ConnectVolume(ctx context.Context, req *Volume) (*ConnectResponse, error)
func (*UnimplementedNodeServer) CreateDrive ¶
func (*UnimplementedNodeServer) CreateDrive(ctx context.Context, req *ImageName) (*DriveResponse, error)
func (*UnimplementedNodeServer) StartVM ¶
func (*UnimplementedNodeServer) StartVM(ctx context.Context, req *VmConfig) (*VmResponse, error)
type VmConfig ¶
type VmConfig struct { VmID *UUID `protobuf:"bytes,1,opt,name=vmID,proto3" json:"vmID,omitempty"` Memory int64 `protobuf:"varint,2,opt,name=memory,proto3" json:"memory,omitempty"` Vcpus int64 `protobuf:"varint,3,opt,name=vcpus,proto3" json:"vcpus,omitempty"` KernelImage string `protobuf:"bytes,4,opt,name=kernelImage,proto3" json:"kernelImage,omitempty"` RootFileSystem string `protobuf:"bytes,5,opt,name=rootFileSystem,proto3" json:"rootFileSystem,omitempty"` Address string `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*VmConfig) Descriptor ¶
func (*VmConfig) GetAddress ¶
func (*VmConfig) GetKernelImage ¶
func (*VmConfig) GetRootFileSystem ¶
func (*VmConfig) ProtoMessage ¶
func (*VmConfig) ProtoMessage()
func (*VmConfig) XXX_DiscardUnknown ¶
func (m *VmConfig) XXX_DiscardUnknown()
func (*VmConfig) XXX_Marshal ¶
func (*VmConfig) XXX_Unmarshal ¶
type VmList ¶
type VmList struct { VmID []*UUID `protobuf:"bytes,1,rep,name=vmID,proto3" json:"vmID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*VmList) Descriptor ¶
func (*VmList) ProtoMessage ¶
func (*VmList) ProtoMessage()
func (*VmList) XXX_DiscardUnknown ¶
func (m *VmList) XXX_DiscardUnknown()
func (*VmList) XXX_Marshal ¶
func (*VmList) XXX_Unmarshal ¶
type VmResponse ¶
type VmResponse struct { Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=node.Status" json:"status,omitempty"` Config *VmConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*VmResponse) Descriptor ¶
func (*VmResponse) Descriptor() ([]byte, []int)
func (*VmResponse) GetConfig ¶
func (m *VmResponse) GetConfig() *VmConfig
func (*VmResponse) GetStatus ¶
func (m *VmResponse) GetStatus() Status
func (*VmResponse) ProtoMessage ¶
func (*VmResponse) ProtoMessage()
func (*VmResponse) Reset ¶
func (m *VmResponse) Reset()
func (*VmResponse) String ¶
func (m *VmResponse) String() string
func (*VmResponse) XXX_DiscardUnknown ¶
func (m *VmResponse) XXX_DiscardUnknown()
func (*VmResponse) XXX_Marshal ¶
func (m *VmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*VmResponse) XXX_Merge ¶
func (m *VmResponse) XXX_Merge(src proto.Message)
func (*VmResponse) XXX_Size ¶
func (m *VmResponse) XXX_Size() int
func (*VmResponse) XXX_Unmarshal ¶
func (m *VmResponse) XXX_Unmarshal(b []byte) error
type Volume ¶
type Volume struct { VolumeID string `protobuf:"bytes,1,opt,name=volumeID,proto3" json:"volumeID,omitempty"` PoolName string `protobuf:"bytes,2,opt,name=poolName,proto3" json:"poolName,omitempty"` ImagePath string `protobuf:"bytes,3,opt,name=imagePath,proto3" json:"imagePath,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Volume) Descriptor ¶
func (*Volume) GetImagePath ¶
func (*Volume) GetPoolName ¶
func (*Volume) GetVolumeID ¶
func (*Volume) ProtoMessage ¶
func (*Volume) ProtoMessage()
func (*Volume) XXX_DiscardUnknown ¶
func (m *Volume) XXX_DiscardUnknown()
func (*Volume) XXX_Marshal ¶
func (*Volume) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.