tag

package
v0.0.0-...-5259590 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 9 Imported by: 0

README

资源标签

Documentation

Index

Constants

View Source
const (
	Rpc_CreateTag_FullMethodName     = "/go11.devcloud_mini.cmdb.tag.Rpc/CreateTag"
	Rpc_QueryResource_FullMethodName = "/go11.devcloud_mini.cmdb.tag.Rpc/QueryResource"
)

Variables

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

Deprecated: Use Spec.ProtoReflect.Descriptor instead.

func (*Spec) GetKey

func (x *Spec) GetKey() string

func (*Spec) GetResourceId

func (x *Spec) GetResourceId() string

func (*Spec) GetValue

func (x *Spec) GetValue() 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 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) Descriptor() ([]byte, []int)

Deprecated: Use Tag.ProtoReflect.Descriptor instead.

func (*Tag) GetMeta

func (x *Tag) GetMeta() *resource.Meta

func (*Tag) GetSpec

func (x *Tag) GetSpec() *Spec

func (*Tag) ProtoMessage

func (*Tag) ProtoMessage()

func (*Tag) ProtoReflect

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

func (*Tag) Reset

func (x *Tag) Reset()

func (*Tag) String

func (x *Tag) String() string

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

Deprecated: Use TagSet.ProtoReflect.Descriptor instead.

func (*TagSet) GetItems

func (x *TagSet) GetItems() []*Tag

func (*TagSet) GetTotal

func (x *TagSet) GetTotal() int64

func (*TagSet) ProtoMessage

func (*TagSet) ProtoMessage()

func (*TagSet) ProtoReflect

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

func (*TagSet) Reset

func (x *TagSet) Reset()

func (*TagSet) String

func (x *TagSet) String() string

type UnimplementedRpcServer

type UnimplementedRpcServer struct {
}

UnimplementedRpcServer must be embedded to have forward compatible implementations.

func (UnimplementedRpcServer) CreateTag

func (UnimplementedRpcServer) QueryResource

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.

Jump to

Keyboard shortcuts

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