dogdatapb

package
v0.0.0-...-ffe79fa Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package dogdatapb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var DogDataService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dogdatapb.v1.DogDataService",
	HandlerType: (*DogDataServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _DogDataService_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _DogDataService_Get_Handler,
		},
		{
			MethodName: "List",
			Handler:    _DogDataService_List_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _DogDataService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _DogDataService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/v1/dogdata/dogdata.proto",
}

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

View Source
var File_proto_v1_dogdata_dogdata_proto protoreflect.FileDescriptor

Functions

func RegisterDogDataServiceHandler

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

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

func RegisterDogDataServiceHandlerClient

func RegisterDogDataServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DogDataServiceClient) error

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

func RegisterDogDataServiceHandlerFromEndpoint

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

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

func RegisterDogDataServiceHandlerServer

func RegisterDogDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DogDataServiceServer) error

RegisterDogDataServiceHandlerServer registers the http handlers for service DogDataService to "mux". UnaryRPC :call DogDataServiceServer 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 RegisterDogDataServiceHandlerFromEndpoint instead.

func RegisterDogDataServiceServer

func RegisterDogDataServiceServer(s grpc.ServiceRegistrar, srv DogDataServiceServer)

Types

type CreateRequest

type CreateRequest struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Breed string `protobuf:"bytes,2,opt,name=breed,proto3" json:"breed,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRequest) Descriptor deprecated

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

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetBreed

func (x *CreateRequest) GetBreed() string

func (*CreateRequest) GetName

func (x *CreateRequest) GetName() string

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

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

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

type CreateResponse

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

func (*CreateResponse) Descriptor deprecated

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

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetId

func (x *CreateResponse) GetId() int32

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect

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

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) String

func (x *CreateResponse) String() string

type DeleteRequest

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

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetId

func (x *DeleteRequest) GetId() int32

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

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

func (*DeleteResponse) Descriptor deprecated

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

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

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

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type DogData

type DogData struct {
	Id    int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name  string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Breed string `protobuf:"bytes,3,opt,name=breed,proto3" json:"breed,omitempty"`
	// contains filtered or unexported fields
}

func (*DogData) Descriptor deprecated

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

Deprecated: Use DogData.ProtoReflect.Descriptor instead.

func (*DogData) GetBreed

func (x *DogData) GetBreed() string

func (*DogData) GetId

func (x *DogData) GetId() int32

func (*DogData) GetName

func (x *DogData) GetName() string

func (*DogData) ProtoMessage

func (*DogData) ProtoMessage()

func (*DogData) ProtoReflect

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

func (*DogData) Reset

func (x *DogData) Reset()

func (*DogData) String

func (x *DogData) String() string

type DogDataServiceClient

type DogDataServiceClient interface {
	// Create creates new DogData.
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	// Create gets the DogData associated by id.
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	// Create lists all DogData.
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	// Update updates the DogData associated by id. If a filed value is null, ignores it.
	Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
	// Create deletes the DogData associated by id.
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
}

DogDataServiceClient is the client API for DogDataService 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 DogDataServiceServer

type DogDataServiceServer interface {
	// Create creates new DogData.
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
	// Create gets the DogData associated by id.
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// Create lists all DogData.
	List(context.Context, *ListRequest) (*ListResponse, error)
	// Update updates the DogData associated by id. If a filed value is null, ignores it.
	Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
	// Create deletes the DogData associated by id.
	Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
}

DogDataServiceServer is the server API for DogDataService service. All implementations should embed UnimplementedDogDataServiceServer for forward compatibility

type GetRequest

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

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetId

func (x *GetRequest) GetId() int32

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

type GetResponse struct {
	Dogdata *DogData `protobuf:"bytes,1,opt,name=dogdata,proto3" json:"dogdata,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetDogdata

func (x *GetResponse) GetDogdata() *DogData

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type ListRequest

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

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {
	Dogdata []*DogData `protobuf:"bytes,1,rep,name=dogdata,proto3" json:"dogdata,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetDogdata

func (x *ListResponse) GetDogdata() []*DogData

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type UnimplementedDogDataServiceServer

type UnimplementedDogDataServiceServer struct {
}

UnimplementedDogDataServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedDogDataServiceServer) Create

func (UnimplementedDogDataServiceServer) Delete

func (UnimplementedDogDataServiceServer) Get

func (UnimplementedDogDataServiceServer) List

func (UnimplementedDogDataServiceServer) Update

type UnsafeDogDataServiceServer

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

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

type UpdateRequest

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

func (*UpdateRequest) Descriptor deprecated

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

Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.

func (*UpdateRequest) GetId

func (x *UpdateRequest) GetId() int32

func (*UpdateRequest) GetName

func (x *UpdateRequest) GetName() string

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) ProtoReflect

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

func (*UpdateRequest) Reset

func (x *UpdateRequest) Reset()

func (*UpdateRequest) String

func (x *UpdateRequest) String() string

type UpdateResponse

type UpdateResponse struct {
	Dogdata *DogData `protobuf:"bytes,1,opt,name=dogdata,proto3" json:"dogdata,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateResponse) Descriptor deprecated

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

Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.

func (*UpdateResponse) GetDogdata

func (x *UpdateResponse) GetDogdata() *DogData

func (*UpdateResponse) ProtoMessage

func (*UpdateResponse) ProtoMessage()

func (*UpdateResponse) ProtoReflect

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

func (*UpdateResponse) Reset

func (x *UpdateResponse) Reset()

func (*UpdateResponse) String

func (x *UpdateResponse) String() string

Jump to

Keyboard shortcuts

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