v1

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: AGPL-3.0 Imports: 17 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_inputcontroller_v1_input_controller_proto protoreflect.FileDescriptor
View Source
var InputControllerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.api.component.inputcontroller.v1.InputControllerService",
	HandlerType: (*InputControllerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetControls",
			Handler:    _InputControllerService_GetControls_Handler,
		},
		{
			MethodName: "GetEvents",
			Handler:    _InputControllerService_GetEvents_Handler,
		},
		{
			MethodName: "TriggerEvent",
			Handler:    _InputControllerService_TriggerEvent_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "StreamEvents",
			Handler:       _InputControllerService_StreamEvents_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "proto/api/component/inputcontroller/v1/input_controller.proto",
}

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

Functions

func RegisterInputControllerServiceHandler

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

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

func RegisterInputControllerServiceHandlerClient

func RegisterInputControllerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InputControllerServiceClient) error

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

func RegisterInputControllerServiceHandlerFromEndpoint

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

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

func RegisterInputControllerServiceHandlerServer

func RegisterInputControllerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InputControllerServiceServer) error

RegisterInputControllerServiceHandlerServer registers the http handlers for service InputControllerService to "mux". UnaryRPC :call InputControllerServiceServer 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 RegisterInputControllerServiceHandlerFromEndpoint instead.

func RegisterInputControllerServiceServer

func RegisterInputControllerServiceServer(s grpc.ServiceRegistrar, srv InputControllerServiceServer)

Types

type Event

type Event struct {

	// Timestamp of event
	Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
	// An event type (eg: ButtonPress, ButtonRelease)
	Event string `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"`
	// A control, can be a button (eg: ButtonSouth) or an axis (eg: AbsoluteX)
	Control string `protobuf:"bytes,3,opt,name=control,proto3" json:"control,omitempty"`
	// 0 or 1 for buttons, -1.0 to +1.0 for axes
	Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetControl

func (x *Event) GetControl() string

func (*Event) GetEvent

func (x *Event) GetEvent() string

func (*Event) GetTime

func (x *Event) GetTime() *timestamppb.Timestamp

func (*Event) GetValue

func (x *Event) GetValue() float64

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

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

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type GetControlsRequest

type GetControlsRequest struct {

	// Name of an input controller
	Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"`
	// contains filtered or unexported fields
}

func (*GetControlsRequest) Descriptor deprecated

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

Deprecated: Use GetControlsRequest.ProtoReflect.Descriptor instead.

func (*GetControlsRequest) GetController

func (x *GetControlsRequest) GetController() string

func (*GetControlsRequest) ProtoMessage

func (*GetControlsRequest) ProtoMessage()

func (*GetControlsRequest) ProtoReflect

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

func (*GetControlsRequest) Reset

func (x *GetControlsRequest) Reset()

func (*GetControlsRequest) String

func (x *GetControlsRequest) String() string

type GetControlsResponse

type GetControlsResponse struct {

	// Returns a list of all the controls (buttons and axes) that are
	// available to a given Input Controller
	Controls []string `protobuf:"bytes,1,rep,name=controls,proto3" json:"controls,omitempty"`
	// contains filtered or unexported fields
}

func (*GetControlsResponse) Descriptor deprecated

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

Deprecated: Use GetControlsResponse.ProtoReflect.Descriptor instead.

func (*GetControlsResponse) GetControls

func (x *GetControlsResponse) GetControls() []string

func (*GetControlsResponse) ProtoMessage

func (*GetControlsResponse) ProtoMessage()

func (*GetControlsResponse) ProtoReflect

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

func (*GetControlsResponse) Reset

func (x *GetControlsResponse) Reset()

func (*GetControlsResponse) String

func (x *GetControlsResponse) String() string

type GetEventsRequest

type GetEventsRequest struct {

	// Name of an input controller
	Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEventsRequest) Descriptor deprecated

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

Deprecated: Use GetEventsRequest.ProtoReflect.Descriptor instead.

func (*GetEventsRequest) GetController

func (x *GetEventsRequest) GetController() string

func (*GetEventsRequest) ProtoMessage

func (*GetEventsRequest) ProtoMessage()

func (*GetEventsRequest) ProtoReflect

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

func (*GetEventsRequest) Reset

func (x *GetEventsRequest) Reset()

func (*GetEventsRequest) String

func (x *GetEventsRequest) String() string

type GetEventsResponse

type GetEventsResponse struct {

	// Returns a list of the most recent event for each control on a given InputController. Effectively provides the current "state" of all
	// buttons/axes on a given input controller
	Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEventsResponse) Descriptor deprecated

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

Deprecated: Use GetEventsResponse.ProtoReflect.Descriptor instead.

func (*GetEventsResponse) GetEvents

func (x *GetEventsResponse) GetEvents() []*Event

func (*GetEventsResponse) ProtoMessage

func (*GetEventsResponse) ProtoMessage()

func (*GetEventsResponse) ProtoReflect

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

func (*GetEventsResponse) Reset

func (x *GetEventsResponse) Reset()

func (*GetEventsResponse) String

func (x *GetEventsResponse) String() string

type InputControllerServiceClient

type InputControllerServiceClient interface {
	// GetControls returns a list of GetControls provided by the Controller
	GetControls(ctx context.Context, in *GetControlsRequest, opts ...grpc.CallOption) (*GetControlsResponse, error)
	// GetEvents returns a list of events representing the last event on each control of a give Input Controller
	GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error)
	// StreamEvents starts a stream of InputControllerEvents for the given controls (buttons/axes) on a robot's input controller
	StreamEvents(ctx context.Context, in *StreamEventsRequest, opts ...grpc.CallOption) (InputControllerService_StreamEventsClient, error)
	// TriggerEvent, where supported, injects an InputControllerEvent into an input controller to (virtually) generate events
	// like button presses or axis movements
	TriggerEvent(ctx context.Context, in *TriggerEventRequest, opts ...grpc.CallOption) (*TriggerEventResponse, error)
}

