host

package
v0.0.0-...-055c0a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2022 License: MulanPSL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "host"
)

Variables

View Source
var File_apps_host_pb_host_proto protoreflect.FileDescriptor
View Source
var File_apps_host_pb_rpc_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Host.ProtoReflect.Descriptor instead.

func (*Host) GetResource

func (x *Host) GetResource() *resource.Resource

func (*Host) GetSpec

func (x *Host) GetSpec() *Spec

func (*Host) ProtoMessage

func (*Host) ProtoMessage()

func (*Host) ProtoReflect

func (x *Host) ProtoReflect() protoreflect.Message

func (*Host) Reset

func (x *Host) Reset()

func (*Host) String

func (x *Host) String() string

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 Service

type Service interface {
	RPCServer
}

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) Descriptor() ([]byte, []int)

Deprecated: Use Spec.ProtoReflect.Descriptor instead.

func (*Spec) GetGpuSpec

func (x *Spec) GetGpuSpec() string

func (*Spec) GetImageId

func (x *Spec) GetImageId() string

func (*Spec) GetInternetMaxBandwidthIn

func (x *Spec) GetInternetMaxBandwidthIn() int64

func (*Spec) GetInternetMaxBandwidthOut

func (x *Spec) GetInternetMaxBandwidthOut() int64

func (*Spec) GetOsName

func (x *Spec) GetOsName() string

func (*Spec) GetOsType

func (x *Spec) GetOsType() string

func (*Spec) ProtoMessage

func (*Spec) ProtoMessage()

func (*Spec) ProtoReflect

func (x *Spec) ProtoReflect() protoreflect.Message

func (*Spec) Reset

func (x *Spec) Reset()

func (*Spec) String

func (x *Spec) String() string

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL