Documentation ¶
Overview ¶
Package todopb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterToDoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterToDoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ToDoServiceClient) error
- func RegisterToDoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterToDoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ToDoServiceServer) error
- func RegisterToDoServiceServer(s grpc.ServiceRegistrar, srv ToDoServiceServer)
- type CreateRequest
- func (*CreateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRequest) GetApi() string
- func (x *CreateRequest) GetItem() *ToDo
- func (*CreateRequest) ProtoMessage()
- func (x *CreateRequest) ProtoReflect() protoreflect.Message
- func (x *CreateRequest) Reset()
- func (x *CreateRequest) String() string
- type CreateResponse
- func (*CreateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateResponse) GetApi() string
- func (x *CreateResponse) GetId() string
- func (*CreateResponse) ProtoMessage()
- func (x *CreateResponse) ProtoReflect() protoreflect.Message
- func (x *CreateResponse) Reset()
- func (x *CreateResponse) String() string
- type DeleteRequest
- func (*DeleteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteRequest) GetApi() string
- func (x *DeleteRequest) GetId() string
- func (*DeleteRequest) ProtoMessage()
- func (x *DeleteRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteRequest) Reset()
- func (x *DeleteRequest) String() string
- type DeleteResponse
- func (*DeleteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteResponse) GetApi() string
- func (x *DeleteResponse) GetDeleted() int64
- func (*DeleteResponse) ProtoMessage()
- func (x *DeleteResponse) ProtoReflect() protoreflect.Message
- func (x *DeleteResponse) Reset()
- func (x *DeleteResponse) String() string
- type GetRequest
- type GetResponse
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRequest) GetApi() string
- func (x *ListRequest) GetCompleted() bool
- func (x *ListRequest) GetLimit() int32
- func (*ListRequest) ProtoMessage()
- func (x *ListRequest) ProtoReflect() protoreflect.Message
- func (x *ListRequest) Reset()
- func (x *ListRequest) String() string
- type ListResponse
- func (*ListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListResponse) GetApi() string
- func (x *ListResponse) GetItems() []*ToDo
- func (*ListResponse) ProtoMessage()
- func (x *ListResponse) ProtoReflect() protoreflect.Message
- func (x *ListResponse) Reset()
- func (x *ListResponse) String() string
- type ToDo
- func (*ToDo) Descriptor() ([]byte, []int)deprecated
- func (x *ToDo) GetCompleted() bool
- func (x *ToDo) GetCreatedAt() *timestamppb.Timestamp
- func (x *ToDo) GetDescription() string
- func (x *ToDo) GetId() string
- func (x *ToDo) GetTitle() string
- func (x *ToDo) GetUpdatedAt() *timestamppb.Timestamp
- func (*ToDo) ProtoMessage()
- func (x *ToDo) ProtoReflect() protoreflect.Message
- func (x *ToDo) Reset()
- func (x *ToDo) String() string
- type ToDoServiceClient
- type ToDoServiceServer
- type UnimplementedToDoServiceServer
- func (UnimplementedToDoServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error)
- func (UnimplementedToDoServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
- func (UnimplementedToDoServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error)
- func (UnimplementedToDoServiceServer) List(context.Context, *ListRequest) (*ListResponse, error)
- func (UnimplementedToDoServiceServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
- type UnsafeToDoServiceServer
- type UpdateRequest
- func (*UpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateRequest) GetApi() string
- func (x *UpdateRequest) GetItem() *ToDo
- func (*UpdateRequest) ProtoMessage()
- func (x *UpdateRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateRequest) Reset()
- func (x *UpdateRequest) String() string
- type UpdateResponse
- func (*UpdateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateResponse) GetApi() string
- func (x *UpdateResponse) GetUpdated() int64
- func (*UpdateResponse) ProtoMessage()
- func (x *UpdateResponse) ProtoReflect() protoreflect.Message
- func (x *UpdateResponse) Reset()
- func (x *UpdateResponse) String() string
Constants ¶
const ( ToDoService_Create_FullMethodName = "/qclaogui.todo.v1.ToDoService/Create" ToDoService_Get_FullMethodName = "/qclaogui.todo.v1.ToDoService/Get" ToDoService_Update_FullMethodName = "/qclaogui.todo.v1.ToDoService/Update" ToDoService_List_FullMethodName = "/qclaogui.todo.v1.ToDoService/List" ToDoService_Delete_FullMethodName = "/qclaogui.todo.v1.ToDoService/Delete" )
Variables ¶
var File_qclaogui_todo_v1_todo_service_proto protoreflect.FileDescriptor
var ToDoService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "qclaogui.todo.v1.ToDoService", HandlerType: (*ToDoServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Create", Handler: _ToDoService_Create_Handler, }, { MethodName: "Get", Handler: _ToDoService_Get_Handler, }, { MethodName: "Update", Handler: _ToDoService_Update_Handler, }, { MethodName: "List", Handler: _ToDoService_List_Handler, }, { MethodName: "Delete", Handler: _ToDoService_Delete_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "qclaogui/todo/v1/todo_service.proto", }
ToDoService_ServiceDesc is the grpc.ServiceDesc for ToDoService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterToDoServiceHandler ¶
func RegisterToDoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterToDoServiceHandler registers the http handlers for service ToDoService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterToDoServiceHandlerClient ¶
func RegisterToDoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ToDoServiceClient) error
RegisterToDoServiceHandlerClient registers the http handlers for service ToDoService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ToDoServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ToDoServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ToDoServiceClient" to call the correct interceptors.
func RegisterToDoServiceHandlerFromEndpoint ¶
func RegisterToDoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterToDoServiceHandlerFromEndpoint is same as RegisterToDoServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterToDoServiceHandlerServer ¶
func RegisterToDoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ToDoServiceServer) error
RegisterToDoServiceHandlerServer registers the http handlers for service ToDoService to "mux". UnaryRPC :call ToDoServiceServer 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 RegisterToDoServiceHandlerFromEndpoint instead.
func RegisterToDoServiceServer ¶
func RegisterToDoServiceServer(s grpc.ServiceRegistrar, srv ToDoServiceServer)
Types ¶
type CreateRequest ¶
type CreateRequest struct { // API version Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` Item *ToDo `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` // contains filtered or unexported fields }
func (*CreateRequest) Descriptor
deprecated
func (*CreateRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.
func (*CreateRequest) GetApi ¶
func (x *CreateRequest) GetApi() string
func (*CreateRequest) GetItem ¶
func (x *CreateRequest) GetItem() *ToDo
func (*CreateRequest) ProtoMessage ¶
func (*CreateRequest) ProtoMessage()
func (*CreateRequest) ProtoReflect ¶
func (x *CreateRequest) ProtoReflect() protoreflect.Message
func (*CreateRequest) Reset ¶
func (x *CreateRequest) Reset()
func (*CreateRequest) String ¶
func (x *CreateRequest) String() string
type CreateResponse ¶
type CreateResponse struct { // API version Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreateResponse) Descriptor
deprecated
func (*CreateResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.
func (*CreateResponse) GetApi ¶
func (x *CreateResponse) GetApi() string
func (*CreateResponse) GetId ¶
func (x *CreateResponse) GetId() string
func (*CreateResponse) ProtoMessage ¶
func (*CreateResponse) ProtoMessage()
func (*CreateResponse) ProtoReflect ¶
func (x *CreateResponse) ProtoReflect() protoreflect.Message
func (*CreateResponse) Reset ¶
func (x *CreateResponse) Reset()
func (*CreateResponse) String ¶
func (x *CreateResponse) String() string
type DeleteRequest ¶
type DeleteRequest struct { // API version Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*DeleteRequest) Descriptor
deprecated
func (*DeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
func (*DeleteRequest) GetApi ¶
func (x *DeleteRequest) GetApi() string
func (*DeleteRequest) GetId ¶
func (x *DeleteRequest) GetId() string
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) ProtoReflect ¶
func (x *DeleteRequest) ProtoReflect() protoreflect.Message
func (*DeleteRequest) Reset ¶
func (x *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (x *DeleteRequest) String() string
type DeleteResponse ¶
type DeleteResponse struct { // API version Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` Deleted int64 `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` // contains filtered or unexported fields }
func (*DeleteResponse) Descriptor
deprecated
func (*DeleteResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.
func (*DeleteResponse) GetApi ¶
func (x *DeleteResponse) GetApi() string
func (*DeleteResponse) GetDeleted ¶
func (x *DeleteResponse) GetDeleted() int64
func (*DeleteResponse) ProtoMessage ¶
func (*DeleteResponse) ProtoMessage()
func (*DeleteResponse) ProtoReflect ¶
func (x *DeleteResponse) ProtoReflect() protoreflect.Message
func (*DeleteResponse) Reset ¶
func (x *DeleteResponse) Reset()
func (*DeleteResponse) String ¶
func (x *DeleteResponse) String() string
type GetRequest ¶
type GetRequest struct { // API version Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetApi ¶
func (x *GetRequest) GetApi() string
func (*GetRequest) GetId ¶
func (x *GetRequest) GetId() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type GetResponse ¶
type GetResponse struct { // API version Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` Item *ToDo `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` // contains filtered or unexported fields }
func (*GetResponse) Descriptor
deprecated
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetApi ¶
func (x *GetResponse) GetApi() string
func (*GetResponse) GetItem ¶
func (x *GetResponse) GetItem() *ToDo
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) ProtoReflect ¶
func (x *GetResponse) ProtoReflect() protoreflect.Message
func (*GetResponse) Reset ¶
func (x *GetResponse) Reset()
func (*GetResponse) String ¶
func (x *GetResponse) String() string
type ListRequest ¶
type ListRequest struct { // API version Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` Completed bool `protobuf:"varint,3,opt,name=completed,proto3" json:"completed,omitempty"` // contains filtered or unexported fields }
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetApi ¶
func (x *ListRequest) GetApi() string
func (*ListRequest) GetCompleted ¶
func (x *ListRequest) GetCompleted() bool
func (*ListRequest) GetLimit ¶
func (x *ListRequest) GetLimit() int32
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type ListResponse ¶
type ListResponse struct { // API version Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` // List of all Items []*ToDo `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*ListResponse) Descriptor
deprecated
func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetApi ¶
func (x *ListResponse) GetApi() string
func (*ListResponse) GetItems ¶
func (x *ListResponse) GetItems() []*ToDo
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
type ToDo ¶
type ToDo struct { // Unique integer identifier of the todo task Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` Completed bool `protobuf:"varint,4,opt,name=completed,proto3" json:"completed,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
Tasks wo have to do
func (*ToDo) Descriptor
deprecated
func (*ToDo) GetCompleted ¶
func (*ToDo) GetCreatedAt ¶
func (x *ToDo) GetCreatedAt() *timestamppb.Timestamp
func (*ToDo) GetDescription ¶
func (*ToDo) GetUpdatedAt ¶
func (x *ToDo) GetUpdatedAt() *timestamppb.Timestamp
func (*ToDo) ProtoMessage ¶
func (*ToDo) ProtoMessage()
func (*ToDo) ProtoReflect ¶
func (x *ToDo) ProtoReflect() protoreflect.Message
type ToDoServiceClient ¶
type ToDoServiceClient interface { Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) }
ToDoServiceClient is the client API for ToDoService 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 NewToDoServiceClient ¶
func NewToDoServiceClient(cc grpc.ClientConnInterface) ToDoServiceClient
type ToDoServiceServer ¶
type ToDoServiceServer interface { Create(context.Context, *CreateRequest) (*CreateResponse, error) Get(context.Context, *GetRequest) (*GetResponse, error) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) List(context.Context, *ListRequest) (*ListResponse, error) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) }
ToDoServiceServer is the server API for ToDoService service. All implementations should embed UnimplementedToDoServiceServer for forward compatibility
type UnimplementedToDoServiceServer ¶
type UnimplementedToDoServiceServer struct { }
UnimplementedToDoServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedToDoServiceServer) Create ¶
func (UnimplementedToDoServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error)
func (UnimplementedToDoServiceServer) Delete ¶
func (UnimplementedToDoServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
func (UnimplementedToDoServiceServer) Get ¶
func (UnimplementedToDoServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error)
func (UnimplementedToDoServiceServer) List ¶
func (UnimplementedToDoServiceServer) List(context.Context, *ListRequest) (*ListResponse, error)
func (UnimplementedToDoServiceServer) Update ¶
func (UnimplementedToDoServiceServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
type UnsafeToDoServiceServer ¶
type UnsafeToDoServiceServer interface {
// contains filtered or unexported methods
}
UnsafeToDoServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ToDoServiceServer will result in compilation errors.
type UpdateRequest ¶
type UpdateRequest struct { // API version Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` Item *ToDo `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` // contains filtered or unexported fields }
func (*UpdateRequest) Descriptor
deprecated
func (*UpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.
func (*UpdateRequest) GetApi ¶
func (x *UpdateRequest) GetApi() string
func (*UpdateRequest) GetItem ¶
func (x *UpdateRequest) GetItem() *ToDo
func (*UpdateRequest) ProtoMessage ¶
func (*UpdateRequest) ProtoMessage()
func (*UpdateRequest) ProtoReflect ¶
func (x *UpdateRequest) ProtoReflect() protoreflect.Message
func (*UpdateRequest) Reset ¶
func (x *UpdateRequest) Reset()
func (*UpdateRequest) String ¶
func (x *UpdateRequest) String() string
type UpdateResponse ¶
type UpdateResponse struct { // API version Api string `protobuf:"bytes,1,opt,name=api,proto3" json:"api,omitempty"` Updated int64 `protobuf:"varint,2,opt,name=updated,proto3" json:"updated,omitempty"` // contains filtered or unexported fields }
func (*UpdateResponse) Descriptor
deprecated
func (*UpdateResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.
func (*UpdateResponse) GetApi ¶
func (x *UpdateResponse) GetApi() string
func (*UpdateResponse) GetUpdated ¶
func (x *UpdateResponse) GetUpdated() int64
func (*UpdateResponse) ProtoMessage ¶
func (*UpdateResponse) ProtoMessage()
func (*UpdateResponse) ProtoReflect ¶
func (x *UpdateResponse) ProtoReflect() protoreflect.Message
func (*UpdateResponse) Reset ¶
func (x *UpdateResponse) Reset()
func (*UpdateResponse) String ¶
func (x *UpdateResponse) String() string