Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterSignalExchangeServer(s grpc.ServiceRegistrar, srv SignalExchangeServer)
- type Body
- func (*Body) Descriptor() ([]byte, []int)deprecated
- func (x *Body) GetISecWayVersion() string
- func (x *Body) GetPayload() string
- func (x *Body) GetType() Body_Type
- func (x *Body) GetWgListenPort() uint32
- func (*Body) ProtoMessage()
- func (x *Body) ProtoReflect() protoreflect.Message
- func (x *Body) Reset()
- func (x *Body) String() string
- type Body_Type
- type EncryptedMessage
- func (*EncryptedMessage) Descriptor() ([]byte, []int)deprecated
- func (x *EncryptedMessage) GetBody() []byte
- func (x *EncryptedMessage) GetKey() string
- func (x *EncryptedMessage) GetRemoteKey() string
- func (*EncryptedMessage) ProtoMessage()
- func (x *EncryptedMessage) ProtoReflect() protoreflect.Message
- func (x *EncryptedMessage) Reset()
- func (x *EncryptedMessage) String() string
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetBody() *Body
- func (x *Message) GetKey() string
- func (x *Message) GetRemoteKey() string
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type SignalExchangeClient
- type SignalExchangeServer
- type SignalExchange_ConnectStreamClient
- type SignalExchange_ConnectStreamServer
- type UnimplementedSignalExchangeServer
- type UnsafeSignalExchangeServer
Constants ¶
const HeaderId = "x-oldsecway-peer-id"
protocol constants, field names that can be used by both client and server
const HeaderRegistered = "x-oldsecway-peer-registered"
Variables ¶
var ( Body_Type_name = map[int32]string{ 0: "OFFER", 1: "ANSWER", 2: "CANDIDATE", } Body_Type_value = map[string]int32{ "OFFER": 0, "ANSWER": 1, "CANDIDATE": 2, } )
Enum value maps for Body_Type.
var File_signalexchange_proto protoreflect.FileDescriptor
var SignalExchange_ServiceDesc = grpc.ServiceDesc{ ServiceName: "signalexchange.SignalExchange", HandlerType: (*SignalExchangeServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Send", Handler: _SignalExchange_Send_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "ConnectStream", Handler: _SignalExchange_ConnectStream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "signalexchange.proto", }
SignalExchange_ServiceDesc is the grpc.ServiceDesc for SignalExchange service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSignalExchangeServer ¶
func RegisterSignalExchangeServer(s grpc.ServiceRegistrar, srv SignalExchangeServer)
Types ¶
type Body ¶
type Body struct { Type Body_Type `protobuf:"varint,1,opt,name=type,proto3,enum=signalexchange.Body_Type" json:"type,omitempty"` Payload string `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // wgListenPort is an actual WireGuard listen port WgListenPort uint32 `protobuf:"varint,3,opt,name=wgListenPort,proto3" json:"wgListenPort,omitempty"` ISecWayVersion string `protobuf:"bytes,4,opt,name=isecWayVersion,proto3" json:"isecWayVersion,omitempty"` // contains filtered or unexported fields }
Actual body of the message that can contain credentials (type OFFER/ANSWER) or connection Candidate This part will be encrypted
func (*Body) Descriptor
deprecated
func (*Body) GetISecWayVersion ¶
func (*Body) GetPayload ¶
func (*Body) GetWgListenPort ¶
func (*Body) ProtoMessage ¶
func (*Body) ProtoMessage()
func (*Body) ProtoReflect ¶
func (x *Body) ProtoReflect() protoreflect.Message
type Body_Type ¶
type Body_Type int32
Message type
func (Body_Type) Descriptor ¶
func (Body_Type) Descriptor() protoreflect.EnumDescriptor
func (Body_Type) EnumDescriptor
deprecated
func (Body_Type) Number ¶
func (x Body_Type) Number() protoreflect.EnumNumber
func (Body_Type) Type ¶
func (Body_Type) Type() protoreflect.EnumType
type EncryptedMessage ¶
type EncryptedMessage struct { // Wireguard public key Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // Wireguard public key of the remote peer to connect to RemoteKey string `protobuf:"bytes,3,opt,name=remoteKey,proto3" json:"remoteKey,omitempty"` // encrypted message Body Body []byte `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
Used for sending through signal. The body of this message is the Body message encrypted with the Wireguard private key and the remote Peer key
func (*EncryptedMessage) Descriptor
deprecated
func (*EncryptedMessage) Descriptor() ([]byte, []int)
Deprecated: Use EncryptedMessage.ProtoReflect.Descriptor instead.
func (*EncryptedMessage) GetBody ¶
func (x *EncryptedMessage) GetBody() []byte
func (*EncryptedMessage) GetKey ¶
func (x *EncryptedMessage) GetKey() string
func (*EncryptedMessage) GetRemoteKey ¶
func (x *EncryptedMessage) GetRemoteKey() string
func (*EncryptedMessage) ProtoMessage ¶
func (*EncryptedMessage) ProtoMessage()
func (*EncryptedMessage) ProtoReflect ¶
func (x *EncryptedMessage) ProtoReflect() protoreflect.Message
func (*EncryptedMessage) Reset ¶
func (x *EncryptedMessage) Reset()
func (*EncryptedMessage) String ¶
func (x *EncryptedMessage) String() string
type Message ¶
type Message struct { // Wireguard public key Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // Wireguard public key of the remote peer to connect to RemoteKey string `protobuf:"bytes,3,opt,name=remoteKey,proto3" json:"remoteKey,omitempty"` Body *Body `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
A decrypted representation of the EncryptedMessage. Used locally before/after encryption
func (*Message) Descriptor
deprecated
func (*Message) GetRemoteKey ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type SignalExchangeClient ¶
type SignalExchangeClient interface { // Synchronously connect to the Signal Exchange service offering connection candidates and waiting for connection candidates from the other party (remote peer) Send(ctx context.Context, in *EncryptedMessage, opts ...grpc.CallOption) (*EncryptedMessage, error) // Connect to the Signal Exchange service offering connection candidates and maintain a channel for receiving candidates from the other party (remote peer) ConnectStream(ctx context.Context, opts ...grpc.CallOption) (SignalExchange_ConnectStreamClient, error) }
SignalExchangeClient is the client API for SignalExchange 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 NewSignalExchangeClient ¶
func NewSignalExchangeClient(cc grpc.ClientConnInterface) SignalExchangeClient
type SignalExchangeServer ¶
type SignalExchangeServer interface { // Synchronously connect to the Signal Exchange service offering connection candidates and waiting for connection candidates from the other party (remote peer) Send(context.Context, *EncryptedMessage) (*EncryptedMessage, error) // Connect to the Signal Exchange service offering connection candidates and maintain a channel for receiving candidates from the other party (remote peer) ConnectStream(SignalExchange_ConnectStreamServer) error // contains filtered or unexported methods }
SignalExchangeServer is the server API for SignalExchange service. All implementations must embed UnimplementedSignalExchangeServer for forward compatibility
type SignalExchange_ConnectStreamClient ¶
type SignalExchange_ConnectStreamClient interface { Send(*EncryptedMessage) error Recv() (*EncryptedMessage, error) grpc.ClientStream }
type SignalExchange_ConnectStreamServer ¶
type SignalExchange_ConnectStreamServer interface { Send(*EncryptedMessage) error Recv() (*EncryptedMessage, error) grpc.ServerStream }
type UnimplementedSignalExchangeServer ¶
type UnimplementedSignalExchangeServer struct { }
UnimplementedSignalExchangeServer must be embedded to have forward compatible implementations.
func (UnimplementedSignalExchangeServer) ConnectStream ¶
func (UnimplementedSignalExchangeServer) ConnectStream(SignalExchange_ConnectStreamServer) error
func (UnimplementedSignalExchangeServer) Send ¶
func (UnimplementedSignalExchangeServer) Send(context.Context, *EncryptedMessage) (*EncryptedMessage, error)
type UnsafeSignalExchangeServer ¶
type UnsafeSignalExchangeServer interface {
// contains filtered or unexported methods
}
UnsafeSignalExchangeServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SignalExchangeServer will result in compilation errors.