protobuf

package
v0.0.0-...-fa223cd Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package protobuf is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Abs_List_FullMethodName   = "/go.micro.service.abs.Abs/List"
	Abs_Create_FullMethodName = "/go.micro.service.abs.Abs/Create"
	Abs_Get_FullMethodName    = "/go.micro.service.abs.Abs/Get"
	Abs_Update_FullMethodName = "/go.micro.service.abs.Abs/Update"
	Abs_Delete_FullMethodName = "/go.micro.service.abs.Abs/Delete"
)

Variables

View Source
var Abs_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "go.micro.service.abs.Abs",
	HandlerType: (*AbsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _Abs_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _Abs_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Abs_Get_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _Abs_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Abs_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "services/abs/protobuf/abs.proto",
}

Abs_ServiceDesc is the grpc.ServiceDesc for Abs 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_services_abs_protobuf_abs_proto protoreflect.FileDescriptor

Functions

func RegisterAbsHandler

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

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

func RegisterAbsHandlerClient

func RegisterAbsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AbsClient) error

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

func RegisterAbsHandlerFromEndpoint

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

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

func RegisterAbsHandlerServer

func RegisterAbsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AbsServer) error

RegisterAbsHandlerServer registers the http handlers for service Abs to "mux". UnaryRPC :call AbsServer 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 RegisterAbsHandlerFromEndpoint instead.

func RegisterAbsServer

func RegisterAbsServer(s grpc.ServiceRegistrar, srv AbsServer)

Types

type AbsClient

type AbsClient interface {
	List(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Response, error)
	Create(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Response, error)
	Get(ctx context.Context, in *EntityRequest, opts ...grpc.CallOption) (*Response, error)
	Update(ctx context.Context, in *EntityRequest, opts ...grpc.CallOption) (*Response, error)
	Delete(ctx context.Context, in *EntityRequest, opts ...grpc.CallOption) (*Response, error)
}

AbsClient is the client API for Abs 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 NewAbsClient

func NewAbsClient(cc grpc.ClientConnInterface) AbsClient

type AbsServer

type AbsServer interface {
	List(context.Context, *emptypb.Empty) (*Response, error)
	Create(context.Context, *emptypb.Empty) (*Response, error)
	Get(context.Context, *EntityRequest) (*Response, error)
	Update(context.Context, *EntityRequest) (*Response, error)
	Delete(context.Context, *EntityRequest) (*Response, error)
	// contains filtered or unexported methods
}

AbsServer is the server API for Abs service. All implementations must embed UnimplementedAbsServer for forward compatibility

type EntityRequest

type EntityRequest struct {
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id" db:"id"` // @gotags: json:"id" db:"id"
	// contains filtered or unexported fields
}

func (*EntityRequest) Descriptor deprecated

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

Deprecated: Use EntityRequest.ProtoReflect.Descriptor instead.

func (*EntityRequest) GetId

func (x *EntityRequest) GetId() string

func (*EntityRequest) ProtoMessage

func (*EntityRequest) ProtoMessage()

func (*EntityRequest) ProtoReflect

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

func (*EntityRequest) Reset

func (x *EntityRequest) Reset()

func (*EntityRequest) String

func (x *EntityRequest) String() string

type Response

type Response struct {
	Message string `protobuf:"bytes,1,opt,name=Message,proto3" json:"message"` // @gotags: json:"message"
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetMessage

func (x *Response) GetMessage() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type UnimplementedAbsServer

type UnimplementedAbsServer struct {
}

UnimplementedAbsServer must be embedded to have forward compatible implementations.

func (UnimplementedAbsServer) Create

func (UnimplementedAbsServer) Delete

func (UnimplementedAbsServer) Get

func (UnimplementedAbsServer) List

func (UnimplementedAbsServer) Update

type UnsafeAbsServer

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

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

Jump to

Keyboard shortcuts

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