v1

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT 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 File_proto_rpc_webrtc_v1_grpc_proto protoreflect.FileDescriptor
View Source
var File_proto_rpc_webrtc_v1_signaling_proto protoreflect.FileDescriptor
View Source
var SignalingService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.rpc.webrtc.v1.SignalingService",
	HandlerType: (*SignalingServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Call",
			Handler:    _SignalingService_Call_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Answer",
			Handler:       _SignalingService_Answer_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "proto/rpc/webrtc/v1/signaling.proto",
}

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

Functions

func RegisterSignalingServiceHandler

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

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

func RegisterSignalingServiceHandlerClient

func RegisterSignalingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SignalingServiceClient) error

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

func RegisterSignalingServiceHandlerFromEndpoint

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

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

func RegisterSignalingServiceHandlerServer

func RegisterSignalingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SignalingServiceServer) error

RegisterSignalingServiceHandlerServer registers the http handlers for service SignalingService to "mux". UnaryRPC :call SignalingServiceServer 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 RegisterSignalingServiceHandlerFromEndpoint instead.

func RegisterSignalingServiceServer

func RegisterSignalingServiceServer(s grpc.ServiceRegistrar, srv SignalingServiceServer)

Types

type AnswerRequest

type AnswerRequest struct {
	Sdp string `protobuf:"bytes,1,opt,name=sdp,proto3" json:"sdp,omitempty"`
	// contains filtered or unexported fields
}

AnswerRequest is the SDP offer that the controlling side is making via the answering stream.

func (*AnswerRequest) Descriptor deprecated

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

Deprecated: Use AnswerRequest.ProtoReflect.Descriptor instead.

func (*AnswerRequest) GetSdp

func (x *AnswerRequest) GetSdp() string

func (*AnswerRequest) ProtoMessage

func (*AnswerRequest) ProtoMessage()

func (*AnswerRequest) ProtoReflect

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

func (*AnswerRequest) Reset

func (x *AnswerRequest) Reset()

func (*AnswerRequest) String

func (x *AnswerRequest) String() string

type AnswerResponse

type AnswerResponse struct {
	Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	Sdp    string         `protobuf:"bytes,2,opt,name=sdp,proto3" json:"sdp,omitempty"`
	// contains filtered or unexported fields
}

AnswerResponse is the SDP answer that an answerer responds with.

func (*AnswerResponse) Descriptor deprecated

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

Deprecated: Use AnswerResponse.ProtoReflect.Descriptor instead.

func (*AnswerResponse) GetSdp

func (x *AnswerResponse) GetSdp() string

func (*AnswerResponse) GetStatus

func (x *AnswerResponse) GetStatus() *status.Status

func (*AnswerResponse) ProtoMessage

func (*AnswerResponse) ProtoMessage()

func (*AnswerResponse) ProtoReflect

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

func (*AnswerResponse) Reset

func (x *AnswerResponse) Reset()

func (*AnswerResponse) String

func (x *AnswerResponse) String() string

type CallRequest

type CallRequest struct {
	Sdp string `protobuf:"bytes,1,opt,name=sdp,proto3" json:"sdp,omitempty"`
	// contains filtered or unexported fields
}

CallRequest is the SDP offer that the controlling side is making.

func (*CallRequest) Descriptor deprecated

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

Deprecated: Use CallRequest.ProtoReflect.Descriptor instead.

func (*CallRequest) GetSdp

func (x *CallRequest) GetSdp() string

func (*CallRequest) ProtoMessage

func (*CallRequest) ProtoMessage()

func (*CallRequest) ProtoReflect

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

func (*CallRequest) Reset

func (x *CallRequest) Reset()

func (*CallRequest) String

func (x *CallRequest) String() string

type CallResponse

type CallResponse struct {
	Sdp string `protobuf:"bytes,1,opt,name=sdp,proto3" json:"sdp,omitempty"`
	// contains filtered or unexported fields
}

CallResponse is the SDP answer that the controlled side responds with.

func (*CallResponse) Descriptor deprecated

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

