godairyv1

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package godairyv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Godairy_NewTask_FullMethodName     = "/dairy.Godairy/NewTask"
	Godairy_NewDate_FullMethodName     = "/dairy.Godairy/NewDate"
	Godairy_Date_FullMethodName        = "/dairy.Godairy/Date"
	Godairy_TasksOfDate_FullMethodName = "/dairy.Godairy/TasksOfDate"
	Godairy_Task_FullMethodName        = "/dairy.Godairy/Task"
	Godairy_DeleteTask_FullMethodName  = "/dairy.Godairy/DeleteTask"
)

Variables

View Source
var File_dairy_dairy_proto protoreflect.FileDescriptor
View Source
var Godairy_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dairy.Godairy",
	HandlerType: (*GodairyServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "NewTask",
			Handler:    _Godairy_NewTask_Handler,
		},
		{
			MethodName: "NewDate",
			Handler:    _Godairy_NewDate_Handler,
		},
		{
			MethodName: "Date",
			Handler:    _Godairy_Date_Handler,
		},
		{
			MethodName: "TasksOfDate",
			Handler:    _Godairy_TasksOfDate_Handler,
		},
		{
			MethodName: "Task",
			Handler:    _Godairy_Task_Handler,
		},
		{
			MethodName: "DeleteTask",
			Handler:    _Godairy_DeleteTask_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "dairy/dairy.proto",
}

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

Functions

func RegisterGodairyHandler

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

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

func RegisterGodairyHandlerClient

func RegisterGodairyHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GodairyClient) error

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

func RegisterGodairyHandlerFromEndpoint

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

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

func RegisterGodairyHandlerServer

func RegisterGodairyHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GodairyServer) error

RegisterGodairyHandlerServer registers the http handlers for service Godairy to "mux". UnaryRPC :call GodairyServer 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 RegisterGodairyHandlerFromEndpoint 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 RegisterGodairyServer

func RegisterGodairyServer(s grpc.ServiceRegistrar, srv GodairyServer)

Types

type DateRequest

type DateRequest struct {
	DateUuid string                 `protobuf:"bytes,1,opt,name=date_uuid,json=dateUuid,proto3" json:"date_uuid,omitempty"` //ID of database record
	Date     *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=date,proto3" json:"date,omitempty"`                         //selected date
	// contains filtered or unexported fields
}

func (*DateRequest) Descriptor deprecated

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

Deprecated: Use DateRequest.ProtoReflect.Descriptor instead.

func (*DateRequest) GetDate

func (x *DateRequest) GetDate() *timestamppb.Timestamp

func (*DateRequest) GetDateUuid

func (x *DateRequest) GetDateUuid() string

func (*DateRequest) ProtoMessage

func (*DateRequest) ProtoMessage()

func (*DateRequest) ProtoReflect

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

func (*DateRequest) Reset

func (x *DateRequest) Reset()

func (*DateRequest) String

func (x *DateRequest) String() string

type DateResponse

type DateResponse struct {
	DateUuid string                 `protobuf:"bytes,1,opt,name=date_uuid,json=dateUuid,proto3" json:"date_uuid,omitempty"` //ID of database record
	Date     *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=date,proto3" json:"date,omitempty"`                         //selected date
	// contains filtered or unexported fields
}

func (*DateResponse) Descriptor deprecated

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

Deprecated: Use DateResponse.ProtoReflect.Descriptor instead.

func (*DateResponse) GetDate

func (x *DateResponse) GetDate() *timestamppb.Timestamp

func (*DateResponse) GetDateUuid

func (x *DateResponse) GetDateUuid() string

func (*DateResponse) ProtoMessage

func (*DateResponse) ProtoMessage()

func (*DateResponse) ProtoReflect

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

func (*DateResponse) Reset

func (x *DateResponse) Reset()

func (*DateResponse) String

func (x *DateResponse) String() string

type DeleteTaskRequest

type DeleteTaskRequest struct {
	RecordUuid string `protobuf:"bytes,1,opt,name=record_uuid,json=recordUuid,proto3" json:"record_uuid,omitempty"` //ID of database record
	// contains filtered or unexported fields
}

func (*DeleteTaskRequest) Descriptor deprecated

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

Deprecated: Use DeleteTaskRequest.ProtoReflect.Descriptor instead.

func (*DeleteTaskRequest) GetRecordUuid

func (x *DeleteTaskRequest) GetRecordUuid() string

func (*DeleteTaskRequest) ProtoMessage

func (*DeleteTaskRequest) ProtoMessage()

func (*DeleteTaskRequest) ProtoReflect

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

func (*DeleteTaskRequest) Reset

func (x *DeleteTaskRequest) Reset()

func (*DeleteTaskRequest) String

func (x *DeleteTaskRequest) String() string

type GodairyClient

