Documentation ¶
Overview ¶
Package todosservicepb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterTodosServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTodosServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TodosServiceClient) error
- func RegisterTodosServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTodosServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TodosServiceServer) error
- func RegisterTodosServiceServer(s grpc.ServiceRegistrar, srv TodosServiceServer)
- type CreateTodoRequest
- type GetTodoRequest
- func (*GetTodoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetTodoRequest) GetBody() *emptypb.Empty
- func (x *GetTodoRequest) GetTdi() string
- func (*GetTodoRequest) ProtoMessage()
- func (x *GetTodoRequest) ProtoReflect() protoreflect.Message
- func (x *GetTodoRequest) Reset()
- func (x *GetTodoRequest) String() string
- type ListTodosRequest
- type TodosServiceClient
- type TodosServiceServer
- type UnimplementedTodosServiceServer
- func (UnimplementedTodosServiceServer) CreateTodo(context.Context, *CreateTodoRequest) (*todos.ItemEntity, error)
- func (UnimplementedTodosServiceServer) GetTodo(context.Context, *GetTodoRequest) (*todos.ItemEntity, error)
- func (UnimplementedTodosServiceServer) ListTodos(context.Context, *ListTodosRequest) (*todos.ItemCollection, error)
- func (UnimplementedTodosServiceServer) UpdateTodo(context.Context, *UpdateTodoRequest) (*todos.ItemEntity, error)
- type UnsafeTodosServiceServer
- type UpdateTodoRequest
- func (*UpdateTodoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateTodoRequest) GetBody() *todos.Item
- func (x *UpdateTodoRequest) GetTdi() string
- func (*UpdateTodoRequest) ProtoMessage()
- func (x *UpdateTodoRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateTodoRequest) Reset()
- func (x *UpdateTodoRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var File_todosservice_reqmsgs_proto protoreflect.FileDescriptor
var File_todosservice_todosservice_proto protoreflect.FileDescriptor
var TodosService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "todosservice.TodosService", HandlerType: (*TodosServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateTodo", Handler: _TodosService_CreateTodo_Handler, }, { MethodName: "GetTodo", Handler: _TodosService_GetTodo_Handler, }, { MethodName: "ListTodos", Handler: _TodosService_ListTodos_Handler, }, { MethodName: "UpdateTodo", Handler: _TodosService_UpdateTodo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "todosservice/todosservice.proto", }
TodosService_ServiceDesc is the grpc.ServiceDesc for TodosService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTodosServiceHandler ¶
func RegisterTodosServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTodosServiceHandler registers the http handlers for service TodosService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTodosServiceHandlerClient ¶
func RegisterTodosServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TodosServiceClient) error
RegisterTodosServiceHandlerClient registers the http handlers for service TodosService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TodosServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TodosServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TodosServiceClient" to call the correct interceptors.
func RegisterTodosServiceHandlerFromEndpoint ¶
func RegisterTodosServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTodosServiceHandlerFromEndpoint is same as RegisterTodosServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTodosServiceHandlerServer ¶
func RegisterTodosServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TodosServiceServer) error
RegisterTodosServiceHandlerServer registers the http handlers for service TodosService to "mux". UnaryRPC :call TodosServiceServer 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 RegisterTodosServiceHandlerFromEndpoint instead.
func RegisterTodosServiceServer ¶
func RegisterTodosServiceServer(s grpc.ServiceRegistrar, srv TodosServiceServer)
Types ¶
type CreateTodoRequest ¶
type CreateTodoRequest struct { // Body with todos.Item Body *todos.Item `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
request message for CreateTodo
func (*CreateTodoRequest) Descriptor
deprecated
func (*CreateTodoRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateTodoRequest.ProtoReflect.Descriptor instead.
func (*CreateTodoRequest) GetBody ¶
func (x *CreateTodoRequest) GetBody() *todos.Item
func (*CreateTodoRequest) ProtoMessage ¶
func (*CreateTodoRequest) ProtoMessage()
func (*CreateTodoRequest) ProtoReflect ¶
func (x *CreateTodoRequest) ProtoReflect() protoreflect.Message
func (*CreateTodoRequest) Reset ¶
func (x *CreateTodoRequest) Reset()
func (*CreateTodoRequest) String ¶
func (x *CreateTodoRequest) String() string
type GetTodoRequest ¶
type GetTodoRequest struct { // Body with google.protobuf.Empty Body *emptypb.Empty `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` // The query param **tdi** stands for the item id. Tdi string `protobuf:"bytes,2,opt,name=tdi,proto3" json:"tdi,omitempty"` // contains filtered or unexported fields }
request message for GetTodo
func (*GetTodoRequest) Descriptor
deprecated
func (*GetTodoRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetTodoRequest.ProtoReflect.Descriptor instead.
func (*GetTodoRequest) GetBody ¶
func (x *GetTodoRequest) GetBody() *emptypb.Empty
func (*GetTodoRequest) GetTdi ¶
func (x *GetTodoRequest) GetTdi() string
func (*GetTodoRequest) ProtoMessage ¶
func (*GetTodoRequest) ProtoMessage()
func (*GetTodoRequest) ProtoReflect ¶
func (x *GetTodoRequest) ProtoReflect() protoreflect.Message
func (*GetTodoRequest) Reset ¶
func (x *GetTodoRequest) Reset()
func (*GetTodoRequest) String ¶
func (x *GetTodoRequest) String() string
type ListTodosRequest ¶
type ListTodosRequest struct { // Body with google.protobuf.Empty Body *emptypb.Empty `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
request message for ListTodos
func (*ListTodosRequest) Descriptor
deprecated
func (*ListTodosRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListTodosRequest.ProtoReflect.Descriptor instead.
func (*ListTodosRequest) GetBody ¶
func (x *ListTodosRequest) GetBody() *emptypb.Empty
func (*ListTodosRequest) ProtoMessage ¶
func (*ListTodosRequest) ProtoMessage()
func (*ListTodosRequest) ProtoReflect ¶
func (x *ListTodosRequest) ProtoReflect() protoreflect.Message
func (*ListTodosRequest) Reset ¶
func (x *ListTodosRequest) Reset()
func (*ListTodosRequest) String ¶
func (x *ListTodosRequest) String() string
type TodosServiceClient ¶
type TodosServiceClient interface { // Adds a new ToDos item to the ToDos list CreateTodo(ctx context.Context, in *CreateTodoRequest, opts ...grpc.CallOption) (*todos.ItemEntity, error) // The Get method takes zero or more parameters, and returns a todos.ItemEntity which contains a todos.Item GetTodo(ctx context.Context, in *GetTodoRequest, opts ...grpc.CallOption) (*todos.ItemEntity, error) // The List method takes zero or more parameters as input, and returns a todos.ItemCollection of todos.ItemEntity that match the input parameters. ListTodos(ctx context.Context, in *ListTodosRequest, opts ...grpc.CallOption) (*todos.ItemCollection, error) // The Get method takes zero or more parameters, and returns a todos.ItemEntity which contains a todos.Item UpdateTodo(ctx context.Context, in *UpdateTodoRequest, opts ...grpc.CallOption) (*todos.ItemEntity, error) }
TodosServiceClient is the client API for TodosService 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 NewTodosServiceClient ¶
func NewTodosServiceClient(cc grpc.ClientConnInterface) TodosServiceClient
type TodosServiceServer ¶
type TodosServiceServer interface { // Adds a new ToDos item to the ToDos list CreateTodo(context.Context, *CreateTodoRequest) (*todos.ItemEntity, error) // The Get method takes zero or more parameters, and returns a todos.ItemEntity which contains a todos.Item GetTodo(context.Context, *GetTodoRequest) (*todos.ItemEntity, error) // The List method takes zero or more parameters as input, and returns a todos.ItemCollection of todos.ItemEntity that match the input parameters. ListTodos(context.Context, *ListTodosRequest) (*todos.ItemCollection, error) // The Get method takes zero or more parameters, and returns a todos.ItemEntity which contains a todos.Item UpdateTodo(context.Context, *UpdateTodoRequest) (*todos.ItemEntity, error) // contains filtered or unexported methods }
TodosServiceServer is the server API for TodosService service. All implementations must embed UnimplementedTodosServiceServer for forward compatibility
type UnimplementedTodosServiceServer ¶
type UnimplementedTodosServiceServer struct { }
UnimplementedTodosServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedTodosServiceServer) CreateTodo ¶
func (UnimplementedTodosServiceServer) CreateTodo(context.Context, *CreateTodoRequest) (*todos.ItemEntity, error)
func (UnimplementedTodosServiceServer) GetTodo ¶
func (UnimplementedTodosServiceServer) GetTodo(context.Context, *GetTodoRequest) (*todos.ItemEntity, error)
func (UnimplementedTodosServiceServer) ListTodos ¶
func (UnimplementedTodosServiceServer) ListTodos(context.Context, *ListTodosRequest) (*todos.ItemCollection, error)
func (UnimplementedTodosServiceServer) UpdateTodo ¶
func (UnimplementedTodosServiceServer) UpdateTodo(context.Context, *UpdateTodoRequest) (*todos.ItemEntity, error)
type UnsafeTodosServiceServer ¶
type UnsafeTodosServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTodosServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TodosServiceServer will result in compilation errors.
type UpdateTodoRequest ¶
type UpdateTodoRequest struct { // Body with todos.Item Body *todos.Item `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` // The query param **tdi** stands for the item id. Tdi string `protobuf:"bytes,2,opt,name=tdi,proto3" json:"tdi,omitempty"` // contains filtered or unexported fields }
request message for UpdateTodo
func (*UpdateTodoRequest) Descriptor
deprecated
func (*UpdateTodoRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateTodoRequest.ProtoReflect.Descriptor instead.
func (*UpdateTodoRequest) GetBody ¶
func (x *UpdateTodoRequest) GetBody() *todos.Item
func (*UpdateTodoRequest) GetTdi ¶
func (x *UpdateTodoRequest) GetTdi() string
func (*UpdateTodoRequest) ProtoMessage ¶
func (*UpdateTodoRequest) ProtoMessage()
func (*UpdateTodoRequest) ProtoReflect ¶
func (x *UpdateTodoRequest) ProtoReflect() protoreflect.Message
func (*UpdateTodoRequest) Reset ¶
func (x *UpdateTodoRequest) Reset()
func (*UpdateTodoRequest) String ¶
func (x *UpdateTodoRequest) String() string