twomicpb

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: 0BSD Imports: 16 Imported by: 0

Documentation

Overview

Package twomicpb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var File_proto_two_mic_two_mic_proto protoreflect.FileDescriptor

Functions

func RegisterTwoMicHandler

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

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) Descriptor() ([]byte, []int)

Deprecated: Use ErrorInfo.ProtoReflect.Descriptor instead.

func (*ErrorInfo) GetCode

func (x *ErrorInfo) GetCode() string

func (*ErrorInfo) GetInfo

func (x *ErrorInfo) GetInfo() string

func (*ErrorInfo) ProtoMessage

func (*ErrorInfo) ProtoMessage()

func (*ErrorInfo) ProtoReflect added in v1.0.3

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

func (*ErrorInfo) Reset

func (x *ErrorInfo) Reset()

func (*ErrorInfo) String

func (x *ErrorInfo) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Iat.ProtoReflect.Descriptor instead.

func (*Iat) GetId

func (x *Iat) GetId() string

func (*Iat) GetSentenceComplete

func (x *Iat) GetSentenceComplete() bool

func (*Iat) GetText

func (x *Iat) GetText() string

func (*Iat) ProtoMessage

func (*Iat) ProtoMessage()

func (*Iat) ProtoReflect added in v1.0.3

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

func (*Iat) Reset

func (x *Iat) Reset()

func (*Iat) String

func (x *Iat) String() string

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 (*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 (*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 (*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) Enum added in v1.0.3

func (TwoMicSpeechEvent) EnumDescriptor deprecated

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

Deprecated: Use TwoMicSpeechEvent.Descriptor instead.

func (TwoMicSpeechEvent) Number added in v1.0.3

func (TwoMicSpeechEvent) String

func (x TwoMicSpeechEvent) String() string

func (TwoMicSpeechEvent) Type added in v1.0.3

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

Jump to

Keyboard shortcuts

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