type GodairyClient interface {
	NewTask(ctx context.Context, in *NewTaskRequest, opts ...grpc.CallOption) (*NewTaskResponse, error)
	NewDate(ctx context.Context, in *DateRequest, opts ...grpc.CallOption) (*DateResponse, error)
	Date(ctx context.Context, in *DateRequest, opts ...grpc.CallOption) (*DateResponse, error)
	TasksOfDate(ctx context.Context, in *DateRequest, opts ...grpc.CallOption) (*TaskResponse, error)
	Task(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TaskResponse, error)
	DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

GodairyClient is the client API for Godairy 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 NewGodairyClient

func NewGodairyClient(cc grpc.ClientConnInterface) GodairyClient

type GodairyServer

type GodairyServer interface {
	NewTask(context.Context, *NewTaskRequest) (*NewTaskResponse, error)
	NewDate(context.Context, *DateRequest) (*DateResponse, error)
	Date(context.Context, *DateRequest) (*DateResponse, error)
	TasksOfDate(context.Context, *DateRequest) (*TaskResponse, error)
	Task(context.Context, *TaskRequest) (*TaskResponse, error)
	DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

GodairyServer is the server API for Godairy service. All implementations must embed UnimplementedGodairyServer for forward compatibility.

type NewTaskRequest

type NewTaskRequest struct {
	RecordUuid string                 `protobuf:"bytes,1,opt,name=record_uuid,json=recordUuid,proto3" json:"record_uuid,omitempty"` //ID of database record
	Datetime   *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=datetime,proto3" json:"datetime,omitempty"`                       //time and date of new task
	Task       string                 `protobuf:"bytes,3,opt,name=task,proto3" json:"task,omitempty"`                               //message of task
	// contains filtered or unexported fields
}

func (*NewTaskRequest) Descriptor deprecated

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

Deprecated: Use NewTaskRequest.ProtoReflect.Descriptor instead.

func (*NewTaskRequest) GetDatetime

func (x *NewTaskRequest) GetDatetime() *timestamppb.Timestamp

func (*NewTaskRequest) GetRecordUuid

func (x *NewTaskRequest) GetRecordUuid() string

func (*NewTaskRequest) GetTask

func (x *NewTaskRequest) GetTask() string

func (*NewTaskRequest) ProtoMessage

func (*NewTaskRequest) ProtoMessage()

func (*NewTaskRequest) ProtoReflect

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

func (*NewTaskRequest) Reset

func (x *NewTaskRequest) Reset()

func (*NewTaskRequest) String

func (x *NewTaskRequest) String() string

type NewTaskResponse

type NewTaskResponse struct {
	RecordUuid string `protobuf:"bytes,1,opt,name=record_uuid,json=recordUuid,proto3" json:"record_uuid,omitempty"` //ID of database record
	// contains filtered or unexported fields
}

func (*NewTaskResponse) Descriptor deprecated

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

Deprecated: Use NewTaskResponse.ProtoReflect.Descriptor instead.

func (*NewTaskResponse) GetRecordUuid

func (x *NewTaskResponse) GetRecordUuid() string

func (*NewTaskResponse) ProtoMessage

func (*NewTaskResponse) ProtoMessage()

func (*NewTaskResponse) ProtoReflect

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

func (*NewTaskResponse) Reset

func (x *NewTaskResponse) Reset()

func (*NewTaskResponse) String

func (x *NewTaskResponse) String() string

type Task

type Task struct {
	RecordUuid string                 `protobuf:"bytes,1,opt,name=record_uuid,json=recordUuid,proto3" json:"record_uuid,omitempty"` //ID of database record
	Datetime   *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=datetime,proto3" json:"datetime,omitempty"`                       //time and date of new task
	Task       string                 `protobuf:"bytes,3,opt,name=task,proto3" json:"task,omitempty"`                               //message of task
	// contains filtered or unexported fields
}

func (*Task) Descriptor deprecated

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

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetDatetime

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

func (*Task) GetRecordUuid

func (x *Task) GetRecordUuid() string

func (*Task) GetTask

func (x *Task) GetTask() string

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 TaskRequest

type TaskRequest struct {
	RecordUuid string                 `protobuf:"bytes,1,opt,name=record_uuid,json=recordUuid,proto3" json:"record_uuid,omitempty"` //ID of database record
	Datetime   *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=datetime,proto3" json:"datetime,omitempty"`                       //time and date of new task
	Task       string                 `protobuf:"bytes,3,opt,name=task,proto3" json:"task,omitempty"`                               //message of task
	// contains filtered or unexported fields
}

func (*TaskRequest) Descriptor deprecated

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

Deprecated: Use TaskRequest.ProtoReflect.Descriptor instead.

func (*TaskRequest) GetDatetime

func (x *TaskRequest) GetDatetime() *timestamppb.Timestamp

func (*TaskRequest) GetRecordUuid

func (x *TaskRequest) GetRecordUuid() string

func (*TaskRequest) GetTask

func (x *TaskRequest) GetTask() string

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 TaskResponse

type TaskResponse struct {
	Tasks []*Task `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"` //planning tasks
	// contains filtered or unexported fields
}

func (*TaskResponse) Descriptor deprecated

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

Deprecated: Use TaskResponse.ProtoReflect.Descriptor instead.

func (*TaskResponse) GetTasks

func (x *TaskResponse) GetTasks() []*Task

func (*TaskResponse) ProtoMessage

func (*TaskResponse) ProtoMessage()

func (*TaskResponse) ProtoReflect

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

func (*TaskResponse) Reset

func (x *TaskResponse) Reset()

func (*TaskResponse) String

func (x *TaskResponse) String() string

type UnimplementedGodairyServer

type UnimplementedGodairyServer struct{}

UnimplementedGodairyServer 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 (UnimplementedGodairyServer) Date

func (UnimplementedGodairyServer) DeleteTask

func (UnimplementedGodairyServer) NewDate

func (UnimplementedGodairyServer) NewTask

func (UnimplementedGodairyServer) Task

func (UnimplementedGodairyServer) TasksOfDate

type UnsafeGodairyServer

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

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

Jump to

Keyboard shortcuts

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