v1

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: AGPL-3.0 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 File_api_service_summation_v1_summation_proto protoreflect.FileDescriptor
View Source
var SummationService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "acme.service.summation.v1.SummationService",
	HandlerType: (*SummationServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Sum",
			Handler:    _SummationService_Sum_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/service/summation/v1/summation.proto",
}

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

Functions

func RegisterSummationServiceHandler

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

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

func RegisterSummationServiceHandlerClient

func RegisterSummationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SummationServiceClient) error

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

func RegisterSummationServiceHandlerFromEndpoint

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

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

func RegisterSummationServiceHandlerServer

func RegisterSummationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SummationServiceServer) error

RegisterSummationServiceHandlerServer registers the http handlers for service SummationService to "mux". UnaryRPC :call SummationServiceServer 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 RegisterSummationServiceHandlerFromEndpoint instead.

func RegisterSummationServiceServer

func RegisterSummationServiceServer(s grpc.ServiceRegistrar, srv SummationServiceServer)

Types

type SumRequest

type SumRequest struct {
	Name    string    `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Numbers []float64 `protobuf:"fixed64,2,rep,packed,name=numbers,proto3" json:"numbers,omitempty"`
	// contains filtered or unexported fields
}

func (*SumRequest) Descriptor deprecated

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

Deprecated: Use SumRequest.ProtoReflect.Descriptor instead.

func (*SumRequest) GetName

func (x *SumRequest) GetName() string

func (*SumRequest) GetNumbers

func (x *SumRequest) GetNumbers() []float64

func (*SumRequest) ProtoMessage

func (*SumRequest) ProtoMessage()

func (*SumRequest) ProtoReflect

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

func (*SumRequest) Reset

func (x *SumRequest) Reset()

func (*SumRequest) String

func (x *SumRequest) String() string

type SumResponse

type SumResponse struct {
	Sum float64 `protobuf:"fixed64,1,opt,name=sum,proto3" json:"sum,omitempty"`
	// contains filtered or unexported fields
}

func (*SumResponse) Descriptor deprecated

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

Deprecated: Use SumResponse.ProtoReflect.Descriptor instead.

func (*SumResponse) GetSum

func (x *SumResponse) GetSum() float64

func (*SumResponse) ProtoMessage

func (*SumResponse) ProtoMessage()

func (*SumResponse) ProtoReflect

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

func (*SumResponse) Reset

func (x *SumResponse) Reset()

func (*SumResponse) String

func (x *SumResponse) String() string

type SummationServiceClient

type SummationServiceClient interface {
	Sum(ctx context.Context, in *SumRequest, opts ...grpc.CallOption) (*SumResponse, error)
}

SummationServiceClient is the client API for SummationService 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 SummationServiceServer

type SummationServiceServer interface {
	Sum(context.Context, *SumRequest) (*SumResponse, error)
	// contains filtered or unexported methods
}

SummationServiceServer is the server API for SummationService service. All implementations must embed UnimplementedSummationServiceServer for forward compatibility

type UnimplementedSummationServiceServer

type UnimplementedSummationServiceServer struct {
}

UnimplementedSummationServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedSummationServiceServer) Sum

type UnsafeSummationServiceServer

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

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

Jump to

Keyboard shortcuts

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