Deprecated: Use CallResponse.ProtoReflect.Descriptor instead.

func (*CallResponse) GetSdp

func (x *CallResponse) GetSdp() string

func (*CallResponse) ProtoMessage

func (*CallResponse) ProtoMessage()

func (*CallResponse) ProtoReflect

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

func (*CallResponse) Reset

func (x *CallResponse) Reset()

func (*CallResponse) String

func (x *CallResponse) String() string

type Metadata

type Metadata struct {
	Md map[string]*Strings `` /* 145-byte string literal not displayed */
	// contains filtered or unexported fields
}

Metadata is for custom key values provided by a client or server during a stream.

func (*Metadata) Descriptor deprecated

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

Deprecated: Use Metadata.ProtoReflect.Descriptor instead.

func (*Metadata) GetMd

func (x *Metadata) GetMd() map[string]*Strings

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) ProtoReflect

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

func (*Metadata) Reset

func (x *Metadata) Reset()

func (*Metadata) String

func (x *Metadata) String() string

type PacketMessage

type PacketMessage struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Eom  bool   `protobuf:"varint,2,opt,name=eom,proto3" json:"eom,omitempty"`
	// contains filtered or unexported fields
}

A PacketMessage is used to packetize large messages (> 64KiB) to be able to safely transmit over WebRTC data channels.

func (*PacketMessage) Descriptor deprecated

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

Deprecated: Use PacketMessage.ProtoReflect.Descriptor instead.

func (*PacketMessage) GetData

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

func (*PacketMessage) GetEom

func (x *PacketMessage) GetEom() bool

func (*PacketMessage) ProtoMessage

func (*PacketMessage) ProtoMessage()

func (*PacketMessage) ProtoReflect

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

func (*PacketMessage) Reset

func (x *PacketMessage) Reset()

func (*PacketMessage) String

func (x *PacketMessage) String() string

type Request

type Request struct {
	Stream *Stream `protobuf:"bytes,1,opt,name=stream,proto3" json:"stream,omitempty"`
	// Types that are assignable to Type:
	//	*Request_Headers
	//	*Request_Message
	Type isRequest_Type `protobuf_oneof:"type"`
	// contains filtered or unexported fields
}

A Request is a frame coming from a client. It is always associated with a stream where the client assigns the stream identifier. Servers will drop frames where the stream identifier has no association (if a non-header frames are sent).

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetHeaders

func (x *Request) GetHeaders() *RequestHeaders

func (*Request) GetMessage

func (x *Request) GetMessage() *RequestMessage

func (*Request) GetStream

func (x *Request) GetStream() *Stream

func (*Request) GetType

func (m *Request) GetType() isRequest_Type

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type RequestHeaders

type RequestHeaders struct {
	Method   string               `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
	Metadata *Metadata            `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	Timeout  *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// contains filtered or unexported fields
}

RequestHeaders describe the unary or streaming call to make.

func (*RequestHeaders) Descriptor deprecated

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

Deprecated: Use RequestHeaders.ProtoReflect.Descriptor instead.

func (*RequestHeaders) GetMetadata

func (x *RequestHeaders) GetMetadata() *Metadata

func (*RequestHeaders) GetMethod

func (x *RequestHeaders) GetMethod() string

func (*RequestHeaders) GetTimeout

func (x *RequestHeaders) GetTimeout() *durationpb.Duration

func (*RequestHeaders) ProtoMessage

func (*RequestHeaders) ProtoMessage()

func (*RequestHeaders) ProtoReflect

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

func (*RequestHeaders) Reset

func (x *RequestHeaders) Reset()

func (*RequestHeaders) String

func (x *RequestHeaders) String() string

type RequestMessage

type RequestMessage struct {
	HasMessage    bool           `protobuf:"varint,1,opt,name=has_message,json=hasMessage,proto3" json:"has_message,omitempty"`
	PacketMessage *PacketMessage `protobuf:"bytes,2,opt,name=packet_message,json=packetMessage,proto3" json:"packet_message,omitempty"`
	Eos           bool           `protobuf:"varint,3,opt,name=eos,proto3" json:"eos,omitempty"`
	// contains filtered or unexported fields
}

