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: 18 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 BaseService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.api.component.base.v1.BaseService",
	HandlerType: (*BaseServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "MoveStraight",
			Handler:    _BaseService_MoveStraight_Handler,
		},
		{
			MethodName: "Spin",
			Handler:    _BaseService_Spin_Handler,
		},
		{
			MethodName: "SetPower",
			Handler:    _BaseService_SetPower_Handler,
		},
		{
			MethodName: "SetVelocity",
			Handler:    _BaseService_SetVelocity_Handler,
		},
		{
			MethodName: "Stop",
			Handler:    _BaseService_Stop_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/api/component/base/v1/base.proto",
}

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

View Source
var File_proto_api_component_base_v1_base_proto protoreflect.FileDescriptor

Functions

func RegisterBaseServiceHandler

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

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

func RegisterBaseServiceHandlerClient

func RegisterBaseServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BaseServiceClient) error

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

func RegisterBaseServiceHandlerFromEndpoint

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

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

func RegisterBaseServiceHandlerServer

func RegisterBaseServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BaseServiceServer) error

RegisterBaseServiceHandlerServer registers the http handlers for service BaseService to "mux". UnaryRPC :call BaseServiceServer 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 RegisterBaseServiceHandlerFromEndpoint instead.

func RegisterBaseServiceServer

func RegisterBaseServiceServer(s grpc.ServiceRegistrar, srv BaseServiceServer)

Types

type BaseServiceClient

type BaseServiceClient interface {
	// MoveStraight moves a robot's base in a straight line by a given distance, expressed in millimeters
	// and a given speed, expressed in millimeters per second
	// This method blocks until completed or cancelled
	MoveStraight(ctx context.Context, in *MoveStraightRequest, opts ...grpc.CallOption) (*MoveStraightResponse, error)
	// Spin spins a robot's base by an given angle, expressed in degrees, and a given
	// angular speed, expressed in degrees per second
	// This method blocks until completed or cancelled
	Spin(ctx context.Context, in *SpinRequest, opts ...grpc.CallOption) (*SpinResponse, error)
	// SetPower sets the linear and angular power of a base
	// -1 -> 1 in terms of power for each direction
	SetPower(ctx context.Context, in *SetPowerRequest, opts ...grpc.CallOption) (*SetPowerResponse, error)
	// SetVelocity sets the linear and angular velocity of a base
	SetVelocity(ctx context.Context, in *SetVelocityRequest, opts ...grpc.CallOption) (*SetVelocityResponse, error)
	// Stop stops a robot's base
	Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error)
}

BaseServiceClient is the client API for BaseService 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 BaseServiceServer

type BaseServiceServer interface {
	// MoveStraight moves a robot's base in a straight line by a given distance, expressed in millimeters
	// and a given speed, expressed in millimeters per second
	// This method blocks until completed or cancelled
	MoveStraight(context.Context, *MoveStraightRequest) (*MoveStraightResponse, error)
	// Spin spins a robot's base by an given angle, expressed in degrees, and a given
	// angular speed, expressed in degrees per second
	// This method blocks until completed or cancelled
	Spin(context.Context, *SpinRequest) (*SpinResponse, error)
	// SetPower sets the linear and angular power of a base
	// -1 -> 1 in terms of power for each direction
	SetPower(context.Context, *SetPowerRequest) (*SetPowerResponse, error)
	// SetVelocity sets the linear and angular velocity of a base
	SetVelocity(context.Context, *SetVelocityRequest) (*SetVelocityResponse, error)
	// Stop stops a robot's base
	Stop(context.Context, *StopRequest) (*StopResponse, error)
	// contains filtered or unexported methods
}

BaseServiceServer is the server API for BaseService service. All implementations must embed UnimplementedBaseServiceServer for forward compatibility

type MoveStraightRequest

