Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterSignalExchangeServer(s grpc.ServiceRegistrar, srv SignalExchangeServer)
- type Body
- func (*Body) Descriptor() ([]byte, []int)deprecated
- func (x *Body) GetNetBirdVersion() 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-wiretrustee-peer-id"
protocol constants, field names that can be used by both client and server
const HeaderRegistered = "x-wiretrustee-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"`
NetBirdVersion string `protobuf:"bytes,4,opt,name=netBirdVersion,proto3" json:"netBirdVersion,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) Descriptor() ([]byte, []int)
Deprecated: Use Body.ProtoReflect.Descriptor instead.
func (*Body) GetNetBirdVersion ¶ added in v0.8.12
func (x *Body) GetNetBirdVersion() string
func (*Body) GetPayload ¶
func (x *Body) GetPayload() string
func (*Body) GetWgListenPort ¶ added in v0.8.12
func (x *Body) GetWgListenPort() uint32
func (*Body) ProtoMessage ¶
func (*Body) ProtoMessage()
func (*Body) ProtoReflect ¶
func (x *Body) ProtoReflect() protoreflect.Message
type Body_Type ¶
type Body_Type int32
Message type
const (
Body_OFFER Body_Type = 0
Body_ANSWER Body_Type = 1
Body_CANDIDATE Body_Type = 2
)
func (Body_Type) Descriptor ¶
func (Body_Type) Descriptor() protoreflect.EnumDescriptor
func (Body_Type) EnumDescriptor
deprecated
func (Body_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use Body_Type.Descriptor instead.
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) GetRemoteKey ¶
func (x *EncryptedMessage) GetRemoteKey() string
func (*EncryptedMessage) ProtoMessage ¶
func (*EncryptedMessage) ProtoMessage()
func (*EncryptedMessage) ProtoReflect ¶
func (x *EncryptedMessage) ProtoReflect() protoreflect.Message
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) Descriptor() ([]byte, []int)
Deprecated: Use Message.ProtoReflect.Descriptor instead.
func (*Message) GetRemoteKey ¶
func (x *Message) GetRemoteKey() string
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://pkgo.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
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.