A RequestMessage contains individual gRPC messages and a potential end-of-stream (EOS) marker.

func (*RequestMessage) Descriptor deprecated

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

Deprecated: Use RequestMessage.ProtoReflect.Descriptor instead.

func (*RequestMessage) GetEos

func (x *RequestMessage) GetEos() bool

func (*RequestMessage) GetHasMessage

func (x *RequestMessage) GetHasMessage() bool

func (*RequestMessage) GetPacketMessage

func (x *RequestMessage) GetPacketMessage() *PacketMessage

func (*RequestMessage) ProtoMessage

func (*RequestMessage) ProtoMessage()

func (*RequestMessage) ProtoReflect

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

func (*RequestMessage) Reset

func (x *RequestMessage) Reset()

func (*RequestMessage) String

func (x *RequestMessage) String() string

type Request_Headers

type Request_Headers struct {
	Headers *RequestHeaders `protobuf:"bytes,2,opt,name=headers,proto3,oneof"`
}

type Request_Message

type Request_Message struct {
	Message *RequestMessage `protobuf:"bytes,3,opt,name=message,proto3,oneof"`
}

type Response

type Response struct {
	Stream *Stream `protobuf:"bytes,1,opt,name=stream,proto3" json:"stream,omitempty"`
	// Types that are assignable to Type:
	//	*Response_Headers
	//	*Response_Message
	//	*Response_Trailers
	Type isResponse_Type `protobuf_oneof:"type"`
	// contains filtered or unexported fields
}

A Response is a frame coming from a server. It is always associated with a stream where the client assigns the stream identifier. Clients will drop frames where the stream identifier has no association.

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetHeaders

func (x *Response) GetHeaders() *ResponseHeaders

func (*Response) GetMessage

func (x *Response) GetMessage() *ResponseMessage

func (*Response) GetStream

func (x *Response) GetStream() *Stream

func (*Response) GetTrailers

func (x *Response) GetTrailers() *ResponseTrailers

func (*Response) GetType

func (m *Response) GetType() isResponse_Type

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type ResponseHeaders

