v1

package
v0.0.0-...-f068abf Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "DRAFT",
		1: "IN_PROGRESS",
		2: "CANCEL",
		3: "DONE",
	}
	Status_value = map[string]int32{
		"DRAFT":       0,
		"IN_PROGRESS": 1,
		"CANCEL":      2,
		"DONE":        3,
	}
)

Enum value maps for Status.

View Source
var File_proto_todo_proto protoreflect.FileDescriptor

Functions

func RegisterTodoServiceHandler

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

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

func RegisterTodoServiceHandlerClient

func RegisterTodoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TodoServiceClient) error

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

func RegisterTodoServiceHandlerFromEndpoint

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

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

func RegisterTodoServiceHandlerServer

func RegisterTodoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TodoServiceServer) error

RegisterTodoServiceHandlerServer registers the http handlers for service TodoService to "mux". UnaryRPC :call TodoServiceServer 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 RegisterTodoServiceHandlerFromEndpoint instead.

func RegisterTodoServiceServer

func RegisterTodoServiceServer(s *grpc.Server, srv TodoServiceServer)

Types

type CreateTodoRequest

type CreateTodoRequest struct {
	Title       string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateTodoRequest) Descriptor deprecated

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

Deprecated: Use CreateTodoRequest.ProtoReflect.Descriptor instead.

func (*CreateTodoRequest) GetDescription

func (x *CreateTodoRequest) GetDescription() string

func (*CreateTodoRequest) GetTitle

func (x *CreateTodoRequest) GetTitle() string

func (*CreateTodoRequest) ProtoMessage

func (*CreateTodoRequest) ProtoMessage()

func (*CreateTodoRequest) ProtoReflect

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

func (*CreateTodoRequest) Reset

func (x *CreateTodoRequest) Reset()

func (*CreateTodoRequest) String

func (x *CreateTodoRequest) String() string

type CreateTodoResponse

type CreateTodoResponse struct {
	Code    int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Status  string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateTodoResponse) Descriptor deprecated

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

Deprecated: Use CreateTodoResponse.ProtoReflect.Descriptor instead.

func (*CreateTodoResponse) GetCode

func (x *CreateTodoResponse) GetCode() int32

func (*CreateTodoResponse) GetMessage

func (x *CreateTodoResponse) GetMessage() string

func (*CreateTodoResponse) GetStatus

func (x *CreateTodoResponse) GetStatus() string

func (*CreateTodoResponse) ProtoMessage

func (*CreateTodoResponse) ProtoMessage()

func (*CreateTodoResponse) ProtoReflect

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

func (*CreateTodoResponse) Reset

func (x *CreateTodoResponse) Reset()

func (*CreateTodoResponse) String

func (x *CreateTodoResponse) String() string

type DeleteTodoRequest

type DeleteTodoRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteTodoRequest) Descriptor deprecated

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

Deprecated: Use DeleteTodoRequest.ProtoReflect.Descriptor instead.

func (*DeleteTodoRequest) GetId

func (x *DeleteTodoRequest) GetId() string

func (*DeleteTodoRequest) ProtoMessage

func (*DeleteTodoRequest) ProtoMessage()

func (*DeleteTodoRequest) ProtoReflect

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

func (*DeleteTodoRequest) Reset

func (x *DeleteTodoRequest) Reset()

func (*DeleteTodoRequest) String

func (x *DeleteTodoRequest) String() string

type DeleteTodoResponse

type DeleteTodoResponse struct {
	Code    int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Status  string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteTodoResponse) Descriptor deprecated

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

Deprecated: Use DeleteTodoResponse.ProtoReflect.Descriptor instead.

func (*DeleteTodoResponse) GetCode

func (x *DeleteTodoResponse) GetCode() int32

func (*DeleteTodoResponse) GetMessage

func (x *DeleteTodoResponse) GetMessage() string

func (*DeleteTodoResponse) GetStatus

func (x *DeleteTodoResponse) GetStatus() string

func (*DeleteTodoResponse) ProtoMessage

func (*DeleteTodoResponse) ProtoMessage()

func (*DeleteTodoResponse) ProtoReflect

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

