stringsV1

package
v0.0.0-...-0a714ac Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package stringsV1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	StringsAPI_ToUpper_FullMethodName = "/example.api.strings.v1.StringsAPI/ToUpper"
	StringsAPI_GetInfo_FullMethodName = "/example.api.strings.v1.StringsAPI/GetInfo"
)

Variables

View Source
var File_example_api_strings_v1_strings_proto protoreflect.FileDescriptor
View Source
var StringsAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "example.api.strings.v1.StringsAPI",
	HandlerType: (*StringsAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ToUpper",
			Handler:    _StringsAPI_ToUpper_Handler,
		},
		{
			MethodName: "GetInfo",
			Handler:    _StringsAPI_GetInfo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "example/api/strings/v1/strings.proto",
}

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

Functions

func NewStringsAPIServiceDesc

func NewStringsAPIServiceDesc(s StringsAPIServer) transport.ServiceDesc

func RegisterStringsAPIHandler

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

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

func RegisterStringsAPIHandlerClient

func RegisterStringsAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StringsAPIClient) error

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

func RegisterStringsAPIHandlerFromEndpoint

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

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

func RegisterStringsAPIHandlerServer

func RegisterStringsAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StringsAPIServer) error

RegisterStringsAPIHandlerServer registers the http handlers for service StringsAPI to "mux". UnaryRPC :call StringsAPIServer 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 RegisterStringsAPIHandlerFromEndpoint instead.

func RegisterStringsAPIServer

func RegisterStringsAPIServer(s grpc.ServiceRegistrar, srv StringsAPIServer)

Types

type GetInfoReq

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

func (*GetInfoReq) Descriptor deprecated

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

Deprecated: Use GetInfoReq.ProtoReflect.Descriptor instead.

func (*GetInfoReq) GetStr

func (x *GetInfoReq) GetStr() string

func (*GetInfoReq) ProtoMessage

func (*GetInfoReq) ProtoMessage()

func (*GetInfoReq) ProtoReflect

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

func (*GetInfoReq) Reset

func (x *GetInfoReq) Reset()

func (*GetInfoReq) String

func (x *GetInfoReq) String() string

type GetInfoResp

type GetInfoResp struct {
	Str *v1.String `protobuf:"bytes,1,opt,name=str,proto3" json:"str,omitempty"`
	// contains filtered or unexported fields
}

func (*GetInfoResp) Descriptor deprecated

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

Deprecated: Use GetInfoResp.ProtoReflect.Descriptor instead.

func (*GetInfoResp) GetStr

func (x *GetInfoResp) GetStr() *v1.String

func (*GetInfoResp) ProtoMessage

func (*GetInfoResp) ProtoMessage()

func (*GetInfoResp) ProtoReflect

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

func (*GetInfoResp) Reset

func (x *GetInfoResp) Reset()

func (*GetInfoResp) String

func (x *GetInfoResp) String() string

type StringsAPIClient

type StringsAPIClient interface {
	// Method to upper
	ToUpper(ctx context.Context, in *ToUpperReq, opts ...grpc.CallOption) (*ToUpperResp, error)
	GetInfo(ctx context.Context, in *GetInfoReq, opts ...grpc.CallOption) (*GetInfoResp, error)
}

StringsAPIClient is the client API for StringsAPI 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 NewStringsAPIClient

func NewStringsAPIClient(cc grpc.ClientConnInterface) StringsAPIClient

type StringsAPIServer

type StringsAPIServer interface {
	// Method to upper
	ToUpper(context.Context, *ToUpperReq) (*ToUpperResp, error)
	GetInfo(context.Context, *GetInfoReq) (*GetInfoResp, error)
	// contains filtered or unexported methods
}

StringsAPIServer is the server API for StringsAPI service. All implementations must embed UnimplementedStringsAPIServer for forward compatibility

type StringsAPIServiceDesc

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

StringsAPIServiceDesc is description for the StringsAPIServer.

func (*StringsAPIServiceDesc) RegisterGRPC

func (d *StringsAPIServiceDesc) RegisterGRPC(s *grpc.Server)

func (*StringsAPIServiceDesc) RegisterHTTP

func (d *StringsAPIServiceDesc) RegisterHTTP(mux *runtime.ServeMux)

func (*StringsAPIServiceDesc) SwaggerDef

func (d *StringsAPIServiceDesc) SwaggerDef() []byte

type ToUpperReq

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

func (*ToUpperReq) Descriptor deprecated

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

Deprecated: Use ToUpperReq.ProtoReflect.Descriptor instead.

func (*ToUpperReq) GetStr

func (x *ToUpperReq) GetStr() string

func (*ToUpperReq) ProtoMessage

func (*ToUpperReq) ProtoMessage()

func (*ToUpperReq) ProtoReflect

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

func (*ToUpperReq) Reset

func (x *ToUpperReq) Reset()

func (*ToUpperReq) String

func (x *ToUpperReq) String() string

type ToUpperResp

type ToUpperResp struct {
	Str *v1.String `protobuf:"bytes,1,opt,name=str,proto3" json:"str,omitempty"`
	// contains filtered or unexported fields
}

func (*ToUpperResp) Descriptor deprecated

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

Deprecated: Use ToUpperResp.ProtoReflect.Descriptor instead.

func (*ToUpperResp) GetStr

func (x *ToUpperResp) GetStr() *v1.String

func (*ToUpperResp) ProtoMessage

func (*ToUpperResp) ProtoMessage()

func (*ToUpperResp) ProtoReflect

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

func (*ToUpperResp) Reset

func (x *ToUpperResp) Reset()

func (*ToUpperResp) String

func (x *ToUpperResp) String() string

type UnimplementedStringsAPIServer

type UnimplementedStringsAPIServer struct {
}

UnimplementedStringsAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedStringsAPIServer) GetInfo

func (UnimplementedStringsAPIServer) ToUpper

type UnsafeStringsAPIServer

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

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

Jump to

Keyboard shortcuts

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