Documentation ¶
Overview ¶
Package twomicpb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterTwoMicHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTwoMicHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TwoMicClient) error
- func RegisterTwoMicHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTwoMicHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TwoMicServer) error
- func RegisterTwoMicServer(s *grpc.Server, srv TwoMicServer)
- type ErrorInfo
- type Iat
- type OnTwoMicSpeechEventRequest
- type OnTwoMicSpeechEventResponse
- func (*OnTwoMicSpeechEventResponse) Descriptor() ([]byte, []int)deprecated
- func (x *OnTwoMicSpeechEventResponse) GetErrorInfo() *ErrorInfo
- func (m *OnTwoMicSpeechEventResponse) GetEventOneof() isOnTwoMicSpeechEventResponse_EventOneof
- func (x *OnTwoMicSpeechEventResponse) GetEventType() TwoMicSpeechEvent
- func (x *OnTwoMicSpeechEventResponse) GetIat1() *Iat
- func (x *OnTwoMicSpeechEventResponse) GetIat2() *Iat
- func (*OnTwoMicSpeechEventResponse) ProtoMessage()
- func (x *OnTwoMicSpeechEventResponse) ProtoReflect() protoreflect.Message
- func (x *OnTwoMicSpeechEventResponse) Reset()
- func (x *OnTwoMicSpeechEventResponse) String() string
- type OnTwoMicSpeechEventResponse_ErrorInfo
- type OnTwoMicSpeechEventResponse_Iat1
- type OnTwoMicSpeechEventResponse_Iat2
- type TwoMicClient
- type TwoMicServer
- type TwoMicSpeechEvent
- func (TwoMicSpeechEvent) Descriptor() protoreflect.EnumDescriptor
- func (x TwoMicSpeechEvent) Enum() *TwoMicSpeechEvent
- func (TwoMicSpeechEvent) EnumDescriptor() ([]byte, []int)deprecated
- func (x TwoMicSpeechEvent) Number() protoreflect.EnumNumber
- func (x TwoMicSpeechEvent) String() string
- func (TwoMicSpeechEvent) Type() protoreflect.EnumType
- type TwoMic_OnTwoMicEventClient
- type TwoMic_OnTwoMicEventServer
- type UnimplementedTwoMicServer
Constants ¶
This section is empty.
Variables ¶
var ( TwoMicSpeechEvent_name = map[int32]string{ 0: "Mic2_UNKNOWN_EVENT", 1: "Mic2_ERROR", 2: "Mic2_IAT1", 3: "Mic2_IAT2", } TwoMicSpeechEvent_value = map[string]int32{ "Mic2_UNKNOWN_EVENT": 0, "Mic2_ERROR": 1, "Mic2_IAT1": 2, "Mic2_IAT2": 3, } )
Enum value maps for TwoMicSpeechEvent.
var File_proto_two_mic_two_mic_proto protoreflect.FileDescriptor
Functions ¶
func RegisterTwoMicHandler ¶
RegisterTwoMicHandler registers the http handlers for service TwoMic to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTwoMicHandlerClient ¶
func RegisterTwoMicHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TwoMicClient) error
RegisterTwoMicHandlerClient registers the http handlers for service TwoMic to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TwoMicClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TwoMicClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TwoMicClient" to call the correct interceptors.
func RegisterTwoMicHandlerFromEndpoint ¶
func RegisterTwoMicHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTwoMicHandlerFromEndpoint is same as RegisterTwoMicHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTwoMicHandlerServer ¶
func RegisterTwoMicHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TwoMicServer) error
RegisterTwoMicHandlerServer registers the http handlers for service TwoMic to "mux". UnaryRPC :call TwoMicServer 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 RegisterTwoMicHandlerFromEndpoint instead.
func RegisterTwoMicServer ¶
func RegisterTwoMicServer(s *grpc.Server, srv TwoMicServer)
Types ¶
type ErrorInfo ¶
type ErrorInfo struct { Info string `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` // 错误描述(设备提供,可为空) Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` // 错误码(设备提供,可为空) // contains filtered or unexported fields }
错误信息
func (*ErrorInfo) Descriptor
deprecated
func (*ErrorInfo) ProtoMessage ¶
func (*ErrorInfo) ProtoMessage()
func (*ErrorInfo) ProtoReflect ¶ added in v1.0.3
func (x *ErrorInfo) ProtoReflect() protoreflect.Message
type Iat ¶
type Iat struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` //当前回话id Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` //音频转文本内容 SentenceComplete bool `protobuf:"varint,3,opt,name=sentence_complete,json=sentenceComplete,proto3" json:"sentence_complete,omitempty"` // 是否为完整句 // contains filtered or unexported fields }
识别结果
func (*Iat) Descriptor
deprecated
func (*Iat) GetSentenceComplete ¶
func (*Iat) ProtoMessage ¶
func (*Iat) ProtoMessage()
func (*Iat) ProtoReflect ¶ added in v1.0.3
func (x *Iat) ProtoReflect() protoreflect.Message
type OnTwoMicSpeechEventRequest ¶
type OnTwoMicSpeechEventRequest struct {
// contains filtered or unexported fields
}
func (*OnTwoMicSpeechEventRequest) Descriptor
deprecated
func (*OnTwoMicSpeechEventRequest) Descriptor() ([]byte, []int)
Deprecated: Use OnTwoMicSpeechEventRequest.ProtoReflect.Descriptor instead.
func (*OnTwoMicSpeechEventRequest) ProtoMessage ¶
func (*OnTwoMicSpeechEventRequest) ProtoMessage()
func (*OnTwoMicSpeechEventRequest) ProtoReflect ¶ added in v1.0.3
func (x *OnTwoMicSpeechEventRequest) ProtoReflect() protoreflect.Message
func (*OnTwoMicSpeechEventRequest) Reset ¶
func (x *OnTwoMicSpeechEventRequest) Reset()
func (*OnTwoMicSpeechEventRequest) String ¶
func (x *OnTwoMicSpeechEventRequest) String() string
type OnTwoMicSpeechEventResponse ¶
type OnTwoMicSpeechEventResponse struct { EventType TwoMicSpeechEvent `protobuf:"varint,1,opt,name=event_type,json=eventType,proto3,enum=twomicpb.TwoMicSpeechEvent" json:"event_type,omitempty"` // Types that are assignable to EventOneof: // *OnTwoMicSpeechEventResponse_ErrorInfo // *OnTwoMicSpeechEventResponse_Iat1 // *OnTwoMicSpeechEventResponse_Iat2 EventOneof isOnTwoMicSpeechEventResponse_EventOneof `protobuf_oneof:"event_oneof"` // contains filtered or unexported fields }
func (*OnTwoMicSpeechEventResponse) Descriptor
deprecated
func (*OnTwoMicSpeechEventResponse) Descriptor() ([]byte, []int)
Deprecated: Use OnTwoMicSpeechEventResponse.ProtoReflect.Descriptor instead.
func (*OnTwoMicSpeechEventResponse) GetErrorInfo ¶
func (x *OnTwoMicSpeechEventResponse) GetErrorInfo() *ErrorInfo
func (*OnTwoMicSpeechEventResponse) GetEventOneof ¶
func (m *OnTwoMicSpeechEventResponse) GetEventOneof() isOnTwoMicSpeechEventResponse_EventOneof
func (*OnTwoMicSpeechEventResponse) GetEventType ¶
func (x *OnTwoMicSpeechEventResponse) GetEventType() TwoMicSpeechEvent
func (*OnTwoMicSpeechEventResponse) GetIat1 ¶
func (x *OnTwoMicSpeechEventResponse) GetIat1() *Iat
func (*OnTwoMicSpeechEventResponse) GetIat2 ¶
func (x *OnTwoMicSpeechEventResponse) GetIat2() *Iat
func (*OnTwoMicSpeechEventResponse) ProtoMessage ¶
func (*OnTwoMicSpeechEventResponse) ProtoMessage()
func (*OnTwoMicSpeechEventResponse) ProtoReflect ¶ added in v1.0.3
func (x *OnTwoMicSpeechEventResponse) ProtoReflect() protoreflect.Message
func (*OnTwoMicSpeechEventResponse) Reset ¶
func (x *OnTwoMicSpeechEventResponse) Reset()
func (*OnTwoMicSpeechEventResponse) String ¶
func (x *OnTwoMicSpeechEventResponse) String() string
type OnTwoMicSpeechEventResponse_ErrorInfo ¶
type OnTwoMicSpeechEventResponse_ErrorInfo struct {
ErrorInfo *ErrorInfo `protobuf:"bytes,2,opt,name=error_info,json=errorInfo,proto3,oneof"` // 错误
}
type OnTwoMicSpeechEventResponse_Iat1 ¶
type OnTwoMicSpeechEventResponse_Iat1 struct {
Iat1 *Iat `protobuf:"bytes,3,opt,name=iat1,proto3,oneof"` // 麦1 asr识别结果
}
type OnTwoMicSpeechEventResponse_Iat2 ¶
type OnTwoMicSpeechEventResponse_Iat2 struct {
Iat2 *Iat `protobuf:"bytes,4,opt,name=iat2,proto3,oneof"` //麦2 asr识别结果
}
type TwoMicClient ¶
type TwoMicClient interface {
OnTwoMicEvent(ctx context.Context, in *OnTwoMicSpeechEventRequest, opts ...grpc.CallOption) (TwoMic_OnTwoMicEventClient, error)
}
TwoMicClient is the client API for TwoMic service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewTwoMicClient ¶
func NewTwoMicClient(cc grpc.ClientConnInterface) TwoMicClient
type TwoMicServer ¶
type TwoMicServer interface {
OnTwoMicEvent(*OnTwoMicSpeechEventRequest, TwoMic_OnTwoMicEventServer) error
}
TwoMicServer is the server API for TwoMic service.
type TwoMicSpeechEvent ¶
type TwoMicSpeechEvent int32
TwoMic事件
const ( TwoMicSpeechEvent_Mic2_UNKNOWN_EVENT TwoMicSpeechEvent = 0 // 零值 TwoMicSpeechEvent_Mic2_ERROR TwoMicSpeechEvent = 1 // 识别错误 TwoMicSpeechEvent_Mic2_IAT1 TwoMicSpeechEvent = 2 //麦1识别结果 TwoMicSpeechEvent_Mic2_IAT2 TwoMicSpeechEvent = 3 //麦2识别结果 )
func (TwoMicSpeechEvent) Descriptor ¶ added in v1.0.3
func (TwoMicSpeechEvent) Descriptor() protoreflect.EnumDescriptor
func (TwoMicSpeechEvent) Enum ¶ added in v1.0.3
func (x TwoMicSpeechEvent) Enum() *TwoMicSpeechEvent
func (TwoMicSpeechEvent) EnumDescriptor
deprecated
func (TwoMicSpeechEvent) EnumDescriptor() ([]byte, []int)
Deprecated: Use TwoMicSpeechEvent.Descriptor instead.
func (TwoMicSpeechEvent) Number ¶ added in v1.0.3
func (x TwoMicSpeechEvent) Number() protoreflect.EnumNumber
func (TwoMicSpeechEvent) String ¶
func (x TwoMicSpeechEvent) String() string
func (TwoMicSpeechEvent) Type ¶ added in v1.0.3
func (TwoMicSpeechEvent) Type() protoreflect.EnumType
type TwoMic_OnTwoMicEventClient ¶
type TwoMic_OnTwoMicEventClient interface { Recv() (*OnTwoMicSpeechEventResponse, error) grpc.ClientStream }
type TwoMic_OnTwoMicEventServer ¶
type TwoMic_OnTwoMicEventServer interface { Send(*OnTwoMicSpeechEventResponse) error grpc.ServerStream }
type UnimplementedTwoMicServer ¶
type UnimplementedTwoMicServer struct { }
UnimplementedTwoMicServer can be embedded to have forward compatible implementations.
func (*UnimplementedTwoMicServer) OnTwoMicEvent ¶
func (*UnimplementedTwoMicServer) OnTwoMicEvent(*OnTwoMicSpeechEventRequest, TwoMic_OnTwoMicEventServer) error