type MoveStraightRequest struct {

	// Name of a base
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Desired travel distance in millimeters
	DistanceMm int64 `protobuf:"varint,2,opt,name=distance_mm,json=distanceMm,proto3" json:"distance_mm,omitempty"`
	// Desired travel velocity in millimeters/second
	MmPerSec float64 `protobuf:"fixed64,3,opt,name=mm_per_sec,json=mmPerSec,proto3" json:"mm_per_sec,omitempty"`
	// Additional arguments to the method
	Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

func (*MoveStraightRequest) Descriptor deprecated

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

Deprecated: Use MoveStraightRequest.ProtoReflect.Descriptor instead.

func (*MoveStraightRequest) GetDistanceMm

func (x *MoveStraightRequest) GetDistanceMm() int64

func (*MoveStraightRequest) GetExtra

func (x *MoveStraightRequest) GetExtra() *structpb.Struct

func (*MoveStraightRequest) GetMmPerSec

func (x *MoveStraightRequest) GetMmPerSec() float64

func (*MoveStraightRequest) GetName

func (x *MoveStraightRequest) GetName() string

func (*MoveStraightRequest) ProtoMessage

func (*MoveStraightRequest) ProtoMessage()

func (*MoveStraightRequest) ProtoReflect

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

func (*MoveStraightRequest) Reset

func (x *MoveStraightRequest) Reset()

func (*MoveStraightRequest) String

func (x *MoveStraightRequest) String() string

type MoveStraightResponse

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

func (*MoveStraightResponse) Descriptor deprecated

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

Deprecated: Use MoveStraightResponse.ProtoReflect.Descriptor instead.

func (*MoveStraightResponse) ProtoMessage

func (*MoveStraightResponse) ProtoMessage()

func (*MoveStraightResponse) ProtoReflect

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

func (*MoveStraightResponse) Reset

func (x *MoveStraightResponse) Reset()

func (*MoveStraightResponse) String

func (x *MoveStraightResponse) String() string

type SetPowerRequest

type SetPowerRequest struct {

	// Name of a base
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Desired linear power percentage as -1 -> 1
	Linear *v1.Vector3 `protobuf:"bytes,2,opt,name=linear,proto3" json:"linear,omitempty"`
	// Desired angular power percentage % as -1 -> 1
	Angular *v1.Vector3 `protobuf:"bytes,3,opt,name=angular,proto3" json:"angular,omitempty"`
	// Additional arguments to the method
	Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

func (*SetPowerRequest) Descriptor deprecated

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

Deprecated: Use SetPowerRequest.ProtoReflect.Descriptor instead.

func (*SetPowerRequest) GetAngular

func (x *SetPowerRequest) GetAngular() *v1.Vector3

func (*SetPowerRequest) GetExtra

func (x *SetPowerRequest) GetExtra() *structpb.Struct

func (*SetPowerRequest) GetLinear

func (x *SetPowerRequest) GetLinear() *v1.Vector3

func (*SetPowerRequest) GetName

func (x *SetPowerRequest) GetName() string

func (*SetPowerRequest) ProtoMessage

func (*SetPowerRequest) ProtoMessage()

func (*SetPowerRequest) ProtoReflect

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

func (*SetPowerRequest) Reset

func (x *SetPowerRequest) Reset()

func (*SetPowerRequest) String

func (x *SetPowerRequest) String() string

type SetPowerResponse

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

func (*SetPowerResponse) Descriptor deprecated

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

Deprecated: Use SetPowerResponse.ProtoReflect.Descriptor instead.

func (*SetPowerResponse) ProtoMessage

func (*SetPowerResponse) ProtoMessage()

func (*SetPowerResponse) ProtoReflect

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

func (*SetPowerResponse) Reset

func (x *SetPowerResponse) Reset()

func (*SetPowerResponse) String

func (x *SetPowerResponse) String() string

type SetVelocityRequest

type SetVelocityRequest struct {

	// Name of a base
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Desired linear velocity in mm per second
	Linear *v1.Vector3 `protobuf:"bytes,2,opt,name=linear,proto3" json:"linear,omitempty"`
	// Desired angular velocity in degrees per second
	Angular *v1.Vector3 `protobuf:"bytes,3,opt,name=angular,proto3" json:"angular,omitempty"`
	// Additional arguments to the method
	Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

func (*SetVelocityRequest) Descriptor deprecated

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

Deprecated: Use SetVelocityRequest.ProtoReflect.Descriptor instead.

func (*SetVelocityRequest) GetAngular

func (x *SetVelocityRequest) GetAngular() *v1.Vector3

func (*SetVelocityRequest) GetExtra

func (x *SetVelocityRequest) GetExtra() *structpb.Struct

func (*SetVelocityRequest) GetLinear

func (x *SetVelocityRequest) GetLinear() *v1.Vector3

func (*SetVelocityRequest) GetName

func (x *SetVelocityRequest) GetName() string

func (*SetVelocityRequest) ProtoMessage

func (*SetVelocityRequest) ProtoMessage()

func (*SetVelocityRequest) ProtoReflect

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

func (*SetVelocityRequest) Reset

func (x *SetVelocityRequest) Reset()

func (*SetVelocityRequest) String

func (x *SetVelocityRequest) String() string

type SetVelocityResponse

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

func (*SetVelocityResponse) Descriptor deprecated

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

Deprecated: Use SetVelocityResponse.ProtoReflect.Descriptor instead.

func (*SetVelocityResponse) ProtoMessage

func (*SetVelocityResponse) ProtoMessage()

func (*SetVelocityResponse) ProtoReflect

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

func (*SetVelocityResponse) Reset

func (x *SetVelocityResponse) Reset()

func (*SetVelocityResponse) String

func (x *SetVelocityResponse) String() string

type SpinRequest

type SpinRequest struct {

	// Name of a base
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Desired angle
	AngleDeg float64 `protobuf:"fixed64,2,opt,name=angle_deg,json=angleDeg,proto3" json:"angle_deg,omitempty"`
	// Desired angular velocity
	DegsPerSec float64 `protobuf:"fixed64,3,opt,name=degs_per_sec,json=degsPerSec,proto3" json:"degs_per_sec,omitempty"`
	// Additional arguments to the method
	Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

func (*SpinRequest) Descriptor deprecated

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

Deprecated: Use SpinRequest.ProtoReflect.Descriptor instead.

func (*SpinRequest) GetAngleDeg

func (x *SpinRequest) GetAngleDeg() float64

func (*SpinRequest) GetDegsPerSec

func (x *SpinRequest) GetDegsPerSec() float64

func (*SpinRequest) GetExtra

func (x *SpinRequest) GetExtra() *structpb.Struct

func (*SpinRequest) GetName

func (x *SpinRequest) GetName() string

func (*SpinRequest) ProtoMessage

func (*SpinRequest) ProtoMessage()

func (*SpinRequest) ProtoReflect

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

func (*SpinRequest) Reset

func (x *SpinRequest) Reset()

func (*SpinRequest) String

func (x *SpinRequest) String() string

type SpinResponse

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

func (*SpinResponse) Descriptor deprecated

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

Deprecated: Use SpinResponse.ProtoReflect.Descriptor instead.

func (*SpinResponse) ProtoMessage

func (*SpinResponse) ProtoMessage()

func (*SpinResponse) ProtoReflect

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

func (*SpinResponse) Reset

func (x *SpinResponse) Reset()

func (*SpinResponse) String

func (x *SpinResponse) String() string

type StopRequest

type StopRequest struct {

	// Name of a base
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Additional arguments to the method
	Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

func (*StopRequest) Descriptor deprecated

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

Deprecated: Use StopRequest.ProtoReflect.Descriptor instead.

func (*StopRequest) GetExtra

func (x *StopRequest) GetExtra() *structpb.Struct

func (*StopRequest) GetName

func (x *StopRequest) GetName() string

func (*StopRequest) ProtoMessage

func (*StopRequest) ProtoMessage()

func (*StopRequest) ProtoReflect

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

func (*StopRequest) Reset

func (x *StopRequest) Reset()

func (*StopRequest) String

func (x *StopRequest) String() string

type StopResponse

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

func (*StopResponse) Descriptor deprecated

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

Deprecated: Use StopResponse.ProtoReflect.Descriptor instead.

func (*StopResponse) ProtoMessage

func (*StopResponse) ProtoMessage()

func (*StopResponse) ProtoReflect

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

func (*StopResponse) Reset

func (x *StopResponse) Reset()

func (*StopResponse) String

func (x *StopResponse) String() string

type UnimplementedBaseServiceServer

type UnimplementedBaseServiceServer struct {
}

UnimplementedBaseServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedBaseServiceServer) MoveStraight

func (UnimplementedBaseServiceServer) SetPower

func (UnimplementedBaseServiceServer) SetVelocity

func (UnimplementedBaseServiceServer) Spin

func (UnimplementedBaseServiceServer) Stop

type UnsafeBaseServiceServer

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

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

Jump to

Keyboard shortcuts

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