v1

package
v0.1.295 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

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 (
	SampleFormat_name = map[int32]string{
		0: "SAMPLE_FORMAT_UNSPECIFIED",
		1: "SAMPLE_FORMAT_INT16_INTERLEAVED",
		2: "SAMPLE_FORMAT_FLOAT32_INTERLEAVED",
	}
	SampleFormat_value = map[string]int32{
		"SAMPLE_FORMAT_UNSPECIFIED":         0,
		"SAMPLE_FORMAT_INT16_INTERLEAVED":   1,
		"SAMPLE_FORMAT_FLOAT32_INTERLEAVED": 2,
	}
)

Enum value maps for SampleFormat.

View Source
var AudioInputService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.component.audioinput.v1.AudioInputService",
	HandlerType: (*AudioInputServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Properties",
			Handler:    _AudioInputService_Properties_Handler,
		},
		{
			MethodName: "Record",
			Handler:    _AudioInputService_Record_Handler,
		},
		{
			MethodName: "DoCommand",
			Handler:    _AudioInputService_DoCommand_Handler,
		},
		{
			MethodName: "GetGeometries",
			Handler:    _AudioInputService_GetGeometries_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Chunks",
			Handler:       _AudioInputService_Chunks_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "component/audioinput/v1/audioinput.proto",
}

AudioInputService_ServiceDesc is the grpc.ServiceDesc for AudioInputService 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_component_audioinput_v1_audioinput_proto protoreflect.FileDescriptor

Functions

func RegisterAudioInputServiceHandler

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

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

func RegisterAudioInputServiceHandlerClient

func RegisterAudioInputServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AudioInputServiceClient) error

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

func RegisterAudioInputServiceHandlerFromEndpoint

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

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

func RegisterAudioInputServiceHandlerServer

func RegisterAudioInputServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AudioInputServiceServer) error

RegisterAudioInputServiceHandlerServer registers the http handlers for service AudioInputService to "mux". UnaryRPC :call AudioInputServiceServer 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 RegisterAudioInputServiceHandlerFromEndpoint instead.

func RegisterAudioInputServiceServer

func RegisterAudioInputServiceServer(s grpc.ServiceRegistrar, srv AudioInputServiceServer)

Types

type AudioChunk

type AudioChunk struct {

	// Data is PCM data that is organized according to the sample format
	// along with its possible interleaving. Data in each format is
	// Little Endian.
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// Length is the number of samples
	Length uint32 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"`
	// contains filtered or unexported fields
}

func (*AudioChunk) Descriptor deprecated

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

Deprecated: Use AudioChunk.ProtoReflect.Descriptor instead.

func (*AudioChunk) GetData

func (x *AudioChunk) GetData() []byte

func (*AudioChunk) GetLength

func (x *AudioChunk) GetLength() uint32

func (*AudioChunk) ProtoMessage

func (*AudioChunk) ProtoMessage()

func (*AudioChunk) ProtoReflect

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

func (*AudioChunk) Reset

func (x *AudioChunk) Reset()

func (*AudioChunk) String

func (x *AudioChunk) String() string

type AudioChunkInfo

type AudioChunkInfo struct {

	// Actual sample encoding format of the response
	SampleFormat SampleFormat `` /* 145-byte string literal not displayed */
	Channels     uint32       `protobuf:"varint,2,opt,name=channels,proto3" json:"channels,omitempty"`
	SamplingRate int64        `protobuf:"varint,3,opt,name=sampling_rate,json=samplingRate,proto3" json:"sampling_rate,omitempty"`
	// contains filtered or unexported fields
}

func (*AudioChunkInfo) Descriptor deprecated

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

Deprecated: Use AudioChunkInfo.ProtoReflect.Descriptor instead.

func (*AudioChunkInfo) GetChannels

func (x *AudioChunkInfo) GetChannels() uint32

func (*AudioChunkInfo) GetSampleFormat

func (x *AudioChunkInfo) GetSampleFormat() SampleFormat

func (*AudioChunkInfo) GetSamplingRate

func (x *AudioChunkInfo) GetSamplingRate() int64

func (*AudioChunkInfo) ProtoMessage

func (*AudioChunkInfo) ProtoMessage()

func (*AudioChunkInfo) ProtoReflect

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

func (*AudioChunkInfo) Reset

func (x *AudioChunkInfo) Reset()

func (*AudioChunkInfo) String

func (x *AudioChunkInfo) String() string

type AudioInputServiceClient

