tasksv1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package tasksv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	TasksService_CreateTask_FullMethodName = "/api.tasks.v1.TasksService/CreateTask"
)

Variables

View Source
var File_api_tasks_v1_tasks_proto protoreflect.FileDescriptor
View Source
var TasksService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.tasks.v1.TasksService",
	HandlerType: (*TasksServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateTask",
			Handler:    _TasksService_CreateTask_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/tasks/v1/tasks.proto",
}

TasksService_ServiceDesc is the grpc.ServiceDesc for TasksService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterTasksServiceHandler

func RegisterTasksServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTasksServiceHandler registers the http handlers for service TasksService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTasksServiceHandlerClient

func RegisterTasksServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TasksServiceClient) error

RegisterTasksServiceHandlerClient registers the http handlers for service TasksService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TasksServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TasksServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TasksServiceClient" to call the correct interceptors.

func RegisterTasksServiceHandlerFromEndpoint

func RegisterTasksServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTasksServiceHandlerFromEndpoint is same as RegisterTasksServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTasksServiceHandlerServer

func RegisterTasksServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TasksServiceServer) error

RegisterTasksServiceHandlerServer registers the http handlers for service TasksService to "mux". UnaryRPC :call TasksServiceServer 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 RegisterTasksServiceHandlerFromEndpoint instead.

func RegisterTasksServiceServer

func RegisterTasksServiceServer(s grpc.ServiceRegistrar, srv TasksServiceServer)

Types

type CreateTaskRequest

type CreateTaskRequest struct {

	// Task is the the task to create.
	Task *Task `protobuf:"bytes,2,opt,name=task,proto3" json:"task,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateTaskRequest) Descriptor deprecated

func (*CreateTaskRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateTaskRequest.ProtoReflect.Descriptor instead.

func (*CreateTaskRequest) GetTask

func (x *CreateTaskRequest) GetTask() *Task

func (*CreateTaskRequest) ProtoMessage

func (*CreateTaskRequest) ProtoMessage()

func (*CreateTaskRequest) ProtoReflect

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

func (*CreateTaskRequest) Reset

func (x *CreateTaskRequest) Reset()

func (*CreateTaskRequest) String

func (x *CreateTaskRequest) String() string

type Task

type Task struct {
	Id          int64                  `protobuf:"varint,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"`
	Deadline    *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=deadline,proto3" json:"deadline,omitempty"`
	CompletedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=completed_at,json=completedAt,proto3" json:"completed_at,omitempty"`
	CreateTime  *timestamppb.Timestamp `protobuf:"bytes,1000,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	UpdateTime  *timestamppb.Timestamp `protobuf:"bytes,1001,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	// contains filtered or unexported fields
}

func (*Task) Descriptor deprecated

func (*Task) Descriptor() ([]byte, []int)

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetCompletedAt

func (x *Task) GetCompletedAt() *timestamppb.Timestamp

func (*Task) GetCreateTime

func (x *Task) GetCreateTime() *timestamppb.Timestamp

func (*Task) GetDeadline

func (x *Task) GetDeadline() *timestamppb.Timestamp

func (*Task) GetDescription

func (x *Task) GetDescription() string

func (*Task) GetId

func (x *Task) GetId() int64

func (*Task) GetTitle

func (x *Task) GetTitle() string

func (*Task) GetUpdateTime

func (x *Task) GetUpdateTime() *timestamppb.Timestamp

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) ProtoReflect

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

func (*Task) Reset

func (x *Task) Reset()

func (*Task) String

func (x *Task) String() string

type TasksServiceClient

type TasksServiceClient interface {
	// CreateTask creates a Task.
	CreateTask(ctx context.Context, in *CreateTaskRequest, opts ...grpc.CallOption) (*Task, error)
}

TasksServiceClient is the client API for TasksService 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 TasksServiceServer

type TasksServiceServer interface {
	// CreateTask creates a Task.
	CreateTask(context.Context, *CreateTaskRequest) (*Task, error)
	// contains filtered or unexported methods
}

TasksServiceServer is the server API for TasksService service. All implementations must embed UnimplementedTasksServiceServer for forward compatibility

type UnimplementedTasksServiceServer

type UnimplementedTasksServiceServer struct {
}

UnimplementedTasksServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTasksServiceServer) CreateTask

type UnsafeTasksServiceServer

type UnsafeTasksServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeTasksServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TasksServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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