type ResponseHeaders struct {
	Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

ResponseHeaders contain custom metadata that are sent to the client before any message or trailers (unless only trailers are sent).

func (*ResponseHeaders) Descriptor deprecated

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

Deprecated: Use ResponseHeaders.ProtoReflect.Descriptor instead.

func (*ResponseHeaders) GetMetadata

func (x *ResponseHeaders) GetMetadata() *Metadata

func (*ResponseHeaders) ProtoMessage

func (*ResponseHeaders) ProtoMessage()

func (*ResponseHeaders) ProtoReflect

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

func (*ResponseHeaders) Reset

func (x *ResponseHeaders) Reset()

func (*ResponseHeaders) String

func (x *ResponseHeaders) String() string

type ResponseMessage

type ResponseMessage struct {
	PacketMessage *PacketMessage `protobuf:"bytes,1,opt,name=packet_message,json=packetMessage,proto3" json:"packet_message,omitempty"`
	// contains filtered or unexported fields
}

ResponseMessage contains the data of a response to a call.

func (*ResponseMessage) Descriptor deprecated

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

Deprecated: Use ResponseMessage.ProtoReflect.Descriptor instead.

func (*ResponseMessage) GetPacketMessage

func (x *ResponseMessage) GetPacketMessage() *PacketMessage

func (*ResponseMessage) ProtoMessage

func (*ResponseMessage) ProtoMessage()

func (*ResponseMessage) ProtoReflect

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

func (*ResponseMessage) Reset

func (x *ResponseMessage) Reset()

func (*ResponseMessage) String

func (x *ResponseMessage) String() string

type ResponseTrailers

type ResponseTrailers struct {
	Status   *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	Metadata *Metadata      `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

ResponseTrailers contain the status of a response and any custom metadata.

func (*ResponseTrailers) Descriptor deprecated

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

Deprecated: Use ResponseTrailers.ProtoReflect.Descriptor instead.

func (*ResponseTrailers) GetMetadata

func (x *ResponseTrailers) GetMetadata() *Metadata

func (*ResponseTrailers) GetStatus

func (x *ResponseTrailers) GetStatus() *status.Status

func (*ResponseTrailers) ProtoMessage

func (*ResponseTrailers) ProtoMessage()

func (*ResponseTrailers) ProtoReflect

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

func (*ResponseTrailers) Reset

func (x *ResponseTrailers) Reset()

func (*ResponseTrailers) String

func (x *ResponseTrailers) String() string

type Response_Headers

type Response_Headers struct {
	Headers *ResponseHeaders `protobuf:"bytes,2,opt,name=headers,proto3,oneof"`
}

type Response_Message

type Response_Message struct {
	Message *ResponseMessage `protobuf:"bytes,3,opt,name=message,proto3,oneof"`
}

type Response_Trailers

type Response_Trailers struct {
	Trailers *ResponseTrailers `protobuf:"bytes,4,opt,name=trailers,proto3,oneof"`
}

type SignalingServiceClient

type SignalingServiceClient interface {
	// Call makes an offer to a client that it expects an answer to. It is
	// assumed that the service is hosted solely for a specific client. That is,
	// every client has its own signaling service identified by its hostname
	// and in the case of TLS being used, SNI.
	Call(ctx context.Context, in *CallRequest, opts ...grpc.CallOption) (*CallResponse, error)
	// Answer sets up an answering service where the caller answers call offers
	// and responds with answers.
	Answer(ctx context.Context, opts ...grpc.CallOption) (SignalingService_AnswerClient, error)
}

SignalingServiceClient is the client API for SignalingService 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 SignalingServiceServer

type SignalingServiceServer interface {
	// Call makes an offer to a client that it expects an answer to. It is
	// assumed that the service is hosted solely for a specific client. That is,
	// every client has its own signaling service identified by its hostname
	// and in the case of TLS being used, SNI.
	Call(context.Context, *CallRequest) (*CallResponse, error)
	// Answer sets up an answering service where the caller answers call offers
	// and responds with answers.
	Answer(SignalingService_AnswerServer) error
	// contains filtered or unexported methods
}

SignalingServiceServer is the server API for SignalingService service. All implementations must embed UnimplementedSignalingServiceServer for forward compatibility

type SignalingService_AnswerClient

type SignalingService_AnswerClient interface {
	Send(*AnswerResponse) error
	Recv() (*AnswerRequest, error)
	grpc.ClientStream
}

type SignalingService_AnswerServer

type SignalingService_AnswerServer interface {
	Send(*AnswerRequest) error
	Recv() (*AnswerResponse, error)
	grpc.ServerStream
}

type Stream

type Stream struct {
	Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

A Stream represents an instance of a gRPC stream between a client and a server.

func (*Stream) Descriptor deprecated

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

Deprecated: Use Stream.ProtoReflect.Descriptor instead.

func (*Stream) GetId

func (x *Stream) GetId() uint64

func (*Stream) ProtoMessage

func (*Stream) ProtoMessage()

func (*Stream) ProtoReflect

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

func (*Stream) Reset

func (x *Stream) Reset()

func (*Stream) String

func (x *Stream) String() string

type Strings

type Strings struct {
	Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

Strings are a series of values.

func (*Strings) Descriptor deprecated

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

Deprecated: Use Strings.ProtoReflect.Descriptor instead.

func (*Strings) GetValues

func (x *Strings) GetValues() []string

func (*Strings) ProtoMessage

func (*Strings) ProtoMessage()

func (*Strings) ProtoReflect

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

func (*Strings) Reset

func (x *Strings) Reset()

func (*Strings) String

func (x *Strings) String() string

type UnimplementedSignalingServiceServer

type UnimplementedSignalingServiceServer struct {
}

UnimplementedSignalingServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedSignalingServiceServer) Answer

func (UnimplementedSignalingServiceServer) Call

type UnsafeSignalingServiceServer

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

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

Jump to

Keyboard shortcuts

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