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 DoCommandRequest
- func (*DoCommandRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DoCommandRequest) GetCommand() *structpb.Struct
- func (x *DoCommandRequest) GetName() string
- func (*DoCommandRequest) ProtoMessage()
- func (x *DoCommandRequest) ProtoReflect() protoreflect.Message
- func (x *DoCommandRequest) Reset()
- func (x *DoCommandRequest) String() string
- type DoCommandResponse
- func (*DoCommandResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DoCommandResponse) GetResult() *structpb.Struct
- func (*DoCommandResponse) ProtoMessage()
- func (x *DoCommandResponse) ProtoReflect() protoreflect.Message
- func (x *DoCommandResponse) Reset()
- func (x *DoCommandResponse) String() string
- type GenericServiceClient
- type GenericServiceServer
- type UnimplementedGenericServiceServer
- type UnsafeGenericServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_component_generic_v1_generic_proto protoreflect.FileDescriptor
var GenericService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "viam.component.generic.v1.GenericService", HandlerType: (*GenericServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "DoCommand", Handler: _GenericService_DoCommand_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "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 DoCommandRequest ¶
type DoCommandRequest 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 (*DoCommandRequest) Descriptor
deprecated
func (*DoCommandRequest) Descriptor() ([]byte, []int)
Deprecated: Use DoCommandRequest.ProtoReflect.Descriptor instead.
func (*DoCommandRequest) GetCommand ¶
func (x *DoCommandRequest) GetCommand() *structpb.Struct
func (*DoCommandRequest) GetName ¶
func (x *DoCommandRequest) GetName() string
func (*DoCommandRequest) ProtoMessage ¶
func (*DoCommandRequest) ProtoMessage()
func (*DoCommandRequest) ProtoReflect ¶
func (x *DoCommandRequest) ProtoReflect() protoreflect.Message
func (*DoCommandRequest) Reset ¶
func (x *DoCommandRequest) Reset()
func (*DoCommandRequest) String ¶
func (x *DoCommandRequest) String() string
type DoCommandResponse ¶
type DoCommandResponse struct { Result *structpb.Struct `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*DoCommandResponse) Descriptor
deprecated
func (*DoCommandResponse) Descriptor() ([]byte, []int)
Deprecated: Use DoCommandResponse.ProtoReflect.Descriptor instead.
func (*DoCommandResponse) GetResult ¶
func (x *DoCommandResponse) GetResult() *structpb.Struct
func (*DoCommandResponse) ProtoMessage ¶
func (*DoCommandResponse) ProtoMessage()
func (*DoCommandResponse) ProtoReflect ¶
func (x *DoCommandResponse) ProtoReflect() protoreflect.Message
func (*DoCommandResponse) Reset ¶
func (x *DoCommandResponse) Reset()
func (*DoCommandResponse) String ¶
func (x *DoCommandResponse) String() string
type GenericServiceClient ¶
type GenericServiceClient interface { // DoCommand sends/recieves arbitrary commands DoCommand(ctx context.Context, in *DoCommandRequest, opts ...grpc.CallOption) (*DoCommandResponse, 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 { // DoCommand sends/recieves arbitrary commands DoCommand(context.Context, *DoCommandRequest) (*DoCommandResponse, 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) DoCommand ¶
func (UnimplementedGenericServiceServer) DoCommand(context.Context, *DoCommandRequest) (*DoCommandResponse, 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.