Documentation ¶
Overview ¶
Package topic is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterTopicServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTopicServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TopicServiceClient) error
- func RegisterTopicServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTopicServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TopicServiceServer) error
- func RegisterTopicServiceServer(s grpc.ServiceRegistrar, srv TopicServiceServer)
- type CreateTopicRequest
- func (*CreateTopicRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateTopicRequest) GetCollectionId() string
- func (x *CreateTopicRequest) GetDescription() string
- func (x *CreateTopicRequest) GetKnowledgeBaseId() string
- func (x *CreateTopicRequest) GetOwnerId() string
- func (x *CreateTopicRequest) GetTopic() string
- func (*CreateTopicRequest) ProtoMessage()
- func (x *CreateTopicRequest) ProtoReflect() protoreflect.Message
- func (x *CreateTopicRequest) Reset()
- func (x *CreateTopicRequest) String() string
- type CreateTopicResponse
- func (*CreateTopicResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateTopicResponse) GetTopic() *common.Topic
- func (*CreateTopicResponse) ProtoMessage()
- func (x *CreateTopicResponse) ProtoReflect() protoreflect.Message
- func (x *CreateTopicResponse) Reset()
- func (x *CreateTopicResponse) String() string
- type DeleteTopicByIdRequest
- func (*DeleteTopicByIdRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteTopicByIdRequest) GetCollectionId() string
- func (x *DeleteTopicByIdRequest) GetKnowledgeBaseId() string
- func (x *DeleteTopicByIdRequest) GetTopicId() string
- func (*DeleteTopicByIdRequest) ProtoMessage()
- func (x *DeleteTopicByIdRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteTopicByIdRequest) Reset()
- func (x *DeleteTopicByIdRequest) String() string
- type DeleteTopicByIdResponse
- type GetByCollectionRequest
- func (*GetByCollectionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetByCollectionRequest) GetCollectionId() string
- func (x *GetByCollectionRequest) GetKnowledgeBaseId() string
- func (*GetByCollectionRequest) ProtoMessage()
- func (x *GetByCollectionRequest) ProtoReflect() protoreflect.Message
- func (x *GetByCollectionRequest) Reset()
- func (x *GetByCollectionRequest) String() string
- type GetByCollectionResponse
- func (*GetByCollectionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetByCollectionResponse) GetTopics() []*common.Topic
- func (*GetByCollectionResponse) ProtoMessage()
- func (x *GetByCollectionResponse) ProtoReflect() protoreflect.Message
- func (x *GetByCollectionResponse) Reset()
- func (x *GetByCollectionResponse) String() string
- type GetTopicByIdRequest
- func (*GetTopicByIdRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetTopicByIdRequest) GetCollectionId() string
- func (x *GetTopicByIdRequest) GetKnowledgeBaseId() string
- func (x *GetTopicByIdRequest) GetTopicId() string
- func (*GetTopicByIdRequest) ProtoMessage()
- func (x *GetTopicByIdRequest) ProtoReflect() protoreflect.Message
- func (x *GetTopicByIdRequest) Reset()
- func (x *GetTopicByIdRequest) String() string
- type GetTopicByIdResponse
- func (*GetTopicByIdResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetTopicByIdResponse) GetTopic() *common.Topic
- func (*GetTopicByIdResponse) ProtoMessage()
- func (x *GetTopicByIdResponse) ProtoReflect() protoreflect.Message
- func (x *GetTopicByIdResponse) Reset()
- func (x *GetTopicByIdResponse) String() string
- type TopicServiceClient
- type TopicServiceServer
- type UnimplementedTopicServiceServer
- func (UnimplementedTopicServiceServer) CreateTopic(context.Context, *CreateTopicRequest) (*CreateTopicResponse, error)
- func (UnimplementedTopicServiceServer) DeleteTopicById(context.Context, *DeleteTopicByIdRequest) (*DeleteTopicByIdResponse, error)
- func (UnimplementedTopicServiceServer) GetByCollection(context.Context, *GetByCollectionRequest) (*GetByCollectionResponse, error)
- func (UnimplementedTopicServiceServer) GetTopicById(context.Context, *GetTopicByIdRequest) (*GetTopicByIdResponse, error)
- type UnsafeTopicServiceServer
Constants ¶
const ( TopicService_CreateTopic_FullMethodName = "/knowdateapp.knowledge.v1.topic.TopicService/CreateTopic" TopicService_GetByCollection_FullMethodName = "/knowdateapp.knowledge.v1.topic.TopicService/GetByCollection" TopicService_GetTopicById_FullMethodName = "/knowdateapp.knowledge.v1.topic.TopicService/GetTopicById" TopicService_DeleteTopicById_FullMethodName = "/knowdateapp.knowledge.v1.topic.TopicService/DeleteTopicById" )
Variables ¶
var File_api_v1_topic_topic_proto protoreflect.FileDescriptor
var TopicService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "knowdateapp.knowledge.v1.topic.TopicService", HandlerType: (*TopicServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateTopic", Handler: _TopicService_CreateTopic_Handler, }, { MethodName: "GetByCollection", Handler: _TopicService_GetByCollection_Handler, }, { MethodName: "GetTopicById", Handler: _TopicService_GetTopicById_Handler, }, { MethodName: "DeleteTopicById", Handler: _TopicService_DeleteTopicById_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/v1/topic/topic.proto", }
TopicService_ServiceDesc is the grpc.ServiceDesc for TopicService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTopicServiceHandler ¶
func RegisterTopicServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTopicServiceHandler registers the http handlers for service TopicService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTopicServiceHandlerClient ¶
func RegisterTopicServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TopicServiceClient) error
RegisterTopicServiceHandlerClient registers the http handlers for service TopicService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TopicServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TopicServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TopicServiceClient" to call the correct interceptors.
func RegisterTopicServiceHandlerFromEndpoint ¶
func RegisterTopicServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTopicServiceHandlerFromEndpoint is same as RegisterTopicServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTopicServiceHandlerServer ¶
func RegisterTopicServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TopicServiceServer) error
RegisterTopicServiceHandlerServer registers the http handlers for service TopicService to "mux". UnaryRPC :call TopicServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTopicServiceHandlerFromEndpoint instead.
func RegisterTopicServiceServer ¶
func RegisterTopicServiceServer(s grpc.ServiceRegistrar, srv TopicServiceServer)
Types ¶
type CreateTopicRequest ¶
type CreateTopicRequest struct { KnowledgeBaseId string `protobuf:"bytes,1,opt,name=knowledge_base_id,json=knowledgeBaseId,proto3" json:"knowledge_base_id,omitempty"` CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` OwnerId string `protobuf:"bytes,3,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` Topic string `protobuf:"bytes,4,opt,name=topic,proto3" json:"topic,omitempty"` Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
func (*CreateTopicRequest) Descriptor
deprecated
func (*CreateTopicRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateTopicRequest.ProtoReflect.Descriptor instead.
func (*CreateTopicRequest) GetCollectionId ¶
func (x *CreateTopicRequest) GetCollectionId() string
func (*CreateTopicRequest) GetDescription ¶
func (x *CreateTopicRequest) GetDescription() string
func (*CreateTopicRequest) GetKnowledgeBaseId ¶
func (x *CreateTopicRequest) GetKnowledgeBaseId() string
func (*CreateTopicRequest) GetOwnerId ¶
func (x *CreateTopicRequest) GetOwnerId() string
func (*CreateTopicRequest) GetTopic ¶
func (x *CreateTopicRequest) GetTopic() string
func (*CreateTopicRequest) ProtoMessage ¶
func (*CreateTopicRequest) ProtoMessage()
func (*CreateTopicRequest) ProtoReflect ¶
func (x *CreateTopicRequest) ProtoReflect() protoreflect.Message
func (*CreateTopicRequest) Reset ¶
func (x *CreateTopicRequest) Reset()
func (*CreateTopicRequest) String ¶
func (x *CreateTopicRequest) String() string
type CreateTopicResponse ¶
type CreateTopicResponse struct { Topic *common.Topic `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` // contains filtered or unexported fields }
func (*CreateTopicResponse) Descriptor
deprecated
func (*CreateTopicResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateTopicResponse.ProtoReflect.Descriptor instead.
func (*CreateTopicResponse) GetTopic ¶
func (x *CreateTopicResponse) GetTopic() *common.Topic
func (*CreateTopicResponse) ProtoMessage ¶
func (*CreateTopicResponse) ProtoMessage()
func (*CreateTopicResponse) ProtoReflect ¶
func (x *CreateTopicResponse) ProtoReflect() protoreflect.Message
func (*CreateTopicResponse) Reset ¶
func (x *CreateTopicResponse) Reset()
func (*CreateTopicResponse) String ¶
func (x *CreateTopicResponse) String() string
type DeleteTopicByIdRequest ¶
type DeleteTopicByIdRequest struct { KnowledgeBaseId string `protobuf:"bytes,1,opt,name=knowledge_base_id,json=knowledgeBaseId,proto3" json:"knowledge_base_id,omitempty"` CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` TopicId string `protobuf:"bytes,3,opt,name=topic_id,json=topicId,proto3" json:"topic_id,omitempty"` // contains filtered or unexported fields }
func (*DeleteTopicByIdRequest) Descriptor
deprecated
func (*DeleteTopicByIdRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteTopicByIdRequest.ProtoReflect.Descriptor instead.
func (*DeleteTopicByIdRequest) GetCollectionId ¶
func (x *DeleteTopicByIdRequest) GetCollectionId() string
func (*DeleteTopicByIdRequest) GetKnowledgeBaseId ¶
func (x *DeleteTopicByIdRequest) GetKnowledgeBaseId() string
func (*DeleteTopicByIdRequest) GetTopicId ¶
func (x *DeleteTopicByIdRequest) GetTopicId() string
func (*DeleteTopicByIdRequest) ProtoMessage ¶
func (*DeleteTopicByIdRequest) ProtoMessage()
func (*DeleteTopicByIdRequest) ProtoReflect ¶
func (x *DeleteTopicByIdRequest) ProtoReflect() protoreflect.Message
func (*DeleteTopicByIdRequest) Reset ¶
func (x *DeleteTopicByIdRequest) Reset()
func (*DeleteTopicByIdRequest) String ¶
func (x *DeleteTopicByIdRequest) String() string
type DeleteTopicByIdResponse ¶
type DeleteTopicByIdResponse struct {
// contains filtered or unexported fields
}
func (*DeleteTopicByIdResponse) Descriptor
deprecated
func (*DeleteTopicByIdResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteTopicByIdResponse.ProtoReflect.Descriptor instead.
func (*DeleteTopicByIdResponse) ProtoMessage ¶
func (*DeleteTopicByIdResponse) ProtoMessage()
func (*DeleteTopicByIdResponse) ProtoReflect ¶
func (x *DeleteTopicByIdResponse) ProtoReflect() protoreflect.Message
func (*DeleteTopicByIdResponse) Reset ¶
func (x *DeleteTopicByIdResponse) Reset()
func (*DeleteTopicByIdResponse) String ¶
func (x *DeleteTopicByIdResponse) String() string
type GetByCollectionRequest ¶
type GetByCollectionRequest struct { KnowledgeBaseId string `protobuf:"bytes,1,opt,name=knowledge_base_id,json=knowledgeBaseId,proto3" json:"knowledge_base_id,omitempty"` CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` // contains filtered or unexported fields }
func (*GetByCollectionRequest) Descriptor
deprecated
func (*GetByCollectionRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetByCollectionRequest.ProtoReflect.Descriptor instead.
func (*GetByCollectionRequest) GetCollectionId ¶
func (x *GetByCollectionRequest) GetCollectionId() string
func (*GetByCollectionRequest) GetKnowledgeBaseId ¶
func (x *GetByCollectionRequest) GetKnowledgeBaseId() string
func (*GetByCollectionRequest) ProtoMessage ¶
func (*GetByCollectionRequest) ProtoMessage()
func (*GetByCollectionRequest) ProtoReflect ¶
func (x *GetByCollectionRequest) ProtoReflect() protoreflect.Message
func (*GetByCollectionRequest) Reset ¶
func (x *GetByCollectionRequest) Reset()
func (*GetByCollectionRequest) String ¶
func (x *GetByCollectionRequest) String() string
type GetByCollectionResponse ¶
type GetByCollectionResponse struct { Topics []*common.Topic `protobuf:"bytes,1,rep,name=topics,proto3" json:"topics,omitempty"` // contains filtered or unexported fields }
func (*GetByCollectionResponse) Descriptor
deprecated
func (*GetByCollectionResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetByCollectionResponse.ProtoReflect.Descriptor instead.
func (*GetByCollectionResponse) GetTopics ¶
func (x *GetByCollectionResponse) GetTopics() []*common.Topic
func (*GetByCollectionResponse) ProtoMessage ¶
func (*GetByCollectionResponse) ProtoMessage()
func (*GetByCollectionResponse) ProtoReflect ¶
func (x *GetByCollectionResponse) ProtoReflect() protoreflect.Message
func (*GetByCollectionResponse) Reset ¶
func (x *GetByCollectionResponse) Reset()
func (*GetByCollectionResponse) String ¶
func (x *GetByCollectionResponse) String() string
type GetTopicByIdRequest ¶
type GetTopicByIdRequest struct { KnowledgeBaseId string `protobuf:"bytes,1,opt,name=knowledge_base_id,json=knowledgeBaseId,proto3" json:"knowledge_base_id,omitempty"` CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"` TopicId string `protobuf:"bytes,3,opt,name=topic_id,json=topicId,proto3" json:"topic_id,omitempty"` // contains filtered or unexported fields }
func (*GetTopicByIdRequest) Descriptor
deprecated
func (*GetTopicByIdRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetTopicByIdRequest.ProtoReflect.Descriptor instead.
func (*GetTopicByIdRequest) GetCollectionId ¶
func (x *GetTopicByIdRequest) GetCollectionId() string
func (*GetTopicByIdRequest) GetKnowledgeBaseId ¶
func (x *GetTopicByIdRequest) GetKnowledgeBaseId() string
func (*GetTopicByIdRequest) GetTopicId ¶
func (x *GetTopicByIdRequest) GetTopicId() string
func (*GetTopicByIdRequest) ProtoMessage ¶
func (*GetTopicByIdRequest) ProtoMessage()
func (*GetTopicByIdRequest) ProtoReflect ¶
func (x *GetTopicByIdRequest) ProtoReflect() protoreflect.Message
func (*GetTopicByIdRequest) Reset ¶
func (x *GetTopicByIdRequest) Reset()
func (*GetTopicByIdRequest) String ¶
func (x *GetTopicByIdRequest) String() string
type GetTopicByIdResponse ¶
type GetTopicByIdResponse struct { Topic *common.Topic `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` // contains filtered or unexported fields }
func (*GetTopicByIdResponse) Descriptor
deprecated
func (*GetTopicByIdResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetTopicByIdResponse.ProtoReflect.Descriptor instead.
func (*GetTopicByIdResponse) GetTopic ¶
func (x *GetTopicByIdResponse) GetTopic() *common.Topic
func (*GetTopicByIdResponse) ProtoMessage ¶
func (*GetTopicByIdResponse) ProtoMessage()
func (*GetTopicByIdResponse) ProtoReflect ¶
func (x *GetTopicByIdResponse) ProtoReflect() protoreflect.Message
func (*GetTopicByIdResponse) Reset ¶
func (x *GetTopicByIdResponse) Reset()
func (*GetTopicByIdResponse) String ¶
func (x *GetTopicByIdResponse) String() string
type TopicServiceClient ¶
type TopicServiceClient interface { CreateTopic(ctx context.Context, in *CreateTopicRequest, opts ...grpc.CallOption) (*CreateTopicResponse, error) GetByCollection(ctx context.Context, in *GetByCollectionRequest, opts ...grpc.CallOption) (*GetByCollectionResponse, error) GetTopicById(ctx context.Context, in *GetTopicByIdRequest, opts ...grpc.CallOption) (*GetTopicByIdResponse, error) DeleteTopicById(ctx context.Context, in *DeleteTopicByIdRequest, opts ...grpc.CallOption) (*DeleteTopicByIdResponse, error) }
TopicServiceClient is the client API for TopicService 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 NewTopicServiceClient ¶
func NewTopicServiceClient(cc grpc.ClientConnInterface) TopicServiceClient
type TopicServiceServer ¶
type TopicServiceServer interface { CreateTopic(context.Context, *CreateTopicRequest) (*CreateTopicResponse, error) GetByCollection(context.Context, *GetByCollectionRequest) (*GetByCollectionResponse, error) GetTopicById(context.Context, *GetTopicByIdRequest) (*GetTopicByIdResponse, error) DeleteTopicById(context.Context, *DeleteTopicByIdRequest) (*DeleteTopicByIdResponse, error) // contains filtered or unexported methods }
TopicServiceServer is the server API for TopicService service. All implementations must embed UnimplementedTopicServiceServer for forward compatibility
type UnimplementedTopicServiceServer ¶
type UnimplementedTopicServiceServer struct { }
UnimplementedTopicServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedTopicServiceServer) CreateTopic ¶
func (UnimplementedTopicServiceServer) CreateTopic(context.Context, *CreateTopicRequest) (*CreateTopicResponse, error)
func (UnimplementedTopicServiceServer) DeleteTopicById ¶
func (UnimplementedTopicServiceServer) DeleteTopicById(context.Context, *DeleteTopicByIdRequest) (*DeleteTopicByIdResponse, error)
func (UnimplementedTopicServiceServer) GetByCollection ¶
func (UnimplementedTopicServiceServer) GetByCollection(context.Context, *GetByCollectionRequest) (*GetByCollectionResponse, error)
func (UnimplementedTopicServiceServer) GetTopicById ¶
func (UnimplementedTopicServiceServer) GetTopicById(context.Context, *GetTopicByIdRequest) (*GetTopicByIdResponse, error)
type UnsafeTopicServiceServer ¶
type UnsafeTopicServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTopicServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TopicServiceServer will result in compilation errors.