v1

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 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_proto_api_component_mycomponent_v1_mycomponent_proto protoreflect.FileDescriptor
View Source
var MyComponentService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.api.component.mycomponent.v1.MyComponentService",
	HandlerType: (*MyComponentServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DoOne",
			Handler:    _MyComponentService_DoOne_Handler,
		},
		{
			MethodName: "DoTwo",
			Handler:    _MyComponentService_DoTwo_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "DoOneClientStream",
			Handler:       _MyComponentService_DoOneClientStream_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "DoOneServerStream",
			Handler:       _MyComponentService_DoOneServerStream_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "DoOneBiDiStream",
			Handler:       _MyComponentService_DoOneBiDiStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "proto/api/component/mycomponent/v1/mycomponent.proto",
}

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

Functions

func RegisterMyComponentServiceHandler

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

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

func RegisterMyComponentServiceHandlerClient

func RegisterMyComponentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MyComponentServiceClient) error

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

func RegisterMyComponentServiceHandlerFromEndpoint

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

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

func RegisterMyComponentServiceHandlerServer

func RegisterMyComponentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MyComponentServiceServer) error

RegisterMyComponentServiceHandlerServer registers the http handlers for service MyComponentService to "mux". UnaryRPC :call MyComponentServiceServer 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 RegisterMyComponentServiceHandlerFromEndpoint instead.

func RegisterMyComponentServiceServer

func RegisterMyComponentServiceServer(s grpc.ServiceRegistrar, srv MyComponentServiceServer)

Types

type DoOneBiDiStreamRequest

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

func (*DoOneBiDiStreamRequest) Descriptor deprecated

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

Deprecated: Use DoOneBiDiStreamRequest.ProtoReflect.Descriptor instead.

func (*DoOneBiDiStreamRequest) GetArg1

func (x *DoOneBiDiStreamRequest) GetArg1() string

func (*DoOneBiDiStreamRequest) GetName

func (x *DoOneBiDiStreamRequest) GetName() string

func (*DoOneBiDiStreamRequest) ProtoMessage

func (*DoOneBiDiStreamRequest) ProtoMessage()

func (*DoOneBiDiStreamRequest) ProtoReflect

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

func (*DoOneBiDiStreamRequest) Reset

func (x *DoOneBiDiStreamRequest) Reset()

func (*DoOneBiDiStreamRequest) String

func (x *DoOneBiDiStreamRequest) String() string

type DoOneBiDiStreamResponse

type DoOneBiDiStreamResponse struct {
	Ret1 bool `protobuf:"varint,1,opt,name=ret1,proto3" json:"ret1,omitempty"`
	// contains filtered or unexported fields
}

func (*DoOneBiDiStreamResponse) Descriptor deprecated

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

Deprecated: Use DoOneBiDiStreamResponse.ProtoReflect.Descriptor instead.

func (*DoOneBiDiStreamResponse) GetRet1

func (x *DoOneBiDiStreamResponse) GetRet1() bool

func (*DoOneBiDiStreamResponse) ProtoMessage

func (*DoOneBiDiStreamResponse) ProtoMessage()

func (*DoOneBiDiStreamResponse) ProtoReflect

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

func (*DoOneBiDiStreamResponse) Reset

func (x *DoOneBiDiStreamResponse) Reset()

func (*DoOneBiDiStreamResponse) String

func (x *DoOneBiDiStreamResponse) String() string

type DoOneClientStreamRequest

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

func (*DoOneClientStreamRequest) Descriptor deprecated

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

Deprecated: Use DoOneClientStreamRequest.ProtoReflect.Descriptor instead.

func (*DoOneClientStreamRequest) GetArg1

func (x *DoOneClientStreamRequest) GetArg1() string

func (*DoOneClientStreamRequest) GetName

func (x *DoOneClientStreamRequest) GetName() string

func (*DoOneClientStreamRequest) ProtoMessage

func (*DoOneClientStreamRequest) ProtoMessage()

func (*DoOneClientStreamRequest) ProtoReflect

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

func (*DoOneClientStreamRequest) Reset

func (x *DoOneClientStreamRequest) Reset()

func (*DoOneClientStreamRequest) String

func (x *DoOneClientStreamRequest) String() string

type DoOneClientStreamResponse

type DoOneClientStreamResponse struct {
	Ret1 bool `protobuf:"varint,1,opt,name=ret1,proto3" json:"ret1,omitempty"`
	// contains filtered or unexported fields
}