type AudioInputServiceClient interface {
	// Chunks returns audio chunks forever from an audio input of the underlying robot.
	Chunks(ctx context.Context, in *ChunksRequest, opts ...grpc.CallOption) (AudioInputService_ChunksClient, error)
	// Properties returns properties of an audio input of the underlying robot.
	Properties(ctx context.Context, in *PropertiesRequest, opts ...grpc.CallOption) (*PropertiesResponse, error)
	// Record records audio from an audio input of the underlying robot
	// to an HTTP response. A specific MIME type cannot be requested and may not necessarily
	// be the same one returned each time.
	Record(ctx context.Context, in *RecordRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error)
	// GetGeometries returns the geometries of the component in their current configuration
	GetGeometries(ctx context.Context, in *v1.GetGeometriesRequest, opts ...grpc.CallOption) (*v1.GetGeometriesResponse, error)
}

AudioInputServiceClient is the client API for AudioInputService 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 AudioInputServiceServer

type AudioInputServiceServer interface {
	// Chunks returns audio chunks forever from an audio input of the underlying robot.
	Chunks(*ChunksRequest, AudioInputService_ChunksServer) error
	// Properties returns properties of an audio input of the underlying robot.
	Properties(context.Context, *PropertiesRequest) (*PropertiesResponse, error)
	// Record records audio from an audio input of the underlying robot
	// to an HTTP response. A specific MIME type cannot be requested and may not necessarily
	// be the same one returned each time.
	Record(context.Context, *RecordRequest) (*httpbody.HttpBody, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
	// GetGeometries returns the geometries of the component in their current configuration
	GetGeometries(context.Context, *v1.GetGeometriesRequest) (*v1.GetGeometriesResponse, error)
	// contains filtered or unexported methods
}

AudioInputServiceServer is the server API for AudioInputService service. All implementations must embed UnimplementedAudioInputServiceServer for forward compatibility

type AudioInputService_ChunksClient

type AudioInputService_ChunksClient interface {
	Recv() (*ChunksResponse, error)
	grpc.ClientStream
}

type AudioInputService_ChunksServer

type AudioInputService_ChunksServer interface {
	Send(*ChunksResponse) error
	grpc.ServerStream
}

type ChunksRequest

type ChunksRequest struct {

	// Name of an audio input
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Requested sample encoding format of the response
	SampleFormat SampleFormat `` /* 145-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ChunksRequest) Descriptor deprecated

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

Deprecated: Use ChunksRequest.ProtoReflect.Descriptor instead.

func (*ChunksRequest) GetName

func (x *ChunksRequest) GetName() string

func (*ChunksRequest) GetSampleFormat

func (x *ChunksRequest) GetSampleFormat() SampleFormat

func (*ChunksRequest) ProtoMessage

func (*ChunksRequest) ProtoMessage()

func (*ChunksRequest) ProtoReflect

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

func (*ChunksRequest) Reset

func (x *ChunksRequest) Reset()

func (*ChunksRequest) String

func (x *ChunksRequest) String() string

type ChunksResponse

type ChunksResponse struct {

	// Types that are assignable to Type:
	//
	//	*ChunksResponse_Info
	//	*ChunksResponse_Chunk
	Type isChunksResponse_Type `protobuf_oneof:"type"`
	// contains filtered or unexported fields
}

func (*ChunksResponse) Descriptor deprecated

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

Deprecated: Use ChunksResponse.ProtoReflect.Descriptor instead.

func (*ChunksResponse) GetChunk

func (x *ChunksResponse) GetChunk() *AudioChunk

func (*ChunksResponse) GetInfo

func (x *ChunksResponse) GetInfo() *AudioChunkInfo

func (*ChunksResponse) GetType

func (m *ChunksResponse) GetType() isChunksResponse_Type

func (*ChunksResponse) ProtoMessage

func (*ChunksResponse) ProtoMessage()

func (*ChunksResponse) ProtoReflect

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

func (*ChunksResponse) Reset

func (x *ChunksResponse) Reset()

func (*ChunksResponse) String

func (x *ChunksResponse) String() string

type ChunksResponse_Chunk

type ChunksResponse_Chunk struct {
	Chunk *AudioChunk `protobuf:"bytes,2,opt,name=chunk,proto3,oneof"`
}

type ChunksResponse_Info

type ChunksResponse_Info struct {
	Info *AudioChunkInfo `protobuf:"bytes,1,opt,name=info,proto3,oneof"`
}

type PropertiesRequest

type PropertiesRequest struct {

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

func (*PropertiesRequest) Descriptor deprecated

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

Deprecated: Use PropertiesRequest.ProtoReflect.Descriptor instead.

func (*PropertiesRequest) GetName

func (x *PropertiesRequest) GetName() string

func (*PropertiesRequest) ProtoMessage

func (*PropertiesRequest) ProtoMessage()

func (*PropertiesRequest) ProtoReflect

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

func (*PropertiesRequest) Reset

func (x *PropertiesRequest) Reset()

func (*PropertiesRequest) String

func (x *PropertiesRequest) String() string

type PropertiesResponse

type PropertiesResponse struct {
	ChannelCount  uint32               `protobuf:"varint,1,opt,name=channel_count,json=channelCount,proto3" json:"channel_count,omitempty"`
	Latency       *durationpb.Duration `protobuf:"bytes,2,opt,name=latency,proto3" json:"latency,omitempty"`
	SampleRate    uint32               `protobuf:"varint,3,opt,name=sample_rate,json=sampleRate,proto3" json:"sample_rate,omitempty"`
	SampleSize    uint32               `protobuf:"varint,4,opt,name=sample_size,json=sampleSize,proto3" json:"sample_size,omitempty"`
	IsBigEndian   bool                 `protobuf:"varint,5,opt,name=is_big_endian,json=isBigEndian,proto3" json:"is_big_endian,omitempty"`
	IsFloat       bool                 `protobuf:"varint,6,opt,name=is_float,json=isFloat,proto3" json:"is_float,omitempty"`
	IsInterleaved bool                 `protobuf:"varint,7,opt,name=is_interleaved,json=isInterleaved,proto3" json:"is_interleaved,omitempty"`
	// contains filtered or unexported fields
}

func (*PropertiesResponse) Descriptor deprecated

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

Deprecated: Use PropertiesResponse.ProtoReflect.Descriptor instead.

func (*PropertiesResponse) GetChannelCount

func (x *PropertiesResponse) GetChannelCount() uint32

func (*PropertiesResponse) GetIsBigEndian

func (x *PropertiesResponse) GetIsBigEndian() bool

func (*PropertiesResponse) GetIsFloat

func (x *PropertiesResponse) GetIsFloat() bool

func (*PropertiesResponse) GetIsInterleaved

func (x *PropertiesResponse) GetIsInterleaved() bool

func (*PropertiesResponse) GetLatency

func (x *PropertiesResponse) GetLatency() *durationpb.Duration

func (*PropertiesResponse) GetSampleRate

func (x *PropertiesResponse) GetSampleRate() uint32

func (*PropertiesResponse) GetSampleSize

func (x *PropertiesResponse) GetSampleSize() uint32

func (*PropertiesResponse) ProtoMessage

func (*PropertiesResponse) ProtoMessage()

func (*PropertiesResponse) ProtoReflect

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

func (*PropertiesResponse) Reset

func (x *PropertiesResponse) Reset()

func (*PropertiesResponse) String

func (x *PropertiesResponse) String() string

type RecordRequest

type RecordRequest struct {

	// Name of an audio input
	Name     string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Duration *durationpb.Duration `protobuf:"bytes,2,opt,name=duration,proto3" json:"duration,omitempty"`
	// contains filtered or unexported fields
}

func (*RecordRequest) Descriptor deprecated

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

Deprecated: Use RecordRequest.ProtoReflect.Descriptor instead.

func (*RecordRequest) GetDuration

func (x *RecordRequest) GetDuration() *durationpb.Duration

func (*RecordRequest) GetName

func (x *RecordRequest) GetName() string

func (*RecordRequest) ProtoMessage

func (*RecordRequest) ProtoMessage()

func (*RecordRequest) ProtoReflect

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

func (*RecordRequest) Reset

func (x *RecordRequest) Reset()

func (*RecordRequest) String

func (x *RecordRequest) String() string

type SampleFormat

type SampleFormat int32
const (
	SampleFormat_SAMPLE_FORMAT_UNSPECIFIED         SampleFormat = 0
	SampleFormat_SAMPLE_FORMAT_INT16_INTERLEAVED   SampleFormat = 1
	SampleFormat_SAMPLE_FORMAT_FLOAT32_INTERLEAVED SampleFormat = 2
)

func (SampleFormat) Descriptor

func (SampleFormat) Enum

func (x SampleFormat) Enum() *SampleFormat

func (SampleFormat) EnumDescriptor deprecated

func (SampleFormat) EnumDescriptor() ([]byte, []int)

Deprecated: Use SampleFormat.Descriptor instead.

func (SampleFormat) Number

func (SampleFormat) String

func (x SampleFormat) String() string

func (SampleFormat) Type

type UnimplementedAudioInputServiceServer

type UnimplementedAudioInputServiceServer struct {
}

UnimplementedAudioInputServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAudioInputServiceServer) Chunks

func (UnimplementedAudioInputServiceServer) DoCommand added in v0.1.79

func (UnimplementedAudioInputServiceServer) GetGeometries added in v0.1.129

func (UnimplementedAudioInputServiceServer) Properties

func (UnimplementedAudioInputServiceServer) Record

type UnsafeAudioInputServiceServer

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

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

Jump to

Keyboard shortcuts

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