Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterGenericServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGenericServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GenericServiceClient) error
- func RegisterGenericServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGenericServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GenericServiceServer) error
- func RegisterGenericServiceServer(s grpc.ServiceRegistrar, srv GenericServiceServer)
- type DoRequest
- type DoResponse
- type GenericServiceClient
- type GenericServiceServer
- type UnimplementedGenericServiceServer
- type UnsafeGenericServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_proto_api_component_generic_v1_generic_proto protoreflect.FileDescriptor
var GenericService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.api.component.generic.v1.GenericService", HandlerType: (*GenericServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Do", Handler: _GenericService_Do_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/api/component/generic/v1/generic.proto", }
GenericService_ServiceDesc is the grpc.ServiceDesc for GenericService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGenericServiceHandler ¶
func RegisterGenericServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterGenericServiceHandler registers the http handlers for service GenericService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGenericServiceHandlerClient ¶
func RegisterGenericServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GenericServiceClient) error
RegisterGenericServiceHandlerClient registers the http handlers for service GenericService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GenericServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GenericServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GenericServiceClient" to call the correct interceptors.
func RegisterGenericServiceHandlerFromEndpoint ¶
func RegisterGenericServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGenericServiceHandlerFromEndpoint is same as RegisterGenericServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGenericServiceHandlerServer ¶
func RegisterGenericServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GenericServiceServer) error
RegisterGenericServiceHandlerServer registers the http handlers for service GenericService to "mux". UnaryRPC :call GenericServiceServer 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 RegisterGenericServiceHandlerFromEndpoint instead.
func RegisterGenericServiceServer ¶
func RegisterGenericServiceServer(s grpc.ServiceRegistrar, srv GenericServiceServer)
Types ¶
type DoRequest ¶
type DoRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Command *structpb.Struct `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"` // contains filtered or unexported fields }
func (*DoRequest) Descriptor
deprecated
func (*DoRequest) GetCommand ¶
func (*DoRequest) ProtoMessage ¶
func (*DoRequest) ProtoMessage()
func (*DoRequest) ProtoReflect ¶
func (x *DoRequest) ProtoReflect() protoreflect.Message
type DoResponse ¶
type DoResponse struct { Result *structpb.Struct `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*DoResponse) Descriptor
deprecated
func (*DoResponse) Descriptor() ([]byte, []int)
Deprecated: Use DoResponse.ProtoReflect.Descriptor instead.
func (*DoResponse) GetResult ¶
func (x *DoResponse) GetResult() *structpb.Struct
func (*DoResponse) ProtoMessage ¶
func (*DoResponse) ProtoMessage()
func (*DoResponse) ProtoReflect ¶
func (x *DoResponse) ProtoReflect() protoreflect.Message
func (*DoResponse) Reset ¶
func (x *DoResponse) Reset()
func (*DoResponse) String ¶
func (x *DoResponse) String() string
type GenericServiceClient ¶
type GenericServiceClient interface { // Do sends/recieves arbitrary commands Do(ctx context.Context, in *DoRequest, opts ...grpc.CallOption) (*DoResponse, error) }
GenericServiceClient is the client API for GenericService 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 NewGenericServiceClient ¶
func NewGenericServiceClient(cc grpc.ClientConnInterface) GenericServiceClient
type GenericServiceServer ¶
type GenericServiceServer interface { // Do sends/recieves arbitrary commands Do(context.Context, *DoRequest) (*DoResponse, error) // contains filtered or unexported methods }
GenericServiceServer is the server API for GenericService service. All implementations must embed UnimplementedGenericServiceServer for forward compatibility
type UnimplementedGenericServiceServer ¶
type UnimplementedGenericServiceServer struct { }
UnimplementedGenericServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedGenericServiceServer) Do ¶
func (UnimplementedGenericServiceServer) Do(context.Context, *DoRequest) (*DoResponse, error)
type UnsafeGenericServiceServer ¶
type UnsafeGenericServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGenericServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GenericServiceServer will result in compilation errors.