func (*DoOneClientStreamResponse) Descriptor deprecated

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

Deprecated: Use DoOneClientStreamResponse.ProtoReflect.Descriptor instead.

func (*DoOneClientStreamResponse) GetRet1

func (x *DoOneClientStreamResponse) GetRet1() bool

func (*DoOneClientStreamResponse) ProtoMessage

func (*DoOneClientStreamResponse) ProtoMessage()

func (*DoOneClientStreamResponse) ProtoReflect

func (*DoOneClientStreamResponse) Reset

func (x *DoOneClientStreamResponse) Reset()

func (*DoOneClientStreamResponse) String

func (x *DoOneClientStreamResponse) String() string

type DoOneRequest

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

func (*DoOneRequest) Descriptor deprecated

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

Deprecated: Use DoOneRequest.ProtoReflect.Descriptor instead.

func (*DoOneRequest) GetArg1

func (x *DoOneRequest) GetArg1() string

func (*DoOneRequest) GetName

func (x *DoOneRequest) GetName() string

func (*DoOneRequest) ProtoMessage

func (*DoOneRequest) ProtoMessage()

func (*DoOneRequest) ProtoReflect

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

func (*DoOneRequest) Reset

func (x *DoOneRequest) Reset()

func (*DoOneRequest) String

func (x *DoOneRequest) String() string

type DoOneResponse

type DoOneResponse struct {
	Ret1 bool `protobuf:"varint,1,opt,name=ret1,proto3" json:"ret1,omitempty"`
	// contains filtered or unexported fields
}

func (*DoOneResponse) Descriptor deprecated

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

Deprecated: Use DoOneResponse.ProtoReflect.Descriptor instead.

func (*DoOneResponse) GetRet1

func (x *DoOneResponse) GetRet1() bool

func (*DoOneResponse) ProtoMessage

func (*DoOneResponse) ProtoMessage()

func (*DoOneResponse) ProtoReflect

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

func (*DoOneResponse) Reset

func (x *DoOneResponse) Reset()

func (*DoOneResponse) String

func (x *DoOneResponse) String() string

type DoOneServerStreamRequest

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

func (*DoOneServerStreamRequest) Descriptor deprecated

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

Deprecated: Use DoOneServerStreamRequest.ProtoReflect.Descriptor instead.

func (*DoOneServerStreamRequest) GetArg1

func (x *DoOneServerStreamRequest) GetArg1() string

func (*DoOneServerStreamRequest) GetName

func (x *DoOneServerStreamRequest) GetName() string

func (*DoOneServerStreamRequest) ProtoMessage

func (*DoOneServerStreamRequest) ProtoMessage()

func (*DoOneServerStreamRequest) ProtoReflect

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

func (*DoOneServerStreamRequest) Reset

func (x *DoOneServerStreamRequest) Reset()

func (*DoOneServerStreamRequest) String

func (x *DoOneServerStreamRequest) String() string

type DoOneServerStreamResponse

type DoOneServerStreamResponse struct {
	Ret1 bool `protobuf:"varint,1,opt,name=ret1,proto3" json:"ret1,omitempty"`
	// contains filtered or unexported fields
}

func (*DoOneServerStreamResponse) Descriptor deprecated

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

Deprecated: Use DoOneServerStreamResponse.ProtoReflect.Descriptor instead.

func (*DoOneServerStreamResponse) GetRet1

func (x *DoOneServerStreamResponse) GetRet1() bool

func (*DoOneServerStreamResponse) ProtoMessage

func (*DoOneServerStreamResponse) ProtoMessage()

func (*DoOneServerStreamResponse) ProtoReflect

func (*DoOneServerStreamResponse) Reset

func (x *DoOneServerStreamResponse) Reset()

func (*DoOneServerStreamResponse) String

func (x *DoOneServerStreamResponse) String() string

type DoTwoRequest

type DoTwoRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Arg1 bool   `protobuf:"varint,2,opt,name=arg1,proto3" json:"arg1,omitempty"`
	// contains filtered or unexported fields
}

func (*DoTwoRequest) Descriptor deprecated

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

Deprecated: Use DoTwoRequest.ProtoReflect.Descriptor instead.

func (*DoTwoRequest) GetArg1

func (x *DoTwoRequest) GetArg1() bool

func (*DoTwoRequest) GetName

func (x *DoTwoRequest) GetName() string

func (*DoTwoRequest) ProtoMessage

func (*DoTwoRequest) ProtoMessage()

func (*DoTwoRequest) ProtoReflect

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

func (*DoTwoRequest) Reset

func (x *DoTwoRequest) Reset()

func (*DoTwoRequest) String

func (x *DoTwoRequest) String() string

type DoTwoResponse

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

func (*DoTwoResponse) Descriptor deprecated

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

Deprecated: Use DoTwoResponse.ProtoReflect.Descriptor instead.

func (*DoTwoResponse) GetRet1

func (x *DoTwoResponse) GetRet1() string

func (*DoTwoResponse) ProtoMessage

func (*DoTwoResponse) ProtoMessage()

func (*DoTwoResponse) ProtoReflect

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

func (*DoTwoResponse) Reset

func (x *DoTwoResponse) Reset()

func (*DoTwoResponse) String

func (x *DoTwoResponse) String() string

type MyComponentServiceClient

type MyComponentServiceClient interface {
	DoOne(ctx context.Context, in *DoOneRequest, opts ...grpc.CallOption) (*DoOneResponse, error)
	DoOneClientStream(ctx context.Context, opts ...grpc.CallOption) (MyComponentService_DoOneClientStreamClient, error)
	DoOneServerStream(ctx context.Context, in *DoOneServerStreamRequest, opts ...grpc.CallOption) (MyComponentService_DoOneServerStreamClient, error)
	DoOneBiDiStream(ctx context.Context, opts ...grpc.CallOption) (MyComponentService_DoOneBiDiStreamClient, error)
	DoTwo(ctx context.Context, in *DoTwoRequest, opts ...grpc.CallOption) (*DoTwoResponse, error)
}

MyComponentServiceClient is the client API for MyComponentService 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 MyComponentServiceServer

type MyComponentServiceServer interface {
	DoOne(context.Context, *DoOneRequest) (*DoOneResponse, error)
	DoOneClientStream(MyComponentService_DoOneClientStreamServer) error
	DoOneServerStream(*DoOneServerStreamRequest, MyComponentService_DoOneServerStreamServer) error
	DoOneBiDiStream(MyComponentService_DoOneBiDiStreamServer) error
	DoTwo(context.Context, *DoTwoRequest) (*DoTwoResponse, error)
	// contains filtered or unexported methods
}

MyComponentServiceServer is the server API for MyComponentService service. All implementations must embed UnimplementedMyComponentServiceServer for forward compatibility

type MyComponentService_DoOneBiDiStreamClient

type MyComponentService_DoOneBiDiStreamClient interface {
	Send(*DoOneBiDiStreamRequest) error
	Recv() (*DoOneBiDiStreamResponse, error)
	grpc.ClientStream
}

type MyComponentService_DoOneBiDiStreamServer

type MyComponentService_DoOneBiDiStreamServer interface {
	Send(*DoOneBiDiStreamResponse) error
	Recv() (*DoOneBiDiStreamRequest, error)
	grpc.ServerStream
}

type MyComponentService_DoOneClientStreamClient

type MyComponentService_DoOneClientStreamClient interface {
	Send(*DoOneClientStreamRequest) error
	CloseAndRecv() (*DoOneClientStreamResponse, error)
	grpc.ClientStream
}

type MyComponentService_DoOneClientStreamServer

type MyComponentService_DoOneClientStreamServer interface {
	SendAndClose(*DoOneClientStreamResponse) error
	Recv() (*DoOneClientStreamRequest, error)
	grpc.ServerStream
}

type MyComponentService_DoOneServerStreamClient

type MyComponentService_DoOneServerStreamClient interface {
	Recv() (*DoOneServerStreamResponse, error)
	grpc.ClientStream
}

type MyComponentService_DoOneServerStreamServer

type MyComponentService_DoOneServerStreamServer interface {
	Send(*DoOneServerStreamResponse) error
	grpc.ServerStream
}

type UnimplementedMyComponentServiceServer

type UnimplementedMyComponentServiceServer struct {
}

UnimplementedMyComponentServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedMyComponentServiceServer) DoOne

func (UnimplementedMyComponentServiceServer) DoOneBiDiStream

func (UnimplementedMyComponentServiceServer) DoOneClientStream

func (UnimplementedMyComponentServiceServer) DoTwo

type UnsafeMyComponentServiceServer

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

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

Jump to

Keyboard shortcuts

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