func (*DeleteTodoResponse) Reset

func (x *DeleteTodoResponse) Reset()

func (*DeleteTodoResponse) String

func (x *DeleteTodoResponse) String() string

type GetAllTodoRequest

type GetAllTodoRequest struct {
	// contains filtered or unexported fields
}

func (*GetAllTodoRequest) Descriptor deprecated

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

Deprecated: Use GetAllTodoRequest.ProtoReflect.Descriptor instead.

func (*GetAllTodoRequest) ProtoMessage

func (*GetAllTodoRequest) ProtoMessage()

func (*GetAllTodoRequest) ProtoReflect

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

func (*GetAllTodoRequest) Reset

func (x *GetAllTodoRequest) Reset()

func (*GetAllTodoRequest) String

func (x *GetAllTodoRequest) String() string

type GetAllTodoResponse

type GetAllTodoResponse struct {
	Code    int32   `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Status  string  `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	Message string  `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	Data    []*Todo `protobuf:"bytes,4,rep,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAllTodoResponse) Descriptor deprecated

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

Deprecated: Use GetAllTodoResponse.ProtoReflect.Descriptor instead.

func (*GetAllTodoResponse) GetCode

func (x *GetAllTodoResponse) GetCode() int32

func (*GetAllTodoResponse) GetData

func (x *GetAllTodoResponse) GetData() []*Todo

func (*GetAllTodoResponse) GetMessage

func (x *GetAllTodoResponse) GetMessage() string

func (*GetAllTodoResponse) GetStatus

func (x *GetAllTodoResponse) GetStatus() string

func (*GetAllTodoResponse) ProtoMessage

func (*GetAllTodoResponse) ProtoMessage()

func (*GetAllTodoResponse) ProtoReflect

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

func (*GetAllTodoResponse) Reset

func (x *GetAllTodoResponse) Reset()

func (*GetAllTodoResponse) String

func (x *GetAllTodoResponse) String() string

type GetTodoByIDRequest

type GetTodoByIDRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTodoByIDRequest) Descriptor deprecated

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

Deprecated: Use GetTodoByIDRequest.ProtoReflect.Descriptor instead.

func (*GetTodoByIDRequest) GetId

func (x *GetTodoByIDRequest) GetId() string

func (*GetTodoByIDRequest) ProtoMessage

func (*GetTodoByIDRequest) ProtoMessage()

func (*GetTodoByIDRequest) ProtoReflect

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

func (*GetTodoByIDRequest) Reset

func (x *GetTodoByIDRequest) Reset()

func (*GetTodoByIDRequest) String

func (x *GetTodoByIDRequest) String() string

type GetTodoByIDResponse

type GetTodoByIDResponse struct {
	Code    int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Status  string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	Data    *Todo  `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTodoByIDResponse) Descriptor deprecated

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

Deprecated: Use GetTodoByIDResponse.ProtoReflect.Descriptor instead.

func (*GetTodoByIDResponse) GetCode

func (x *GetTodoByIDResponse) GetCode() int32

func (*GetTodoByIDResponse) GetData

func (x *GetTodoByIDResponse) GetData() *Todo

func (*GetTodoByIDResponse) GetMessage

func (x *GetTodoByIDResponse) GetMessage() string

func (*GetTodoByIDResponse) GetStatus

func (x *GetTodoByIDResponse) GetStatus() string

func (*GetTodoByIDResponse) ProtoMessage

func (*GetTodoByIDResponse) ProtoMessage()

func (*GetTodoByIDResponse) ProtoReflect

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

func (*GetTodoByIDResponse) Reset

func (x *GetTodoByIDResponse) Reset()

func (*GetTodoByIDResponse) String

func (x *GetTodoByIDResponse) String() string

type Status

type Status int32
const (
	Status_DRAFT       Status = 0 // default value
	Status_IN_PROGRESS Status = 1
	Status_CANCEL      Status = 2
	Status_DONE        Status = 3
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

func (Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type Todo

type Todo struct {
	Id          string `protobuf:"bytes,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"`
	Status      Status `protobuf:"varint,4,opt,name=status,proto3,enum=v1.Status" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*Todo) Descriptor deprecated

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

