task

package
v0.0.0-...-2400502 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package task is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	TaskService_TaskCreate_FullMethodName = "/TaskService/TaskCreate"
	TaskService_TaskUpdate_FullMethodName = "/TaskService/TaskUpdate"
	TaskService_TaskShow_FullMethodName   = "/TaskService/TaskShow"
	TaskService_TaskDelete_FullMethodName = "/TaskService/TaskDelete"
)

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use TaskModel.ProtoReflect.Descriptor instead.

func (*TaskModel) GetContent

func (x *TaskModel) GetContent() string

func (*TaskModel) GetEndTime

func (x *TaskModel) GetEndTime() int64

func (*TaskModel) GetStartTime

func (x *TaskModel) GetStartTime() int64

func (*TaskModel) GetStatus

func (x *TaskModel) GetStatus() int64

func (*TaskModel) GetTaskID

func (x *TaskModel) GetTaskID() int64

func (*TaskModel) GetTitle

func (x *TaskModel) GetTitle() string

func (*TaskModel) GetUserID

func (x *TaskModel) GetUserID() int64

func (*TaskModel) ProtoMessage

func (*TaskModel) ProtoMessage()

func (*TaskModel) ProtoReflect

func (x *TaskModel) ProtoReflect() protoreflect.Message

func (*TaskModel) Reset

func (x *TaskModel) Reset()

func (*TaskModel) String

func (x *TaskModel) String() string

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.

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) TaskDelete

func (UnimplementedTaskServiceServer) TaskShow

func (UnimplementedTaskServiceServer) TaskUpdate

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL