Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterStreamerService(s grpc.ServiceRegistrar, srv *StreamerService)
- type Data
- func (*Data) Descriptor() ([]byte, []int)deprecated
- func (x *Data) GetChannels() int64
- func (x *Data) GetData() []byte
- func (x *Data) GetFilename() string
- func (x *Data) GetRate() int64
- func (x *Data) GetSequence() int32
- func (*Data) ProtoMessage()
- func (x *Data) ProtoReflect() protoreflect.Message
- func (x *Data) Reset()
- func (x *Data) String() string
- type StreamServer
- type StreamerClient
- type StreamerService
- type Streamer_AudioClient
- type Streamer_AudioServer
- type UnstableStreamerService
Constants ¶
const ( ADDR string = "localhost" PORT int = 4000 )
Variables ¶
var File_stream_proto protoreflect.FileDescriptor
Functions ¶
func RegisterStreamerService ¶
func RegisterStreamerService(s grpc.ServiceRegistrar, srv *StreamerService)
RegisterStreamerService registers a service implementation with a gRPC server.
Types ¶
type Data ¶
type Data struct { Sequence int32 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"` Rate int64 `protobuf:"varint,3,opt,name=rate,proto3" json:"rate,omitempty"` Channels int64 `protobuf:"varint,4,opt,name=channels,proto3" json:"channels,omitempty"` Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*Data) Descriptor
deprecated
func (*Data) GetChannels ¶
func (*Data) GetFilename ¶
func (*Data) GetSequence ¶
func (*Data) ProtoMessage ¶
func (*Data) ProtoMessage()
func (*Data) ProtoReflect ¶
func (x *Data) ProtoReflect() protoreflect.Message
type StreamServer ¶
type StreamServer struct{}
func (*StreamServer) Audio ¶
func (s *StreamServer) Audio(empty *emptypb.Empty, a Streamer_AudioServer) error
type StreamerClient ¶
type StreamerClient interface {
Audio(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Streamer_AudioClient, error)
}
StreamerClient is the client API for Streamer 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.
func NewStreamerClient ¶
func NewStreamerClient(cc grpc.ClientConnInterface) StreamerClient
type StreamerService ¶
type StreamerService struct {
Audio func(*emptypb.Empty, Streamer_AudioServer) error
}
StreamerService is the service API for Streamer service. Fields should be assigned to their respective handler implementations only before RegisterStreamerService is called. Any unassigned fields will result in the handler for that method returning an Unimplemented error.
func NewServer ¶
func NewServer() *StreamerService
func NewStreamerService ¶
func NewStreamerService(s interface{}) *StreamerService
NewStreamerService creates a new StreamerService containing the implemented methods of the Streamer service in s. Any unimplemented methods will result in the gRPC server returning an UNIMPLEMENTED status to the client. This includes situations where the method handler is misspelled or has the wrong signature. For this reason, this function should be used with great care and is not recommended to be used by most users.
type Streamer_AudioClient ¶
type Streamer_AudioClient interface { Recv() (*Data, error) grpc.ClientStream }
type Streamer_AudioServer ¶
type Streamer_AudioServer interface { Send(*Data) error grpc.ServerStream }
type UnstableStreamerService ¶
type UnstableStreamerService interface {
Audio(*emptypb.Empty, Streamer_AudioServer) error
}
UnstableStreamerService is the service API for Streamer service. New methods may be added to this interface if they are added to the service definition, which is not a backward-compatible change. For this reason, use of this type is not recommended.