Documentation ¶
Overview ¶
Package task is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterTaskServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTaskServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TaskServiceClient) error
- func RegisterTaskServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTaskServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TaskServiceServer) error
- func RegisterTaskServiceServer(s grpc.ServiceRegistrar, srv TaskServiceServer)
- type TaskCommonResponse
- func (*TaskCommonResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TaskCommonResponse) GetCode() int64
- func (x *TaskCommonResponse) GetData() string
- func (x *TaskCommonResponse) GetMsg() string
- func (*TaskCommonResponse) ProtoMessage()
- func (x *TaskCommonResponse) ProtoReflect() protoreflect.Message
- func (x *TaskCommonResponse) Reset()
- func (x *TaskCommonResponse) String() string
- type TaskModel
- func (*TaskModel) Descriptor() ([]byte, []int)deprecated
- func (x *TaskModel) GetContent() string
- func (x *TaskModel) GetEndTime() int64
- func (x *TaskModel) GetStartTime() int64
- func (x *TaskModel) GetStatus() int64
- func (x *TaskModel) GetTaskID() int64
- func (x *TaskModel) GetTitle() string
- func (x *TaskModel) GetUserID() int64
- func (*TaskModel) ProtoMessage()
- func (x *TaskModel) ProtoReflect() protoreflect.Message
- func (x *TaskModel) Reset()
- func (x *TaskModel) String() string
- type TaskRequest
- func (*TaskRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TaskRequest) GetContent() string
- func (x *TaskRequest) GetEndTime() int64
- func (x *TaskRequest) GetStartTime() int64
- func (x *TaskRequest) GetStatus() int64
- func (x *TaskRequest) GetTaskID() int64
- func (x *TaskRequest) GetTitle() string
- func (x *TaskRequest) GetUserID() int64
- func (*TaskRequest) ProtoMessage()
- func (x *TaskRequest) ProtoReflect() protoreflect.Message
- func (x *TaskRequest) Reset()
- func (x *TaskRequest) String() string
- type TaskServiceClient
- type TaskServiceServer
- type TasksDetailResponse
- func (*TasksDetailResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TasksDetailResponse) GetCode() int64
- func (x *TasksDetailResponse) GetTaskDetail() []*TaskModel
- func (*TasksDetailResponse) ProtoMessage()
- func (x *TasksDetailResponse) ProtoReflect() protoreflect.Message
- func (x *TasksDetailResponse) Reset()
- func (x *TasksDetailResponse) String() string
- type UnimplementedTaskServiceServer
- func (UnimplementedTaskServiceServer) TaskCreate(context.Context, *TaskRequest) (*TaskCommonResponse, error)
- func (UnimplementedTaskServiceServer) TaskDelete(context.Context, *TaskRequest) (*TaskCommonResponse, error)
- func (UnimplementedTaskServiceServer) TaskShow(context.Context, *TaskRequest) (*TasksDetailResponse, error)
- func (UnimplementedTaskServiceServer) TaskUpdate(context.Context, *TaskRequest) (*TaskCommonResponse, error)
- type UnsafeTaskServiceServer
Constants ¶
const ( TaskService_TaskCreate_FullMethodName = "/TaskService/TaskCreate" TaskService_TaskUpdate_FullMethodName = "/TaskService/TaskUpdate" TaskService_TaskShow_FullMethodName = "/TaskService/TaskShow" TaskService_TaskDelete_FullMethodName = "/TaskService/TaskDelete" )
Variables ¶
var File_task_proto protoreflect.FileDescriptor
var TaskService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "TaskService", HandlerType: (*TaskServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "TaskCreate", Handler: _TaskService_TaskCreate_Handler, }, { MethodName: "TaskUpdate", Handler: _TaskService_TaskUpdate_Handler, }, { MethodName: "TaskShow", Handler: _TaskService_TaskShow_Handler, }, { MethodName: "TaskDelete", Handler: _TaskService_TaskDelete_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "task.proto", }
TaskService_ServiceDesc is the grpc.ServiceDesc for TaskService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTaskServiceHandler ¶
func RegisterTaskServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTaskServiceHandler registers the http handlers for service TaskService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTaskServiceHandlerClient ¶
func RegisterTaskServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TaskServiceClient) error
RegisterTaskServiceHandlerClient registers the http handlers for service TaskService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TaskServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TaskServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TaskServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterTaskServiceHandlerFromEndpoint ¶
func RegisterTaskServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTaskServiceHandlerFromEndpoint is same as RegisterTaskServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTaskServiceHandlerServer ¶
func RegisterTaskServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TaskServiceServer) error
RegisterTaskServiceHandlerServer registers the http handlers for service TaskService to "mux". UnaryRPC :call TaskServiceServer 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 RegisterTaskServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterTaskServiceServer ¶
func RegisterTaskServiceServer(s grpc.ServiceRegistrar, srv TaskServiceServer)
Types ¶
type TaskCommonResponse ¶
type TaskCommonResponse struct { // @inject_tag: json:"code" form:"code" Code int64 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` // @inject_tag: json:"msg" form:"msg" Msg string `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg,omitempty"` // @inject_tag: json:"data" form:"data" Data string `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"` // contains filtered or unexported fields }
func (*TaskCommonResponse) Descriptor
deprecated
func (*TaskCommonResponse) Descriptor() ([]byte, []int)
Deprecated: Use TaskCommonResponse.ProtoReflect.Descriptor instead.
func (*TaskCommonResponse) GetCode ¶
func (x *TaskCommonResponse) GetCode() int64
func (*TaskCommonResponse) GetData ¶
func (x *TaskCommonResponse) GetData() string
func (*TaskCommonResponse) GetMsg ¶
func (x *TaskCommonResponse) GetMsg() string
func (*TaskCommonResponse) ProtoMessage ¶
func (*TaskCommonResponse) ProtoMessage()
func (*TaskCommonResponse) ProtoReflect ¶
func (x *TaskCommonResponse) ProtoReflect() protoreflect.Message
func (*TaskCommonResponse) Reset ¶
func (x *TaskCommonResponse) Reset()
func (*TaskCommonResponse) String ¶
func (x *TaskCommonResponse) String() string
type TaskModel ¶
type TaskModel struct { // @inject_tag: json:"task_id" form:"task_id" TaskID int64 `protobuf:"varint,1,opt,name=TaskID,proto3" json:"TaskID,omitempty"` // @inject_tag: json:"user_id" form:"user_id" UserID int64 `protobuf:"varint,2,opt,name=UserID,proto3" json:"UserID,omitempty"` // @inject_tag: json:"status" form:"status" Status int64 `protobuf:"varint,3,opt,name=Status,proto3" json:"Status,omitempty"` // @inject_tag: json:"title" form:"title" Title string `protobuf:"bytes,4,opt,name=Title,proto3" json:"Title,omitempty"` // @inject_tag: json:"content" form:"content" Content string `protobuf:"bytes,5,opt,name=Content,proto3" json:"Content,omitempty"` // @inject_tag: json:"start_time" form:"start_time" StartTime int64 `protobuf:"varint,6,opt,name=StartTime,proto3" json:"StartTime,omitempty"` // @inject_tag: json:"end_time" form:"end_time" EndTime int64 `protobuf:"varint,7,opt,name=EndTime,proto3" json:"EndTime,omitempty"` // contains filtered or unexported fields }
func (*TaskModel) Descriptor
deprecated
func (*TaskModel) GetContent ¶
func (*TaskModel) GetEndTime ¶
func (*TaskModel) GetStartTime ¶
func (*TaskModel) ProtoMessage ¶
func (*TaskModel) ProtoMessage()
func (*TaskModel) ProtoReflect ¶
func (x *TaskModel) ProtoReflect() protoreflect.Message
type TaskRequest ¶
type TaskRequest struct { // @inject_tag: json:"task_id" form:"task_id" TaskID int64 `protobuf:"varint,1,opt,name=TaskID,proto3" json:"TaskID,omitempty"` // @inject_tag: json:"user_id" form:"user_id" UserID int64 `protobuf:"varint,2,opt,name=UserID,proto3" json:"UserID,omitempty"` // @inject_tag: json:"status" form:"status" Status int64 `protobuf:"varint,3,opt,name=Status,proto3" json:"Status,omitempty"` // @inject_tag: json:"title" form:"title" Title string `protobuf:"bytes,4,opt,name=Title,proto3" json:"Title,omitempty"` // @inject_tag: json:"content" form:"content" Content string `protobuf:"bytes,5,opt,name=Content,proto3" json:"Content,omitempty"` // @inject_tag: json:"start_time" form:"start_time" StartTime int64 `protobuf:"varint,6,opt,name=StartTime,proto3" json:"StartTime,omitempty"` // @inject_tag: json:"end_time" form:"end_time" EndTime int64 `protobuf:"varint,7,opt,name=EndTime,proto3" json:"EndTime,omitempty"` // contains filtered or unexported fields }
func (*TaskRequest) Descriptor
deprecated
func (*TaskRequest) Descriptor() ([]byte, []int)
Deprecated: Use TaskRequest.ProtoReflect.Descriptor instead.
func (*TaskRequest) GetContent ¶
func (x *TaskRequest) GetContent() string
func (*TaskRequest) GetEndTime ¶
func (x *TaskRequest) GetEndTime() int64
func (*TaskRequest) GetStartTime ¶
func (x *TaskRequest) GetStartTime() int64
func (*TaskRequest) GetStatus ¶
func (x *TaskRequest) GetStatus() int64
func (*TaskRequest) GetTaskID ¶
func (x *TaskRequest) GetTaskID() int64
func (*TaskRequest) GetTitle ¶
func (x *TaskRequest) GetTitle() string
func (*TaskRequest) GetUserID ¶
func (x *TaskRequest) GetUserID() int64
func (*TaskRequest) ProtoMessage ¶
func (*TaskRequest) ProtoMessage()
func (*TaskRequest) ProtoReflect ¶
func (x *TaskRequest) ProtoReflect() protoreflect.Message
func (*TaskRequest) Reset ¶
func (x *TaskRequest) Reset()
func (*TaskRequest) String ¶
func (x *TaskRequest) String() string
type TaskServiceClient ¶
type TaskServiceClient interface { TaskCreate(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TaskCommonResponse, error) TaskUpdate(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TaskCommonResponse, error) TaskShow(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TasksDetailResponse, error) TaskDelete(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TaskCommonResponse, error) }
TaskServiceClient is the client API for TaskService 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 NewTaskServiceClient ¶
func NewTaskServiceClient(cc grpc.ClientConnInterface) TaskServiceClient
type TaskServiceServer ¶
type TaskServiceServer interface { TaskCreate(context.Context, *TaskRequest) (*TaskCommonResponse, error) TaskUpdate(context.Context, *TaskRequest) (*TaskCommonResponse, error) TaskShow(context.Context, *TaskRequest) (*TasksDetailResponse, error) TaskDelete(context.Context, *TaskRequest) (*TaskCommonResponse, error) // contains filtered or unexported methods }
TaskServiceServer is the server API for TaskService service. All implementations must embed UnimplementedTaskServiceServer for forward compatibility.
type TasksDetailResponse ¶
type TasksDetailResponse struct { // @inject_tag: json:"task_model" form:"task_model" TaskDetail []*TaskModel `protobuf:"bytes,1,rep,name=TaskDetail,proto3" json:"TaskDetail,omitempty"` // @inject_tag: json:"code" form:"code" Code int64 `protobuf:"varint,2,opt,name=Code,proto3" json:"Code,omitempty"` // contains filtered or unexported fields }
func (*TasksDetailResponse) Descriptor
deprecated
func (*TasksDetailResponse) Descriptor() ([]byte, []int)
Deprecated: Use TasksDetailResponse.ProtoReflect.Descriptor instead.
func (*TasksDetailResponse) GetCode ¶
func (x *TasksDetailResponse) GetCode() int64
func (*TasksDetailResponse) GetTaskDetail ¶
func (x *TasksDetailResponse) GetTaskDetail() []*TaskModel
func (*TasksDetailResponse) ProtoMessage ¶
func (*TasksDetailResponse) ProtoMessage()
func (*TasksDetailResponse) ProtoReflect ¶
func (x *TasksDetailResponse) ProtoReflect() protoreflect.Message
func (*TasksDetailResponse) Reset ¶
func (x *TasksDetailResponse) Reset()
func (*TasksDetailResponse) String ¶
func (x *TasksDetailResponse) String() string
type UnimplementedTaskServiceServer ¶
type UnimplementedTaskServiceServer struct{}
UnimplementedTaskServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedTaskServiceServer) TaskCreate ¶
func (UnimplementedTaskServiceServer) TaskCreate(context.Context, *TaskRequest) (*TaskCommonResponse, error)
func (UnimplementedTaskServiceServer) TaskDelete ¶
func (UnimplementedTaskServiceServer) TaskDelete(context.Context, *TaskRequest) (*TaskCommonResponse, error)
func (UnimplementedTaskServiceServer) TaskShow ¶
func (UnimplementedTaskServiceServer) TaskShow(context.Context, *TaskRequest) (*TasksDetailResponse, error)
func (UnimplementedTaskServiceServer) TaskUpdate ¶
func (UnimplementedTaskServiceServer) TaskUpdate(context.Context, *TaskRequest) (*TaskCommonResponse, error)
type UnsafeTaskServiceServer ¶
type UnsafeTaskServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTaskServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TaskServiceServer will result in compilation errors.