Documentation ¶
Overview ¶
Package todoPb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterToDoListHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterToDoListHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ToDoListClient) error
- func RegisterToDoListHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterToDoListHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ToDoListServer) error
- func RegisterToDoListServer(s grpc.ServiceRegistrar, srv ToDoListServer)
- type CreateToDoListResult
- func (*CreateToDoListResult) Descriptor() ([]byte, []int)deprecated
- func (x *CreateToDoListResult) GetRecord() int64
- func (*CreateToDoListResult) ProtoMessage()
- func (x *CreateToDoListResult) ProtoReflect() protoreflect.Message
- func (x *CreateToDoListResult) Reset()
- func (x *CreateToDoListResult) String() string
- type ReadToDoListByPage
- func (*ReadToDoListByPage) Descriptor() ([]byte, []int)deprecated
- func (x *ReadToDoListByPage) GetTodolist() []*ToDoListDetail
- func (*ReadToDoListByPage) ProtoMessage()
- func (x *ReadToDoListByPage) ProtoReflect() protoreflect.Message
- func (x *ReadToDoListByPage) Reset()
- func (x *ReadToDoListByPage) String() string
- type ToDoListClient
- type ToDoListDetail
- func (*ToDoListDetail) Descriptor() ([]byte, []int)deprecated
- func (x *ToDoListDetail) GetContent() string
- func (x *ToDoListDetail) GetCreated() int64
- func (x *ToDoListDetail) GetDatetime() int64
- func (x *ToDoListDetail) GetDeleted() int64
- func (x *ToDoListDetail) GetId() int64
- func (x *ToDoListDetail) GetUid() int64
- func (x *ToDoListDetail) GetUpdated() int64
- func (*ToDoListDetail) ProtoMessage()
- func (x *ToDoListDetail) ProtoReflect() protoreflect.Message
- func (x *ToDoListDetail) Reset()
- func (x *ToDoListDetail) String() string
- type ToDoListPage
- func (*ToDoListPage) Descriptor() ([]byte, []int)deprecated
- func (x *ToDoListPage) GetCount() int64
- func (x *ToDoListPage) GetPage() int64
- func (*ToDoListPage) ProtoMessage()
- func (x *ToDoListPage) ProtoReflect() protoreflect.Message
- func (x *ToDoListPage) Reset()
- func (x *ToDoListPage) String() string
- type ToDoListServer
- type UnimplementedToDoListServer
- type UnsafeToDoListServer
Constants ¶
This section is empty.
Variables ¶
var File_toDoList_proto protoreflect.FileDescriptor
var ToDoList_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ToDoList", HandlerType: (*ToDoListServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateToDoList", Handler: _ToDoList_CreateToDoList_Handler, }, { MethodName: "ReadToDoList", Handler: _ToDoList_ReadToDoList_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "toDoList.proto", }
ToDoList_ServiceDesc is the grpc.ServiceDesc for ToDoList service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterToDoListHandler ¶
func RegisterToDoListHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterToDoListHandler registers the http handlers for service ToDoList to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterToDoListHandlerClient ¶
func RegisterToDoListHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ToDoListClient) error
RegisterToDoListHandlerClient registers the http handlers for service ToDoList to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ToDoListClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ToDoListClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ToDoListClient" to call the correct interceptors.
func RegisterToDoListHandlerFromEndpoint ¶
func RegisterToDoListHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterToDoListHandlerFromEndpoint is same as RegisterToDoListHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterToDoListHandlerServer ¶
func RegisterToDoListHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ToDoListServer) error
RegisterToDoListHandlerServer registers the http handlers for service ToDoList to "mux". UnaryRPC :call ToDoListServer 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 RegisterToDoListHandlerFromEndpoint instead.
func RegisterToDoListServer ¶
func RegisterToDoListServer(s grpc.ServiceRegistrar, srv ToDoListServer)
Types ¶
type CreateToDoListResult ¶
type CreateToDoListResult struct { Record int64 `protobuf:"varint,1,opt,name=record,proto3" json:"record,omitempty"` // contains filtered or unexported fields }
func (*CreateToDoListResult) Descriptor
deprecated
func (*CreateToDoListResult) Descriptor() ([]byte, []int)
Deprecated: Use CreateToDoListResult.ProtoReflect.Descriptor instead.
func (*CreateToDoListResult) GetRecord ¶
func (x *CreateToDoListResult) GetRecord() int64
func (*CreateToDoListResult) ProtoMessage ¶
func (*CreateToDoListResult) ProtoMessage()
func (*CreateToDoListResult) ProtoReflect ¶
func (x *CreateToDoListResult) ProtoReflect() protoreflect.Message
func (*CreateToDoListResult) Reset ¶
func (x *CreateToDoListResult) Reset()
func (*CreateToDoListResult) String ¶
func (x *CreateToDoListResult) String() string
type ReadToDoListByPage ¶
type ReadToDoListByPage struct { Todolist []*ToDoListDetail `protobuf:"bytes,1,rep,name=todolist,proto3" json:"todolist,omitempty"` // contains filtered or unexported fields }
func (*ReadToDoListByPage) Descriptor
deprecated
func (*ReadToDoListByPage) Descriptor() ([]byte, []int)
Deprecated: Use ReadToDoListByPage.ProtoReflect.Descriptor instead.
func (*ReadToDoListByPage) GetTodolist ¶
func (x *ReadToDoListByPage) GetTodolist() []*ToDoListDetail
func (*ReadToDoListByPage) ProtoMessage ¶
func (*ReadToDoListByPage) ProtoMessage()
func (*ReadToDoListByPage) ProtoReflect ¶
func (x *ReadToDoListByPage) ProtoReflect() protoreflect.Message
func (*ReadToDoListByPage) Reset ¶
func (x *ReadToDoListByPage) Reset()
func (*ReadToDoListByPage) String ¶
func (x *ReadToDoListByPage) String() string
type ToDoListClient ¶
type ToDoListClient interface { CreateToDoList(ctx context.Context, in *ToDoListDetail, opts ...grpc.CallOption) (*CreateToDoListResult, error) ReadToDoList(ctx context.Context, in *ToDoListPage, opts ...grpc.CallOption) (*ReadToDoListByPage, error) }
ToDoListClient is the client API for ToDoList 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 NewToDoListClient ¶
func NewToDoListClient(cc grpc.ClientConnInterface) ToDoListClient
type ToDoListDetail ¶
type ToDoListDetail struct { // @inject_tag: form:"id" xorm:"'id' not null pk autoincr" Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty" form:"id" xorm:"'id' not null pk autoincr"` // @inject_tag: form:"uid" xorm:"'uid' bigint(20) not null default 0" Uid int64 `protobuf:"varint,2,opt,name=uid,proto3" json:"uid,omitempty" form:"uid" xorm:"'uid' bigint(20) not null default 0"` // @inject_tag: form:"content" xorm:"'content' varchar(300) not null default ”" Content string `` /* 132-byte string literal not displayed */ // @inject_tag: form:"datetime" xorm:"'datetime' int(10) not null default 0" Datetime int64 `` /* 131-byte string literal not displayed */ // @inject_tag: xorm:"'created_at' created" Created int64 `protobuf:"varint,5,opt,name=created,proto3" json:"created,omitempty" xorm:"'created_at' created"` // @inject_tag: xorm:"'updated_at' updated" Updated int64 `protobuf:"varint,6,opt,name=updated,proto3" json:"updated,omitempty" xorm:"'updated_at' updated"` // @inject_tag: xorm:"'deleted_at' deleted" Deleted int64 `protobuf:"varint,7,opt,name=deleted,proto3" json:"deleted,omitempty" xorm:"'deleted_at' deleted"` // contains filtered or unexported fields }
func (*ToDoListDetail) Descriptor
deprecated
func (*ToDoListDetail) Descriptor() ([]byte, []int)
Deprecated: Use ToDoListDetail.ProtoReflect.Descriptor instead.
func (*ToDoListDetail) GetContent ¶
func (x *ToDoListDetail) GetContent() string
func (*ToDoListDetail) GetCreated ¶
func (x *ToDoListDetail) GetCreated() int64
func (*ToDoListDetail) GetDatetime ¶
func (x *ToDoListDetail) GetDatetime() int64
func (*ToDoListDetail) GetDeleted ¶
func (x *ToDoListDetail) GetDeleted() int64
func (*ToDoListDetail) GetId ¶
func (x *ToDoListDetail) GetId() int64
func (*ToDoListDetail) GetUid ¶
func (x *ToDoListDetail) GetUid() int64
func (*ToDoListDetail) GetUpdated ¶
func (x *ToDoListDetail) GetUpdated() int64
func (*ToDoListDetail) ProtoMessage ¶
func (*ToDoListDetail) ProtoMessage()
func (*ToDoListDetail) ProtoReflect ¶
func (x *ToDoListDetail) ProtoReflect() protoreflect.Message
func (*ToDoListDetail) Reset ¶
func (x *ToDoListDetail) Reset()
func (*ToDoListDetail) String ¶
func (x *ToDoListDetail) String() string
type ToDoListPage ¶
type ToDoListPage struct { Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
func (*ToDoListPage) Descriptor
deprecated
func (*ToDoListPage) Descriptor() ([]byte, []int)
Deprecated: Use ToDoListPage.ProtoReflect.Descriptor instead.
func (*ToDoListPage) GetCount ¶
func (x *ToDoListPage) GetCount() int64
func (*ToDoListPage) GetPage ¶
func (x *ToDoListPage) GetPage() int64
func (*ToDoListPage) ProtoMessage ¶
func (*ToDoListPage) ProtoMessage()
func (*ToDoListPage) ProtoReflect ¶
func (x *ToDoListPage) ProtoReflect() protoreflect.Message
func (*ToDoListPage) Reset ¶
func (x *ToDoListPage) Reset()
func (*ToDoListPage) String ¶
func (x *ToDoListPage) String() string
type ToDoListServer ¶
type ToDoListServer interface { CreateToDoList(context.Context, *ToDoListDetail) (*CreateToDoListResult, error) ReadToDoList(context.Context, *ToDoListPage) (*ReadToDoListByPage, error) // contains filtered or unexported methods }
ToDoListServer is the server API for ToDoList service. All implementations must embed UnimplementedToDoListServer for forward compatibility
type UnimplementedToDoListServer ¶
type UnimplementedToDoListServer struct { }
UnimplementedToDoListServer must be embedded to have forward compatible implementations.
func (UnimplementedToDoListServer) CreateToDoList ¶
func (UnimplementedToDoListServer) CreateToDoList(context.Context, *ToDoListDetail) (*CreateToDoListResult, error)
func (UnimplementedToDoListServer) ReadToDoList ¶
func (UnimplementedToDoListServer) ReadToDoList(context.Context, *ToDoListPage) (*ReadToDoListByPage, error)
type UnsafeToDoListServer ¶
type UnsafeToDoListServer interface {
// contains filtered or unexported methods
}
UnsafeToDoListServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ToDoListServer will result in compilation errors.