proto

package
v0.0.0-...-5f71cfe Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderId = "x-oldsecway-peer-id"

protocol constants, field names that can be used by both client and server

View Source
const HeaderRegistered = "x-oldsecway-peer-registered"

Variables

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

View Source
var File_signalexchange_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Body.ProtoReflect.Descriptor instead.

func (*Body) GetISecWayVersion

func (x *Body) GetISecWayVersion() string

func (*Body) GetPayload

func (x *Body) GetPayload() string

func (*Body) GetType

func (x *Body) GetType() Body_Type

func (*Body) GetWgListenPort

func (x *Body) GetWgListenPort() uint32

func (*Body) ProtoMessage

func (*Body) ProtoMessage()

func (*Body) ProtoReflect

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

func (*Body) Reset

func (x *Body) Reset()

func (*Body) String

func (x *Body) String() string

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) Enum

func (x Body_Type) Enum() *Body_Type

func (Body_Type) EnumDescriptor deprecated

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

Deprecated: Use Body_Type.Descriptor instead.

func (Body_Type) Number

func (x Body_Type) Number() protoreflect.EnumNumber

func (Body_Type) String

func (x Body_Type) String() string

func (Body_Type) Type

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetBody

func (x *Message) GetBody() *Body

func (*Message) GetKey

func (x *Message) GetKey() string

func (*Message) GetRemoteKey

func (x *Message) GetRemoteKey() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

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.

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) Send

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.

Jump to

Keyboard shortcuts

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