Documentation
¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterSwitchServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSwitchServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SwitchServiceClient) error
- func RegisterSwitchServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSwitchServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SwitchServiceServer) error
- func RegisterSwitchServiceServer(s grpc.ServiceRegistrar, srv SwitchServiceServer)
- type GetNumberOfPositionsRequest
- func (*GetNumberOfPositionsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetNumberOfPositionsRequest) GetExtra() *structpb.Struct
- func (x *GetNumberOfPositionsRequest) GetName() string
- func (*GetNumberOfPositionsRequest) ProtoMessage()
- func (x *GetNumberOfPositionsRequest) ProtoReflect() protoreflect.Message
- func (x *GetNumberOfPositionsRequest) Reset()
- func (x *GetNumberOfPositionsRequest) String() string
- type GetNumberOfPositionsResponse
- func (*GetNumberOfPositionsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetNumberOfPositionsResponse) GetNumberOfPositions() uint32
- func (*GetNumberOfPositionsResponse) ProtoMessage()
- func (x *GetNumberOfPositionsResponse) ProtoReflect() protoreflect.Message
- func (x *GetNumberOfPositionsResponse) Reset()
- func (x *GetNumberOfPositionsResponse) String() string
- type GetPositionRequest
- func (*GetPositionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetPositionRequest) GetExtra() *structpb.Struct
- func (x *GetPositionRequest) GetName() string
- func (*GetPositionRequest) ProtoMessage()
- func (x *GetPositionRequest) ProtoReflect() protoreflect.Message
- func (x *GetPositionRequest) Reset()
- func (x *GetPositionRequest) String() string
- type GetPositionResponse
- func (*GetPositionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetPositionResponse) GetPosition() uint32
- func (*GetPositionResponse) ProtoMessage()
- func (x *GetPositionResponse) ProtoReflect() protoreflect.Message
- func (x *GetPositionResponse) Reset()
- func (x *GetPositionResponse) String() string
- type SetPositionRequest
- func (*SetPositionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SetPositionRequest) GetExtra() *structpb.Struct
- func (x *SetPositionRequest) GetName() string
- func (x *SetPositionRequest) GetPosition() uint32
- func (*SetPositionRequest) ProtoMessage()
- func (x *SetPositionRequest) ProtoReflect() protoreflect.Message
- func (x *SetPositionRequest) Reset()
- func (x *SetPositionRequest) String() string
- type SetPositionResponse
- type SwitchServiceClient
- type SwitchServiceServer
- type UnimplementedSwitchServiceServer
- func (UnimplementedSwitchServiceServer) DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
- func (UnimplementedSwitchServiceServer) GetNumberOfPositions(context.Context, *GetNumberOfPositionsRequest) (*GetNumberOfPositionsResponse, error)
- func (UnimplementedSwitchServiceServer) GetPosition(context.Context, *GetPositionRequest) (*GetPositionResponse, error)
- func (UnimplementedSwitchServiceServer) SetPosition(context.Context, *SetPositionRequest) (*SetPositionResponse, error)
- type UnsafeSwitchServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_component_switch_v1_switch_proto protoreflect.FileDescriptor
var SwitchService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "viam.component.switch.v1.SwitchService", HandlerType: (*SwitchServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SetPosition", Handler: _SwitchService_SetPosition_Handler, }, { MethodName: "GetPosition", Handler: _SwitchService_GetPosition_Handler, }, { MethodName: "GetNumberOfPositions", Handler: _SwitchService_GetNumberOfPositions_Handler, }, { MethodName: "DoCommand", Handler: _SwitchService_DoCommand_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "component/switch/v1/switch.proto", }
SwitchService_ServiceDesc is the grpc.ServiceDesc for SwitchService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSwitchServiceHandler ¶
func RegisterSwitchServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSwitchServiceHandler registers the http handlers for service SwitchService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSwitchServiceHandlerClient ¶
func RegisterSwitchServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SwitchServiceClient) error
RegisterSwitchServiceHandlerClient registers the http handlers for service SwitchService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SwitchServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SwitchServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SwitchServiceClient" to call the correct interceptors.
func RegisterSwitchServiceHandlerFromEndpoint ¶
func RegisterSwitchServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSwitchServiceHandlerFromEndpoint is same as RegisterSwitchServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSwitchServiceHandlerServer ¶
func RegisterSwitchServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SwitchServiceServer) error
RegisterSwitchServiceHandlerServer registers the http handlers for service SwitchService to "mux". UnaryRPC :call SwitchServiceServer 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 RegisterSwitchServiceHandlerFromEndpoint instead.
func RegisterSwitchServiceServer ¶
func RegisterSwitchServiceServer(s grpc.ServiceRegistrar, srv SwitchServiceServer)
Types ¶
type GetNumberOfPositionsRequest ¶
type GetNumberOfPositionsRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"` // contains filtered or unexported fields }
func (*GetNumberOfPositionsRequest) Descriptor
deprecated
func (*GetNumberOfPositionsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetNumberOfPositionsRequest.ProtoReflect.Descriptor instead.
func (*GetNumberOfPositionsRequest) GetExtra ¶
func (x *GetNumberOfPositionsRequest) GetExtra() *structpb.Struct
func (*GetNumberOfPositionsRequest) GetName ¶
func (x *GetNumberOfPositionsRequest) GetName() string
func (*GetNumberOfPositionsRequest) ProtoMessage ¶
func (*GetNumberOfPositionsRequest) ProtoMessage()
func (*GetNumberOfPositionsRequest) ProtoReflect ¶
func (x *GetNumberOfPositionsRequest) ProtoReflect() protoreflect.Message
func (*GetNumberOfPositionsRequest) Reset ¶
func (x *GetNumberOfPositionsRequest) Reset()
func (*GetNumberOfPositionsRequest) String ¶
func (x *GetNumberOfPositionsRequest) String() string
type GetNumberOfPositionsResponse ¶
type GetNumberOfPositionsResponse struct { NumberOfPositions uint32 `protobuf:"varint,1,opt,name=number_of_positions,json=numberOfPositions,proto3" json:"number_of_positions,omitempty"` // contains filtered or unexported fields }
func (*GetNumberOfPositionsResponse) Descriptor
deprecated
func (*GetNumberOfPositionsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetNumberOfPositionsResponse.ProtoReflect.Descriptor instead.
func (*GetNumberOfPositionsResponse) GetNumberOfPositions ¶
func (x *GetNumberOfPositionsResponse) GetNumberOfPositions() uint32
func (*GetNumberOfPositionsResponse) ProtoMessage ¶
func (*GetNumberOfPositionsResponse) ProtoMessage()
func (*GetNumberOfPositionsResponse) ProtoReflect ¶
func (x *GetNumberOfPositionsResponse) ProtoReflect() protoreflect.Message
func (*GetNumberOfPositionsResponse) Reset ¶
func (x *GetNumberOfPositionsResponse) Reset()
func (*GetNumberOfPositionsResponse) String ¶
func (x *GetNumberOfPositionsResponse) String() string
type GetPositionRequest ¶
type GetPositionRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"` // contains filtered or unexported fields }
func (*GetPositionRequest) Descriptor
deprecated
func (*GetPositionRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPositionRequest.ProtoReflect.Descriptor instead.
func (*GetPositionRequest) GetExtra ¶
func (x *GetPositionRequest) GetExtra() *structpb.Struct
func (*GetPositionRequest) GetName ¶
func (x *GetPositionRequest) GetName() string
func (*GetPositionRequest) ProtoMessage ¶
func (*GetPositionRequest) ProtoMessage()
func (*GetPositionRequest) ProtoReflect ¶
func (x *GetPositionRequest) ProtoReflect() protoreflect.Message
func (*GetPositionRequest) Reset ¶
func (x *GetPositionRequest) Reset()
func (*GetPositionRequest) String ¶
func (x *GetPositionRequest) String() string
type GetPositionResponse ¶
type GetPositionResponse struct { Position uint32 `protobuf:"varint,1,opt,name=position,proto3" json:"position,omitempty"` // contains filtered or unexported fields }
func (*GetPositionResponse) Descriptor
deprecated
func (*GetPositionResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPositionResponse.ProtoReflect.Descriptor instead.
func (*GetPositionResponse) GetPosition ¶
func (x *GetPositionResponse) GetPosition() uint32
func (*GetPositionResponse) ProtoMessage ¶
func (*GetPositionResponse) ProtoMessage()
func (*GetPositionResponse) ProtoReflect ¶
func (x *GetPositionResponse) ProtoReflect() protoreflect.Message
func (*GetPositionResponse) Reset ¶
func (x *GetPositionResponse) Reset()
func (*GetPositionResponse) String ¶
func (x *GetPositionResponse) String() string
type SetPositionRequest ¶
type SetPositionRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Position uint32 `protobuf:"varint,2,opt,name=position,proto3" json:"position,omitempty"` Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"` // contains filtered or unexported fields }
func (*SetPositionRequest) Descriptor
deprecated
func (*SetPositionRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetPositionRequest.ProtoReflect.Descriptor instead.
func (*SetPositionRequest) GetExtra ¶
func (x *SetPositionRequest) GetExtra() *structpb.Struct
func (*SetPositionRequest) GetName ¶
func (x *SetPositionRequest) GetName() string
func (*SetPositionRequest) GetPosition ¶
func (x *SetPositionRequest) GetPosition() uint32
func (*SetPositionRequest) ProtoMessage ¶
func (*SetPositionRequest) ProtoMessage()
func (*SetPositionRequest) ProtoReflect ¶
func (x *SetPositionRequest) ProtoReflect() protoreflect.Message
func (*SetPositionRequest) Reset ¶
func (x *SetPositionRequest) Reset()
func (*SetPositionRequest) String ¶
func (x *SetPositionRequest) String() string
type SetPositionResponse ¶
type SetPositionResponse struct {
// contains filtered or unexported fields
}
func (*SetPositionResponse) Descriptor
deprecated
func (*SetPositionResponse) Descriptor() ([]byte, []int)
Deprecated: Use SetPositionResponse.ProtoReflect.Descriptor instead.
func (*SetPositionResponse) ProtoMessage ¶
func (*SetPositionResponse) ProtoMessage()
func (*SetPositionResponse) ProtoReflect ¶
func (x *SetPositionResponse) ProtoReflect() protoreflect.Message
func (*SetPositionResponse) Reset ¶
func (x *SetPositionResponse) Reset()
func (*SetPositionResponse) String ¶
func (x *SetPositionResponse) String() string
type SwitchServiceClient ¶
type SwitchServiceClient interface { // Set the position of the switch SetPosition(ctx context.Context, in *SetPositionRequest, opts ...grpc.CallOption) (*SetPositionResponse, error) // Get the position of the switch GetPosition(ctx context.Context, in *GetPositionRequest, opts ...grpc.CallOption) (*GetPositionResponse, error) // Get the number of positions that the switch supports GetNumberOfPositions(ctx context.Context, in *GetNumberOfPositionsRequest, opts ...grpc.CallOption) (*GetNumberOfPositionsResponse, error) // DoCommand sends/receives arbitrary commands DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error) }
SwitchServiceClient is the client API for SwitchService 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 NewSwitchServiceClient ¶
func NewSwitchServiceClient(cc grpc.ClientConnInterface) SwitchServiceClient
type SwitchServiceServer ¶
type SwitchServiceServer interface { // Set the position of the switch SetPosition(context.Context, *SetPositionRequest) (*SetPositionResponse, error) // Get the position of the switch GetPosition(context.Context, *GetPositionRequest) (*GetPositionResponse, error) // Get the number of positions that the switch supports GetNumberOfPositions(context.Context, *GetNumberOfPositionsRequest) (*GetNumberOfPositionsResponse, error) // DoCommand sends/receives arbitrary commands DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error) // contains filtered or unexported methods }
SwitchServiceServer is the server API for SwitchService service. All implementations must embed UnimplementedSwitchServiceServer for forward compatibility
type UnimplementedSwitchServiceServer ¶
type UnimplementedSwitchServiceServer struct { }
UnimplementedSwitchServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedSwitchServiceServer) DoCommand ¶
func (UnimplementedSwitchServiceServer) DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
func (UnimplementedSwitchServiceServer) GetNumberOfPositions ¶
func (UnimplementedSwitchServiceServer) GetNumberOfPositions(context.Context, *GetNumberOfPositionsRequest) (*GetNumberOfPositionsResponse, error)
func (UnimplementedSwitchServiceServer) GetPosition ¶
func (UnimplementedSwitchServiceServer) GetPosition(context.Context, *GetPositionRequest) (*GetPositionResponse, error)
func (UnimplementedSwitchServiceServer) SetPosition ¶
func (UnimplementedSwitchServiceServer) SetPosition(context.Context, *SetPositionRequest) (*SetPositionResponse, error)
type UnsafeSwitchServiceServer ¶
type UnsafeSwitchServiceServer interface {
// contains filtered or unexported methods
}
UnsafeSwitchServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SwitchServiceServer will result in compilation errors.