Documentation
¶
Index ¶
Constants ¶
const ( Rpc_CreateTag_FullMethodName = "/go11.devcloud_mini.cmdb.tag.Rpc/CreateTag" Rpc_QueryResource_FullMethodName = "/go11.devcloud_mini.cmdb.tag.Rpc/QueryResource" )
Variables ¶
var File_cmdb_apps_tag_pb_model_proto protoreflect.FileDescriptor
var File_cmdb_apps_tag_pb_rpc_proto protoreflect.FileDescriptor
var Rpc_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go11.devcloud_mini.cmdb.tag.Rpc", HandlerType: (*RpcServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateTag", Handler: _Rpc_CreateTag_Handler, }, { MethodName: "QueryResource", Handler: _Rpc_QueryResource_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cmdb/apps/tag/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 QueryTagRequest ¶
type QueryTagRequest struct {
// contains filtered or unexported fields
}
func (*QueryTagRequest) Descriptor
deprecated
func (*QueryTagRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryTagRequest.ProtoReflect.Descriptor instead.
func (*QueryTagRequest) ProtoMessage ¶
func (*QueryTagRequest) ProtoMessage()
func (*QueryTagRequest) ProtoReflect ¶
func (x *QueryTagRequest) ProtoReflect() protoreflect.Message
func (*QueryTagRequest) Reset ¶
func (x *QueryTagRequest) Reset()
func (*QueryTagRequest) String ¶
func (x *QueryTagRequest) String() string
type RpcClient ¶
type RpcClient interface {
// 创建标签
CreateTag(ctx context.Context, in *Spec, opts ...grpc.CallOption) (*Tag, error)
// 查询标签
QueryResource(ctx context.Context, in *QueryTagRequest, opts ...grpc.CallOption) (*TagSet, 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 {
// 创建标签
CreateTag(context.Context, *Spec) (*Tag, error)
// 查询标签
QueryResource(context.Context, *QueryTagRequest) (*TagSet, 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 {
// 资源Id
// @gotags: json:"resource_id" bson:"resource_id"
ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id" bson:"resource_id"`
// 标签key
// @gotags: json:"key" bson:"key"
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key" bson:"key"`
// 标签value
// @gotags: json:"value" bson:"value"
Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value" bson:"value"`
// contains filtered or unexported fields
}
func (*Spec) Descriptor
deprecated
func (*Spec) GetResourceId ¶
func (*Spec) ProtoMessage ¶
func (*Spec) ProtoMessage()
func (*Spec) ProtoReflect ¶
func (x *Spec) ProtoReflect() protoreflect.Message
type Tag ¶
type Tag struct {
// 元数据信息
// @gotags: json:"meta" bson:",inline"
Meta *resource.Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta" bson:",inline"`
// 标签的定义
// @gotags: json:"spec" bson:",inline"
Spec *Spec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec" bson:",inline"`
// contains filtered or unexported fields
}
资源快速检索
func (*Tag) Descriptor
deprecated
func (*Tag) ProtoMessage ¶
func (*Tag) ProtoMessage()
func (*Tag) ProtoReflect ¶
func (x *Tag) ProtoReflect() protoreflect.Message
type TagSet ¶
type TagSet struct {
// 总数
// @gotags: json:"total" bson:"total"
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"`
// 清单
// @gotags: json::"items" bson:"items"
Items []*Tag `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty" bson:"items"`
// contains filtered or unexported fields
}
func (*TagSet) Descriptor
deprecated
func (*TagSet) ProtoMessage ¶
func (*TagSet) ProtoMessage()
func (*TagSet) ProtoReflect ¶
func (x *TagSet) ProtoReflect() protoreflect.Message
type UnimplementedRpcServer ¶
type UnimplementedRpcServer struct {
}
UnimplementedRpcServer must be embedded to have forward compatible implementations.
func (UnimplementedRpcServer) QueryResource ¶
func (UnimplementedRpcServer) QueryResource(context.Context, *QueryTagRequest) (*TagSet, error)
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.