mirror of https://github.com/usememos/memos
chore: add tag service proto definition (#2049)
* chore: add tag proto definition * chore: renamepull/2052/head
parent
9abf0eca1b
commit
d0cfb62f35
@ -1,12 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package memos.apiv2;
|
|
||||||
|
|
||||||
option go_package = "gen-go/apiv2";
|
|
||||||
|
|
||||||
// Person is a simple message type containing information about a person.
|
|
||||||
// It is an example of the kind of message that one might define in a protobufs file.
|
|
||||||
message Person {
|
|
||||||
string name = 1;
|
|
||||||
int32 id = 2;
|
|
||||||
}
|
|
@ -0,0 +1,22 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package memos.apiv2;
|
||||||
|
|
||||||
|
option go_package = "gen/apiv2";
|
||||||
|
|
||||||
|
service TagService {
|
||||||
|
rpc ListTags(ListTagsRequest) returns (ListTagsResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
message Tag {
|
||||||
|
string name = 1;
|
||||||
|
int32 creator_id = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ListTagsRequest {
|
||||||
|
int32 creator_id = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ListTagsResponse {
|
||||||
|
repeated Tag tags = 1;
|
||||||
|
}
|
@ -1,5 +1,18 @@
|
|||||||
version: v1
|
version: v1
|
||||||
|
managed:
|
||||||
|
enabled: true
|
||||||
|
go_package_prefix:
|
||||||
|
default: github.com/usememos/memos/proto/gen
|
||||||
plugins:
|
plugins:
|
||||||
- plugin: go
|
- plugin: buf.build/grpc/go:v1.3.0
|
||||||
out: gen-go
|
out: gen
|
||||||
opt: paths=source_relative
|
opt:
|
||||||
|
- paths=source_relative
|
||||||
|
- plugin: buf.build/bufbuild/connect-go:v1.10.0
|
||||||
|
out: gen
|
||||||
|
opt:
|
||||||
|
- paths=source_relative
|
||||||
|
- plugin: buf.build/protocolbuffers/go:v1.31.0
|
||||||
|
out: gen
|
||||||
|
opt:
|
||||||
|
- paths=source_relative
|
||||||
|
@ -1,153 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-go v1.29.0
|
|
||||||
// protoc (unknown)
|
|
||||||
// source: apiv2/example.proto
|
|
||||||
|
|
||||||
package apiv2
|
|
||||||
|
|
||||||
import (
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
reflect "reflect"
|
|
||||||
sync "sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
// Verify that this generated code is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
||||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
||||||
)
|
|
||||||
|
|
||||||
// Person is a simple message type containing information about a person.
|
|
||||||
// It is an example of the kind of message that one might define in a protobufs file.
|
|
||||||
type Person struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
|
||||||
Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Person) Reset() {
|
|
||||||
*x = Person{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_apiv2_example_proto_msgTypes[0]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Person) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*Person) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *Person) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_apiv2_example_proto_msgTypes[0]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use Person.ProtoReflect.Descriptor instead.
|
|
||||||
func (*Person) Descriptor() ([]byte, []int) {
|
|
||||||
return file_apiv2_example_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Person) GetName() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Name
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Person) GetId() int32 {
|
|
||||||
if x != nil {
|
|
||||||
return x.Id
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
var File_apiv2_example_proto protoreflect.FileDescriptor
|
|
||||||
|
|
||||||
var file_apiv2_example_proto_rawDesc = []byte{
|
|
||||||
0x0a, 0x13, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e,
|
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
|
|
||||||
0x76, 0x32, 0x22, 0x2c, 0x0a, 0x06, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04,
|
|
||||||
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
|
||||||
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64,
|
|
||||||
0x42, 0x0e, 0x5a, 0x0c, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x32,
|
|
||||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
file_apiv2_example_proto_rawDescOnce sync.Once
|
|
||||||
file_apiv2_example_proto_rawDescData = file_apiv2_example_proto_rawDesc
|
|
||||||
)
|
|
||||||
|
|
||||||
func file_apiv2_example_proto_rawDescGZIP() []byte {
|
|
||||||
file_apiv2_example_proto_rawDescOnce.Do(func() {
|
|
||||||
file_apiv2_example_proto_rawDescData = protoimpl.X.CompressGZIP(file_apiv2_example_proto_rawDescData)
|
|
||||||
})
|
|
||||||
return file_apiv2_example_proto_rawDescData
|
|
||||||
}
|
|
||||||
|
|
||||||
var file_apiv2_example_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
|
||||||
var file_apiv2_example_proto_goTypes = []interface{}{
|
|
||||||
(*Person)(nil), // 0: memos.apiv2.Person
|
|
||||||
}
|
|
||||||
var file_apiv2_example_proto_depIdxs = []int32{
|
|
||||||
0, // [0:0] is the sub-list for method output_type
|
|
||||||
0, // [0:0] is the sub-list for method input_type
|
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
|
||||||
0, // [0:0] is the sub-list for field type_name
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { file_apiv2_example_proto_init() }
|
|
||||||
func file_apiv2_example_proto_init() {
|
|
||||||
if File_apiv2_example_proto != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if !protoimpl.UnsafeEnabled {
|
|
||||||
file_apiv2_example_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*Person); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
type x struct{}
|
|
||||||
out := protoimpl.TypeBuilder{
|
|
||||||
File: protoimpl.DescBuilder{
|
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
||||||
RawDescriptor: file_apiv2_example_proto_rawDesc,
|
|
||||||
NumEnums: 0,
|
|
||||||
NumMessages: 1,
|
|
||||||
NumExtensions: 0,
|
|
||||||
NumServices: 0,
|
|
||||||
},
|
|
||||||
GoTypes: file_apiv2_example_proto_goTypes,
|
|
||||||
DependencyIndexes: file_apiv2_example_proto_depIdxs,
|
|
||||||
MessageInfos: file_apiv2_example_proto_msgTypes,
|
|
||||||
}.Build()
|
|
||||||
File_apiv2_example_proto = out.File
|
|
||||||
file_apiv2_example_proto_rawDesc = nil
|
|
||||||
file_apiv2_example_proto_goTypes = nil
|
|
||||||
file_apiv2_example_proto_depIdxs = nil
|
|
||||||
}
|
|
@ -0,0 +1,104 @@
|
|||||||
|
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
|
||||||
|
//
|
||||||
|
// Source: apiv2/tag_service.proto
|
||||||
|
|
||||||
|
package apiv2connect
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
errors "errors"
|
||||||
|
connect_go "github.com/bufbuild/connect-go"
|
||||||
|
apiv2 "github.com/usememos/memos/proto/gen/apiv2"
|
||||||
|
http "net/http"
|
||||||
|
strings "strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file and the connect package are
|
||||||
|
// compatible. If you get a compiler error that this constant is not defined, this code was
|
||||||
|
// generated with a version of connect newer than the one compiled into your binary. You can fix the
|
||||||
|
// problem by either regenerating this code with an older version of connect or updating the connect
|
||||||
|
// version compiled into your binary.
|
||||||
|
const _ = connect_go.IsAtLeastVersion0_1_0
|
||||||
|
|
||||||
|
const (
|
||||||
|
// TagServiceName is the fully-qualified name of the TagService service.
|
||||||
|
TagServiceName = "memos.apiv2.TagService"
|
||||||
|
)
|
||||||
|
|
||||||
|
// These constants are the fully-qualified names of the RPCs defined in this package. They're
|
||||||
|
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
|
||||||
|
//
|
||||||
|
// Note that these are different from the fully-qualified method names used by
|
||||||
|
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
|
||||||
|
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
|
||||||
|
// period.
|
||||||
|
const (
|
||||||
|
// TagServiceListTagsProcedure is the fully-qualified name of the TagService's ListTags RPC.
|
||||||
|
TagServiceListTagsProcedure = "/memos.apiv2.TagService/ListTags"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TagServiceClient is a client for the memos.apiv2.TagService service.
|
||||||
|
type TagServiceClient interface {
|
||||||
|
ListTags(context.Context, *connect_go.Request[apiv2.ListTagsRequest]) (*connect_go.Response[apiv2.ListTagsResponse], error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewTagServiceClient constructs a client for the memos.apiv2.TagService service. By default, it
|
||||||
|
// uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends
|
||||||
|
// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
|
||||||
|
// connect.WithGRPCWeb() options.
|
||||||
|
//
|
||||||
|
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
|
||||||
|
// http://api.acme.com or https://acme.com/grpc).
|
||||||
|
func NewTagServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) TagServiceClient {
|
||||||
|
baseURL = strings.TrimRight(baseURL, "/")
|
||||||
|
return &tagServiceClient{
|
||||||
|
listTags: connect_go.NewClient[apiv2.ListTagsRequest, apiv2.ListTagsResponse](
|
||||||
|
httpClient,
|
||||||
|
baseURL+TagServiceListTagsProcedure,
|
||||||
|
opts...,
|
||||||
|
),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tagServiceClient implements TagServiceClient.
|
||||||
|
type tagServiceClient struct {
|
||||||
|
listTags *connect_go.Client[apiv2.ListTagsRequest, apiv2.ListTagsResponse]
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListTags calls memos.apiv2.TagService.ListTags.
|
||||||
|
func (c *tagServiceClient) ListTags(ctx context.Context, req *connect_go.Request[apiv2.ListTagsRequest]) (*connect_go.Response[apiv2.ListTagsResponse], error) {
|
||||||
|
return c.listTags.CallUnary(ctx, req)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TagServiceHandler is an implementation of the memos.apiv2.TagService service.
|
||||||
|
type TagServiceHandler interface {
|
||||||
|
ListTags(context.Context, *connect_go.Request[apiv2.ListTagsRequest]) (*connect_go.Response[apiv2.ListTagsResponse], error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewTagServiceHandler builds an HTTP handler from the service implementation. It returns the path
|
||||||
|
// on which to mount the handler and the handler itself.
|
||||||
|
//
|
||||||
|
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
|
||||||
|
// and JSON codecs. They also support gzip compression.
|
||||||
|
func NewTagServiceHandler(svc TagServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
|
||||||
|
tagServiceListTagsHandler := connect_go.NewUnaryHandler(
|
||||||
|
TagServiceListTagsProcedure,
|
||||||
|
svc.ListTags,
|
||||||
|
opts...,
|
||||||
|
)
|
||||||
|
return "/memos.apiv2.TagService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
switch r.URL.Path {
|
||||||
|
case TagServiceListTagsProcedure:
|
||||||
|
tagServiceListTagsHandler.ServeHTTP(w, r)
|
||||||
|
default:
|
||||||
|
http.NotFound(w, r)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedTagServiceHandler returns CodeUnimplemented from all methods.
|
||||||
|
type UnimplementedTagServiceHandler struct{}
|
||||||
|
|
||||||
|
func (UnimplementedTagServiceHandler) ListTags(context.Context, *connect_go.Request[apiv2.ListTagsRequest]) (*connect_go.Response[apiv2.ListTagsResponse], error) {
|
||||||
|
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("memos.apiv2.TagService.ListTags is not implemented"))
|
||||||
|
}
|
@ -0,0 +1,296 @@
|
|||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.31.0
|
||||||
|
// protoc (unknown)
|
||||||
|
// source: apiv2/tag_service.proto
|
||||||
|
|
||||||
|
package apiv2
|
||||||
|
|
||||||
|
import (
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
type Tag struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
|
CreatorId int32 `protobuf:"varint,2,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Tag) Reset() {
|
||||||
|
*x = Tag{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_apiv2_tag_service_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Tag) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Tag) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Tag) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_apiv2_tag_service_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use Tag.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Tag) Descriptor() ([]byte, []int) {
|
||||||
|
return file_apiv2_tag_service_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Tag) GetName() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Name
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Tag) GetCreatorId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.CreatorId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListTagsRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
CreatorId int32 `protobuf:"varint,1,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListTagsRequest) Reset() {
|
||||||
|
*x = ListTagsRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_apiv2_tag_service_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListTagsRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListTagsRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListTagsRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_apiv2_tag_service_proto_msgTypes[1]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ListTagsRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListTagsRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_apiv2_tag_service_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListTagsRequest) GetCreatorId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.CreatorId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListTagsResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Tags []*Tag `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListTagsResponse) Reset() {
|
||||||
|
*x = ListTagsResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_apiv2_tag_service_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListTagsResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListTagsResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListTagsResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_apiv2_tag_service_proto_msgTypes[2]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ListTagsResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListTagsResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_apiv2_tag_service_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListTagsResponse) GetTags() []*Tag {
|
||||||
|
if x != nil {
|
||||||
|
return x.Tags
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_apiv2_tag_service_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_apiv2_tag_service_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x17, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x74, 0x61, 0x67, 0x5f, 0x73, 0x65, 0x72, 0x76,
|
||||||
|
0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x73,
|
||||||
|
0x2e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x22, 0x38, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x12, 0x12, 0x0a,
|
||||||
|
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
|
||||||
|
0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18,
|
||||||
|
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64,
|
||||||
|
0x22, 0x30, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||||
|
0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69,
|
||||||
|
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72,
|
||||||
|
0x49, 0x64, 0x22, 0x38, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65,
|
||||||
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x01,
|
||||||
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
|
||||||
|
0x76, 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x32, 0x55, 0x0a, 0x0a,
|
||||||
|
0x54, 0x61, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x47, 0x0a, 0x08, 0x4c, 0x69,
|
||||||
|
0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61,
|
||||||
|
0x70, 0x69, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71,
|
||||||
|
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
|
||||||
|
0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||||
|
0x6e, 0x73, 0x65, 0x42, 0x9a, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f,
|
||||||
|
0x73, 0x2e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x42, 0x0f, 0x54, 0x61, 0x67, 0x53, 0x65, 0x72, 0x76,
|
||||||
|
0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68,
|
||||||
|
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f,
|
||||||
|
0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f,
|
||||||
|
0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x65,
|
||||||
|
0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x76, 0x32, 0xca, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f,
|
||||||
|
0x73, 0x5c, 0x41, 0x70, 0x69, 0x76, 0x32, 0xe2, 0x02, 0x17, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c,
|
||||||
|
0x41, 0x70, 0x69, 0x76, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||||
|
0x61, 0xea, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x76, 0x32,
|
||||||
|
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_apiv2_tag_service_proto_rawDescOnce sync.Once
|
||||||
|
file_apiv2_tag_service_proto_rawDescData = file_apiv2_tag_service_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_apiv2_tag_service_proto_rawDescGZIP() []byte {
|
||||||
|
file_apiv2_tag_service_proto_rawDescOnce.Do(func() {
|
||||||
|
file_apiv2_tag_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_apiv2_tag_service_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_apiv2_tag_service_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_apiv2_tag_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||||
|
var file_apiv2_tag_service_proto_goTypes = []interface{}{
|
||||||
|
(*Tag)(nil), // 0: memos.apiv2.Tag
|
||||||
|
(*ListTagsRequest)(nil), // 1: memos.apiv2.ListTagsRequest
|
||||||
|
(*ListTagsResponse)(nil), // 2: memos.apiv2.ListTagsResponse
|
||||||
|
}
|
||||||
|
var file_apiv2_tag_service_proto_depIdxs = []int32{
|
||||||
|
0, // 0: memos.apiv2.ListTagsResponse.tags:type_name -> memos.apiv2.Tag
|
||||||
|
1, // 1: memos.apiv2.TagService.ListTags:input_type -> memos.apiv2.ListTagsRequest
|
||||||
|
2, // 2: memos.apiv2.TagService.ListTags:output_type -> memos.apiv2.ListTagsResponse
|
||||||
|
2, // [2:3] is the sub-list for method output_type
|
||||||
|
1, // [1:2] is the sub-list for method input_type
|
||||||
|
1, // [1:1] is the sub-list for extension type_name
|
||||||
|
1, // [1:1] is the sub-list for extension extendee
|
||||||
|
0, // [0:1] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_apiv2_tag_service_proto_init() }
|
||||||
|
func file_apiv2_tag_service_proto_init() {
|
||||||
|
if File_apiv2_tag_service_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_apiv2_tag_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Tag); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_apiv2_tag_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ListTagsRequest); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_apiv2_tag_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ListTagsResponse); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_apiv2_tag_service_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 3,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_apiv2_tag_service_proto_goTypes,
|
||||||
|
DependencyIndexes: file_apiv2_tag_service_proto_depIdxs,
|
||||||
|
MessageInfos: file_apiv2_tag_service_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_apiv2_tag_service_proto = out.File
|
||||||
|
file_apiv2_tag_service_proto_rawDesc = nil
|
||||||
|
file_apiv2_tag_service_proto_goTypes = nil
|
||||||
|
file_apiv2_tag_service_proto_depIdxs = nil
|
||||||
|
}
|
@ -0,0 +1,109 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
|
// - protoc (unknown)
|
||||||
|
// source: apiv2/tag_service.proto
|
||||||
|
|
||||||
|
package apiv2
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
TagService_ListTags_FullMethodName = "/memos.apiv2.TagService/ListTags"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TagServiceClient is the client API for TagService 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.
|
||||||
|
type TagServiceClient interface {
|
||||||
|
ListTags(ctx context.Context, in *ListTagsRequest, opts ...grpc.CallOption) (*ListTagsResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type tagServiceClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewTagServiceClient(cc grpc.ClientConnInterface) TagServiceClient {
|
||||||
|
return &tagServiceClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tagServiceClient) ListTags(ctx context.Context, in *ListTagsRequest, opts ...grpc.CallOption) (*ListTagsResponse, error) {
|
||||||
|
out := new(ListTagsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, TagService_ListTags_FullMethodName, in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// TagServiceServer is the server API for TagService service.
|
||||||
|
// All implementations must embed UnimplementedTagServiceServer
|
||||||
|
// for forward compatibility
|
||||||
|
type TagServiceServer interface {
|
||||||
|
ListTags(context.Context, *ListTagsRequest) (*ListTagsResponse, error)
|
||||||
|
mustEmbedUnimplementedTagServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedTagServiceServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedTagServiceServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedTagServiceServer) ListTags(context.Context, *ListTagsRequest) (*ListTagsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListTags not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTagServiceServer) mustEmbedUnimplementedTagServiceServer() {}
|
||||||
|
|
||||||
|
// UnsafeTagServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to TagServiceServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeTagServiceServer interface {
|
||||||
|
mustEmbedUnimplementedTagServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterTagServiceServer(s grpc.ServiceRegistrar, srv TagServiceServer) {
|
||||||
|
s.RegisterService(&TagService_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _TagService_ListTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListTagsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TagServiceServer).ListTags(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: TagService_ListTags_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TagServiceServer).ListTags(ctx, req.(*ListTagsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TagService_ServiceDesc is the grpc.ServiceDesc for TagService service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var TagService_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "memos.apiv2.TagService",
|
||||||
|
HandlerType: (*TagServiceServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "ListTags",
|
||||||
|
Handler: _TagService_ListTags_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "apiv2/tag_service.proto",
|
||||||
|
}
|
Loading…
Reference in New Issue