Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
- type Host
- type RPCClient
- type RPCServer
- type Service
- type Spec
- func (*Spec) Descriptor() ([]byte, []int)deprecated
- func (x *Spec) GetGpuSpec() string
- func (x *Spec) GetImageId() string
- func (x *Spec) GetInternetMaxBandwidthIn() int64
- func (x *Spec) GetInternetMaxBandwidthOut() int64
- func (x *Spec) GetOsName() string
- func (x *Spec) GetOsType() string
- func (*Spec) ProtoMessage()
- func (x *Spec) ProtoReflect() protoreflect.Message
- func (x *Spec) Reset()
- func (x *Spec) String() string
- type UnimplementedRPCServer
- type UnsafeRPCServer
Constants ¶
const (
AppName = "host"
)
Variables ¶
var File_apps_host_pb_host_proto protoreflect.FileDescriptor
var File_apps_host_pb_rpc_proto protoreflect.FileDescriptor
var RPC_ServiceDesc = grpc.ServiceDesc{ ServiceName: "devcloud.cmdb.host.RPC", HandlerType: (*RPCServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateHost", Handler: _RPC_CreateHost_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/host/pb/rpc.proto", }
RPC_ServiceDesc is the grpc.ServiceDesc for RPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRPCServer ¶
func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
Types ¶
type Host ¶
type Host struct {
// 通用定义
// @gotags: json:"resource"
Resource *resource.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
// 通用定义
// @gotags: json:"spec"
Spec *Spec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"`
// contains filtered or unexported fields
}
func (*Host) Descriptor
deprecated
func (*Host) GetResource ¶
func (*Host) ProtoMessage ¶
func (*Host) ProtoMessage()
func (*Host) ProtoReflect ¶
func (x *Host) ProtoReflect() protoreflect.Message
type RPCClient ¶
type RPCClient interface {
CreateHost(ctx context.Context, in *Host, opts ...grpc.CallOption) (*Host, error)
}
RPCClient is the client API for RPC service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewRPCClient ¶
func NewRPCClient(cc grpc.ClientConnInterface) RPCClient
type RPCServer ¶
type RPCServer interface {
CreateHost(context.Context, *Host) (*Host, error)
// contains filtered or unexported methods
}
RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility
type Spec ¶
type Spec struct {
// GPU类型
// @gotags: json:"gpu_spec"
GpuSpec string `protobuf:"bytes,2,opt,name=gpu_spec,json=gpuSpec,proto3" json:"gpu_spec,omitempty"`
// 操作系统类型,分为Windows和Linux
// @gotags: json:"os_type"
OsType string `protobuf:"bytes,3,opt,name=os_type,json=osType,proto3" json:"os_type,omitempty"`
// 操作系统名称
// @gotags: json:"os_name"
OsName string `protobuf:"bytes,4,opt,name=os_name,json=osName,proto3" json:"os_name,omitempty"`
// 镜像ID
// @gotags: json:"image_id"
ImageId string `protobuf:"bytes,5,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"`
// 公网出带宽最大值,单位为 Mbps
// @gotags: json:"internet_max_bandwidth_out"
InternetMaxBandwidthOut int64 `` /* 135-byte string literal not displayed */
// 公网入带宽最大值,单位为 Mbps
// @gotags: json:"internet_max_bandwidth_in"
InternetMaxBandwidthIn int64 `` /* 132-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*Spec) Descriptor
deprecated
func (*Spec) GetGpuSpec ¶
func (*Spec) GetImageId ¶
func (*Spec) GetInternetMaxBandwidthIn ¶
func (*Spec) GetInternetMaxBandwidthOut ¶
func (*Spec) ProtoMessage ¶
func (*Spec) ProtoMessage()
func (*Spec) ProtoReflect ¶
func (x *Spec) ProtoReflect() protoreflect.Message
type UnimplementedRPCServer ¶
type UnimplementedRPCServer struct {
}
UnimplementedRPCServer must be embedded to have forward compatible implementations.
func (UnimplementedRPCServer) CreateHost ¶
type UnsafeRPCServer ¶
type UnsafeRPCServer interface {
// contains filtered or unexported methods
}
UnsafeRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RPCServer will result in compilation errors.