Deprecated: Use Todo.ProtoReflect.Descriptor instead.

func (*Todo) GetDescription

func (x *Todo) GetDescription() string

func (*Todo) GetId

func (x *Todo) GetId() string

func (*Todo) GetStatus

func (x *Todo) GetStatus() Status

func (*Todo) GetTitle

func (x *Todo) GetTitle() string

func (*Todo) ProtoMessage

func (*Todo) ProtoMessage()

func (*Todo) ProtoReflect

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

func (*Todo) Reset

func (x *Todo) Reset()

func (*Todo) String

func (x *Todo) String() string

type TodoServiceClient

type TodoServiceClient interface {
	GetAllTodo(ctx context.Context, in *GetAllTodoRequest, opts ...grpc.CallOption) (*GetAllTodoResponse, error)
	GetTodoByID(ctx context.Context, in *GetTodoByIDRequest, opts ...grpc.CallOption) (*GetTodoByIDResponse, error)
	CreateTodo(ctx context.Context, in *CreateTodoRequest, opts ...grpc.CallOption) (*CreateTodoResponse, error)
	UpdateTodo(ctx context.Context, in *UpdateTodoRequest, opts ...grpc.CallOption) (*UpdateTodoResponse, error)
	DeleteTodo(ctx context.Context, in *DeleteTodoRequest, opts ...grpc.CallOption) (*DeleteTodoResponse, error)
}

TodoServiceClient is the client API for TodoService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type TodoServiceServer

TodoServiceServer is the server API for TodoService service.

type UnimplementedTodoServiceServer

type UnimplementedTodoServiceServer struct {
}

UnimplementedTodoServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedTodoServiceServer) CreateTodo

func (*UnimplementedTodoServiceServer) DeleteTodo

func (*UnimplementedTodoServiceServer) GetAllTodo

func (*UnimplementedTodoServiceServer) GetTodoByID

func (*UnimplementedTodoServiceServer) UpdateTodo

type UpdateTodoRequest

type UpdateTodoRequest struct {
	Id          string `protobuf:"bytes,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"`
	Status      Status `protobuf:"varint,4,opt,name=status,proto3,enum=v1.Status" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateTodoRequest) Descriptor deprecated

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

Deprecated: Use UpdateTodoRequest.ProtoReflect.Descriptor instead.

func (*UpdateTodoRequest) GetDescription

func (x *UpdateTodoRequest) GetDescription() string

func (*UpdateTodoRequest) GetId

func (x *UpdateTodoRequest) GetId() string

func (*UpdateTodoRequest) GetStatus

func (x *UpdateTodoRequest) GetStatus() Status

func (*UpdateTodoRequest) GetTitle

func (x *UpdateTodoRequest) GetTitle() string

func (*UpdateTodoRequest) ProtoMessage

func (*UpdateTodoRequest) ProtoMessage()

func (*UpdateTodoRequest) ProtoReflect

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

func (*UpdateTodoRequest) Reset

func (x *UpdateTodoRequest) Reset()

func (*UpdateTodoRequest) String

func (x *UpdateTodoRequest) String() string

type UpdateTodoResponse

type UpdateTodoResponse struct {
	Code    int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Status  string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateTodoResponse) Descriptor deprecated

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

Deprecated: Use UpdateTodoResponse.ProtoReflect.Descriptor instead.

func (*UpdateTodoResponse) GetCode

func (x *UpdateTodoResponse) GetCode() int32

func (*UpdateTodoResponse) GetMessage

func (x *UpdateTodoResponse) GetMessage() string

func (*UpdateTodoResponse) GetStatus

func (x *UpdateTodoResponse) GetStatus() string

func (*UpdateTodoResponse) ProtoMessage

func (*UpdateTodoResponse) ProtoMessage()

func (*UpdateTodoResponse) ProtoReflect

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

func (*UpdateTodoResponse) Reset

func (x *UpdateTodoResponse) Reset()

func (*UpdateTodoResponse) String

func (x *UpdateTodoResponse) String() string

Jump to

Keyboard shortcuts

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