InputControllerServiceClient is the client API for InputControllerService 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 InputControllerServiceServer

type InputControllerServiceServer interface {
	// GetControls returns a list of GetControls provided by the Controller
	GetControls(context.Context, *GetControlsRequest) (*GetControlsResponse, error)
	// GetEvents returns a list of events representing the last event on each control of a give Input Controller
	GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error)
	// StreamEvents starts a stream of InputControllerEvents for the given controls (buttons/axes) on a robot's input controller
	StreamEvents(*StreamEventsRequest, InputControllerService_StreamEventsServer) error
	// TriggerEvent, where supported, injects an InputControllerEvent into an input controller to (virtually) generate events
	// like button presses or axis movements
	TriggerEvent(context.Context, *TriggerEventRequest) (*TriggerEventResponse, error)
	// contains filtered or unexported methods
}

InputControllerServiceServer is the server API for InputControllerService service. All implementations must embed UnimplementedInputControllerServiceServer for forward compatibility

type InputControllerService_StreamEventsClient

type InputControllerService_StreamEventsClient interface {
	Recv() (*StreamEventsResponse, error)
	grpc.ClientStream
}

type InputControllerService_StreamEventsServer

type InputControllerService_StreamEventsServer interface {
	Send(*StreamEventsResponse) error
	grpc.ServerStream
}

type Status

type Status struct {
	Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*Status) Descriptor deprecated

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

Deprecated: Use Status.ProtoReflect.Descriptor instead.

func (*Status) GetEvents

func (x *Status) GetEvents() []*Event

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) ProtoReflect

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

func (*Status) Reset

func (x *Status) Reset()

func (*Status) String

func (x *Status) String() string

type StreamEventsRequest

type StreamEventsRequest struct {

	// Name of an input controller
	Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"`
	// A list of Events
	Events []*StreamEventsRequest_Events `protobuf:"bytes,2,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamEventsRequest) Descriptor deprecated

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

Deprecated: Use StreamEventsRequest.ProtoReflect.Descriptor instead.

func (*StreamEventsRequest) GetController

func (x *StreamEventsRequest) GetController() string

func (*StreamEventsRequest) GetEvents

func (*StreamEventsRequest) ProtoMessage

func (*StreamEventsRequest) ProtoMessage()

func (*StreamEventsRequest) ProtoReflect

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

func (*StreamEventsRequest) Reset

func (x *StreamEventsRequest) Reset()

func (*StreamEventsRequest) String

func (x *StreamEventsRequest) String() string

type StreamEventsRequest_Events

type StreamEventsRequest_Events struct {

	// Name of a control (button or axis)
	Control string `protobuf:"bytes,1,opt,name=control,proto3" json:"control,omitempty"`
	// Specify which event types to recieve events for
	// To Do (FA): Right now this can be an empty list, but we should error in this case as opening a stream with no messages is expensive
	Events []string `protobuf:"bytes,2,rep,name=events,proto3" json:"events,omitempty"`
	// Specify which event types to stop recieving events for
	// This can be an empty list
	CancelledEvents []string `protobuf:"bytes,3,rep,name=cancelled_events,json=cancelledEvents,proto3" json:"cancelled_events,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamEventsRequest_Events) Descriptor deprecated

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

Deprecated: Use StreamEventsRequest_Events.ProtoReflect.Descriptor instead.

func (*StreamEventsRequest_Events) GetCancelledEvents

func (x *StreamEventsRequest_Events) GetCancelledEvents() []string

func (*StreamEventsRequest_Events) GetControl

func (x *StreamEventsRequest_Events) GetControl() string

func (*StreamEventsRequest_Events) GetEvents

func (x *StreamEventsRequest_Events) GetEvents() []string

func (*StreamEventsRequest_Events) ProtoMessage

func (*StreamEventsRequest_Events) ProtoMessage()

func (*StreamEventsRequest_Events) ProtoReflect

func (*StreamEventsRequest_Events) Reset

func (x *StreamEventsRequest_Events) Reset()

func (*StreamEventsRequest_Events) String

func (x *StreamEventsRequest_Events) String() string

type StreamEventsResponse

type StreamEventsResponse struct {

	// Event for a controller
	Event *Event `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamEventsResponse) Descriptor deprecated

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

Deprecated: Use StreamEventsResponse.ProtoReflect.Descriptor instead.

func (*StreamEventsResponse) GetEvent

func (x *StreamEventsResponse) GetEvent() *Event

func (*StreamEventsResponse) ProtoMessage

func (*StreamEventsResponse) ProtoMessage()

func (*StreamEventsResponse) ProtoReflect

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

func (*StreamEventsResponse) Reset

func (x *StreamEventsResponse) Reset()

func (*StreamEventsResponse) String

func (x *StreamEventsResponse) String() string

type TriggerEventRequest

type TriggerEventRequest struct {

	// Name of an input controller
	Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"`
	// Digitally assert a given event
	Event *Event `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*TriggerEventRequest) Descriptor deprecated

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

Deprecated: Use TriggerEventRequest.ProtoReflect.Descriptor instead.

func (*TriggerEventRequest) GetController

func (x *TriggerEventRequest) GetController() string

func (*TriggerEventRequest) GetEvent

func (x *TriggerEventRequest) GetEvent() *Event

func (*TriggerEventRequest) ProtoMessage

func (*TriggerEventRequest) ProtoMessage()

func (*TriggerEventRequest) ProtoReflect

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

func (*TriggerEventRequest) Reset

func (x *TriggerEventRequest) Reset()

func (*TriggerEventRequest) String

func (x *TriggerEventRequest) String() string

type TriggerEventResponse

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

func (*TriggerEventResponse) Descriptor deprecated

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

Deprecated: Use TriggerEventResponse.ProtoReflect.Descriptor instead.

func (*TriggerEventResponse) ProtoMessage

func (*TriggerEventResponse) ProtoMessage()

func (*TriggerEventResponse) ProtoReflect

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

func (*TriggerEventResponse) Reset

func (x *TriggerEventResponse) Reset()

func (*TriggerEventResponse) String

func (x *TriggerEventResponse) String() string

type UnimplementedInputControllerServiceServer

type UnimplementedInputControllerServiceServer struct {
}

UnimplementedInputControllerServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedInputControllerServiceServer) GetControls

func (UnimplementedInputControllerServiceServer) GetEvents

func (UnimplementedInputControllerServiceServer) TriggerEvent

type UnsafeInputControllerServiceServer

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

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

Jump to

Keyboard shortcuts

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