pb

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HolePunchOutcome_name = map[int32]string{
		0: "HOLE_PUNCH_OUTCOME_UNKNOWN",
		1: "HOLE_PUNCH_OUTCOME_NO_CONNECTION",
		2: "HOLE_PUNCH_OUTCOME_NO_STREAM",
		3: "HOLE_PUNCH_OUTCOME_CONNECTION_REVERSED",
		4: "HOLE_PUNCH_OUTCOME_CANCELLED",
		5: "HOLE_PUNCH_OUTCOME_FAILED",
		6: "HOLE_PUNCH_OUTCOME_SUCCESS",
	}
	HolePunchOutcome_value = map[string]int32{
		"HOLE_PUNCH_OUTCOME_UNKNOWN":             0,
		"HOLE_PUNCH_OUTCOME_NO_CONNECTION":       1,
		"HOLE_PUNCH_OUTCOME_NO_STREAM":           2,
		"HOLE_PUNCH_OUTCOME_CONNECTION_REVERSED": 3,
		"HOLE_PUNCH_OUTCOME_CANCELLED":           4,
		"HOLE_PUNCH_OUTCOME_FAILED":              5,
		"HOLE_PUNCH_OUTCOME_SUCCESS":             6,
	}
)

Enum value maps for HolePunchOutcome.

View Source
var (
	HolePunchAttemptOutcome_name = map[int32]string{
		0: "HOLE_PUNCH_ATTEMPT_OUTCOME_UNKNOWN",
		1: "HOLE_PUNCH_ATTEMPT_OUTCOME_DIRECT_DIAL",
		2: "HOLE_PUNCH_ATTEMPT_OUTCOME_PROTOCOL_ERROR",
		3: "HOLE_PUNCH_ATTEMPT_OUTCOME_CANCELLED",
		4: "HOLE_PUNCH_ATTEMPT_OUTCOME_TIMEOUT",
		5: "HOLE_PUNCH_ATTEMPT_OUTCOME_FAILED",
		6: "HOLE_PUNCH_ATTEMPT_OUTCOME_SUCCESS",
	}
	HolePunchAttemptOutcome_value = map[string]int32{
		"HOLE_PUNCH_ATTEMPT_OUTCOME_UNKNOWN":        0,
		"HOLE_PUNCH_ATTEMPT_OUTCOME_DIRECT_DIAL":    1,
		"HOLE_PUNCH_ATTEMPT_OUTCOME_PROTOCOL_ERROR": 2,
		"HOLE_PUNCH_ATTEMPT_OUTCOME_CANCELLED":      3,
		"HOLE_PUNCH_ATTEMPT_OUTCOME_TIMEOUT":        4,
		"HOLE_PUNCH_ATTEMPT_OUTCOME_FAILED":         5,
		"HOLE_PUNCH_ATTEMPT_OUTCOME_SUCCESS":        6,
	}
)

Enum value maps for HolePunchAttemptOutcome.

View Source
var (
	LatencyMeasurementType_name = map[int32]string{
		0: "TO_RELAY",
		1: "TO_REMOTE_THROUGH_RELAY",
		2: "TO_REMOTE_AFTER_HOLE_PUNCH",
	}
	LatencyMeasurementType_value = map[string]int32{
		"TO_RELAY":                   0,
		"TO_REMOTE_THROUGH_RELAY":    1,
		"TO_REMOTE_AFTER_HOLE_PUNCH": 2,
	}
)

Enum value maps for LatencyMeasurementType.

View Source
var File_punchr_proto protoreflect.FileDescriptor
View Source
var PunchrService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "PunchrService",
	HandlerType: (*PunchrServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _PunchrService_Register_Handler,
		},
		{
			MethodName: "GetAddrInfo",
			Handler:    _PunchrService_GetAddrInfo_Handler,
		},
		{
			MethodName: "TrackHolePunch",
			Handler:    _PunchrService_TrackHolePunch_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "punchr.proto",
}

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

Functions

func RegisterPunchrServiceServer

func RegisterPunchrServiceServer(s grpc.ServiceRegistrar, srv PunchrServiceServer)

Types

type GetAddrInfoRequest

type GetAddrInfoRequest struct {

	// Host ID for that the client is requesting a peer to hole punch
	HostId []byte `protobuf:"bytes,1,req,name=host_id,json=hostId" json:"host_id,omitempty"`
	// All host IDs that the client is managing
	AllHostIds [][]byte `protobuf:"bytes,2,rep,name=all_host_ids,json=allHostIds" json:"all_host_ids,omitempty"`
	// An authentication key for this request
	ApiKey *string `protobuf:"bytes,3,req,name=api_key,json=apiKey" json:"api_key,omitempty"`
	// contains filtered or unexported fields
}

There is a challenge when a single punchr client is hole punching a single remote peer via different multi addresses. Sometimes the NAT mapping stays intact and no new hole punch is attempted. We circumvent this by spawning multiple libp2p hosts in a single punchr client, each listening on different ports. Hence, when we request a new peer to hole punch we transmit the host_id for which we request the hole punch + all other libp2p host ids so that we don't get a peer that is handled by another host already.

func (*GetAddrInfoRequest) Descriptor deprecated

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

Deprecated: Use GetAddrInfoRequest.ProtoReflect.Descriptor instead.

func (*GetAddrInfoRequest) GetAllHostIds

func (x *GetAddrInfoRequest) GetAllHostIds() [][]byte

func (*GetAddrInfoRequest) GetApiKey added in v0.3.0

func (x *GetAddrInfoRequest) GetApiKey() string

func (*GetAddrInfoRequest) GetHostId

func (x *GetAddrInfoRequest) GetHostId() []byte

func (*GetAddrInfoRequest) ProtoMessage

func (*GetAddrInfoRequest) ProtoMessage()

func (*GetAddrInfoRequest) ProtoReflect

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

func (*GetAddrInfoRequest) Reset

func (x *GetAddrInfoRequest) Reset()

func (*GetAddrInfoRequest) String

func (x *GetAddrInfoRequest) String() string

type GetAddrInfoResponse

type GetAddrInfoResponse struct {
	RemoteId       []byte   `protobuf:"bytes,1,req,name=remote_id,json=remoteId" json:"remote_id,omitempty"`
	MultiAddresses [][]byte `protobuf:"bytes,2,rep,name=multi_addresses,json=multiAddresses" json:"multi_addresses,omitempty"`
	Protocols      []int32  `protobuf:"varint,3,rep,name=protocols" json:"protocols,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAddrInfoResponse) Descriptor deprecated

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

Deprecated: Use GetAddrInfoResponse.ProtoReflect.Descriptor instead.

func (*GetAddrInfoResponse) GetMultiAddresses

func (x *GetAddrInfoResponse) GetMultiAddresses() [][]byte

func (*GetAddrInfoResponse) GetProtocols added in v0.6.0

func (x *GetAddrInfoResponse) GetProtocols() []int32

func (*GetAddrInfoResponse) GetRemoteId

func (x *GetAddrInfoResponse) GetRemoteId() []byte

func (*GetAddrInfoResponse) ProtoMessage

func (*GetAddrInfoResponse) ProtoMessage()

func (*GetAddrInfoResponse) ProtoReflect

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

func (*GetAddrInfoResponse) Reset

func (x *GetAddrInfoResponse) Reset()

func (*GetAddrInfoResponse) String

func (x *GetAddrInfoResponse) String() string

type HolePunchAttempt

type HolePunchAttempt struct {

	// Unix timestamp in nanoseconds of when the /libp2p/dcutr stream was opened
	OpenedAt *uint64 `protobuf:"varint,1,req,name=opened_at,json=openedAt" json:"opened_at,omitempty"`
	// Unix timestamp in nanoseconds of when this hole punching attempt was started
	// Can be null if hole punch wasn't started, hence `optional`
	StartedAt *uint64 `protobuf:"varint,2,opt,name=started_at,json=startedAt" json:"started_at,omitempty"`
	// Unix timestamp in nanoseconds of when this hole punching attempt terminated
	EndedAt *uint64 `protobuf:"varint,3,req,name=ended_at,json=endedAt" json:"ended_at,omitempty"`
	// Start round trip time in seconds that falls out of the `holepunch.StartHolePunchEvt` event
	StartRtt *float32 `protobuf:"fixed32,4,opt,name=start_rtt,json=startRtt" json:"start_rtt,omitempty"`
	// The elapsed time in seconds from start to finish of the hole punch
	ElapsedTime *float32 `protobuf:"fixed32,5,req,name=elapsed_time,json=elapsedTime" json:"elapsed_time,omitempty"`
	// The outcome of the hole punch
	Outcome *HolePunchAttemptOutcome `protobuf:"varint,6,req,name=outcome,enum=HolePunchAttemptOutcome" json:"outcome,omitempty"`
	// The error that occurred if the hole punch failed
	Error *string `protobuf:"bytes,7,opt,name=error" json:"error,omitempty"`
	// The error that occurred if the connection reversal failed. This is only set of
	// the multi addresses for the remote peer contained a publicly reachable non-relay multi address
	DirectDialError *string `protobuf:"bytes,8,opt,name=direct_dial_error,json=directDialError" json:"direct_dial_error,omitempty"`
	// The multi addresses used to hole punch
	MultiAddresses [][]byte `protobuf:"bytes,9,rep,name=multi_addresses,json=multiAddresses" json:"multi_addresses,omitempty"`
	// contains filtered or unexported fields
}

func (*HolePunchAttempt) Descriptor deprecated

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

Deprecated: Use HolePunchAttempt.ProtoReflect.Descriptor instead.

func (*HolePunchAttempt) GetDirectDialError

func (x *HolePunchAttempt) GetDirectDialError() string

func (*HolePunchAttempt) GetElapsedTime

func (x *HolePunchAttempt) GetElapsedTime() float32

func (*HolePunchAttempt) GetEndedAt

func (x *HolePunchAttempt) GetEndedAt() uint64

func (*HolePunchAttempt) GetError

func (x *HolePunchAttempt) GetError() string

func (*HolePunchAttempt) GetMultiAddresses added in v0.4.0

func (x *HolePunchAttempt) GetMultiAddresses() [][]byte

func (*HolePunchAttempt) GetOpenedAt

func (x *HolePunchAttempt) GetOpenedAt() uint64

func (*HolePunchAttempt) GetOutcome

func (x *HolePunchAttempt) GetOutcome() HolePunchAttemptOutcome

func (*HolePunchAttempt) GetStartRtt

func (x *HolePunchAttempt) GetStartRtt() float32

func (*HolePunchAttempt) GetStartedAt

func (x *HolePunchAttempt) GetStartedAt() uint64

func (*HolePunchAttempt) ProtoMessage

func (*HolePunchAttempt) ProtoMessage()

func (*HolePunchAttempt) ProtoReflect

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

func (*HolePunchAttempt) Reset

func (x *HolePunchAttempt) Reset()

func (*HolePunchAttempt) String

func (x *HolePunchAttempt) String() string

type HolePunchAttemptOutcome

type HolePunchAttemptOutcome int32
const (
	HolePunchAttemptOutcome_HOLE_PUNCH_ATTEMPT_OUTCOME_UNKNOWN HolePunchAttemptOutcome = 0
	// Should never happen on our side. This happens if
	// the connection reversal from our side succeeded.
	HolePunchAttemptOutcome_HOLE_PUNCH_ATTEMPT_OUTCOME_DIRECT_DIAL HolePunchAttemptOutcome = 1
	// Can happen if, e.g., the stream was reset mid-flight
	HolePunchAttemptOutcome_HOLE_PUNCH_ATTEMPT_OUTCOME_PROTOCOL_ERROR HolePunchAttemptOutcome = 2
	// The overall hole punch was cancelled by the user
	HolePunchAttemptOutcome_HOLE_PUNCH_ATTEMPT_OUTCOME_CANCELLED HolePunchAttemptOutcome = 3
	// The /libp2p/dcutr stream was opened but the hole punch was not initiated in time
	HolePunchAttemptOutcome_HOLE_PUNCH_ATTEMPT_OUTCOME_TIMEOUT HolePunchAttemptOutcome = 4
	// The hole punch was performed but has failed
	HolePunchAttemptOutcome_HOLE_PUNCH_ATTEMPT_OUTCOME_FAILED HolePunchAttemptOutcome = 5
	// The hole punch was performed and was successful
	HolePunchAttemptOutcome_HOLE_PUNCH_ATTEMPT_OUTCOME_SUCCESS HolePunchAttemptOutcome = 6
)

func (HolePunchAttemptOutcome) Descriptor

func (HolePunchAttemptOutcome) Enum

func (HolePunchAttemptOutcome) EnumDescriptor deprecated

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

Deprecated: Use HolePunchAttemptOutcome.Descriptor instead.

func (HolePunchAttemptOutcome) Number

func (HolePunchAttemptOutcome) String

func (x HolePunchAttemptOutcome) String() string

func (HolePunchAttemptOutcome) Type

func (*HolePunchAttemptOutcome) UnmarshalJSON deprecated

func (x *HolePunchAttemptOutcome) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type HolePunchOutcome

type HolePunchOutcome int32
const (
	HolePunchOutcome_HOLE_PUNCH_OUTCOME_UNKNOWN HolePunchOutcome = 0
	// Could not connect to remote peer via relay
	HolePunchOutcome_HOLE_PUNCH_OUTCOME_NO_CONNECTION HolePunchOutcome = 1
	// Hole punch was not initiated by the remote peer
	// because the /libp2p/dcutr stream was not opened.
	HolePunchOutcome_HOLE_PUNCH_OUTCOME_NO_STREAM HolePunchOutcome = 2
	// Conditions:
	//  1. /libp2p/dcutr stream was not opened.
	//  2. We connected to the remote peer via a relay
	//  3. We have a direct connection to the remote peer after we have waited for the libp2p/dcutr stream.
	//
	// Should actually never happen on our side.
	HolePunchOutcome_HOLE_PUNCH_OUTCOME_CONNECTION_REVERSED HolePunchOutcome = 3
	// Hole punch was cancelled by the user
	HolePunchOutcome_HOLE_PUNCH_OUTCOME_CANCELLED HolePunchOutcome = 4
	// The hole punch was attempted several times but failed
	HolePunchOutcome_HOLE_PUNCH_OUTCOME_FAILED HolePunchOutcome = 5
	// The hole punch was performed and successful
	HolePunchOutcome_HOLE_PUNCH_OUTCOME_SUCCESS HolePunchOutcome = 6
)

func (HolePunchOutcome) Descriptor

func (HolePunchOutcome) Enum

func (HolePunchOutcome) EnumDescriptor deprecated

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

Deprecated: Use HolePunchOutcome.Descriptor instead.

func (HolePunchOutcome) Number

func (HolePunchOutcome) String

func (x HolePunchOutcome) String() string

func (HolePunchOutcome) Type

func (*HolePunchOutcome) UnmarshalJSON deprecated

func (x *HolePunchOutcome) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type LatencyMeasurement added in v0.6.0

type LatencyMeasurement struct {

	// The remote peer ID
	RemoteId []byte `protobuf:"bytes,1,req,name=remote_id,json=remoteId" json:"remote_id,omitempty"`
	// The remote's agent_version
	AgentVersion *string `protobuf:"bytes,2,req,name=agent_version,json=agentVersion" json:"agent_version,omitempty"`
	// The remote's protocols
	Protocols []string `protobuf:"bytes,3,rep,name=protocols" json:"protocols,omitempty"`
	// The used multi address to run the ping stream over
	MultiAddress []byte `protobuf:"bytes,4,req,name=multi_address,json=multiAddress" json:"multi_address,omitempty"`
	// rtt measurements to the remote peer
	Rtts []float32 `protobuf:"fixed32,5,rep,name=rtts" json:"rtts,omitempty"`
	// rtt measurement errors to the remote peer
	RttErrs []string `protobuf:"bytes,6,rep,name=rtt_errs,json=rttErrs" json:"rtt_errs,omitempty"`
	// the type of latency measurement
	Mtype *LatencyMeasurementType `protobuf:"varint,7,req,name=mtype,enum=LatencyMeasurementType" json:"mtype,omitempty"`
	// contains filtered or unexported fields
}

func (*LatencyMeasurement) Descriptor deprecated added in v0.6.0

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

Deprecated: Use LatencyMeasurement.ProtoReflect.Descriptor instead.

func (*LatencyMeasurement) GetAgentVersion added in v0.6.0

func (x *LatencyMeasurement) GetAgentVersion() string

func (*LatencyMeasurement) GetMtype added in v0.6.0

func (*LatencyMeasurement) GetMultiAddress added in v0.6.0

func (x *LatencyMeasurement) GetMultiAddress() []byte

func (*LatencyMeasurement) GetProtocols added in v0.6.0

func (x *LatencyMeasurement) GetProtocols() []string

func (*LatencyMeasurement) GetRemoteId added in v0.6.0

func (x *LatencyMeasurement) GetRemoteId() []byte

func (*LatencyMeasurement) GetRttErrs added in v0.6.0

func (x *LatencyMeasurement) GetRttErrs() []string

func (*LatencyMeasurement) GetRtts added in v0.6.0

func (x *LatencyMeasurement) GetRtts() []float32

func (*LatencyMeasurement) ProtoMessage added in v0.6.0

func (*LatencyMeasurement) ProtoMessage()

func (*LatencyMeasurement) ProtoReflect added in v0.6.0

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

func (*LatencyMeasurement) Reset added in v0.6.0

func (x *LatencyMeasurement) Reset()

func (*LatencyMeasurement) String added in v0.6.0

func (x *LatencyMeasurement) String() string

type LatencyMeasurementType added in v0.6.0

type LatencyMeasurementType int32
const (
	LatencyMeasurementType_TO_RELAY                   LatencyMeasurementType = 0
	LatencyMeasurementType_TO_REMOTE_THROUGH_RELAY    LatencyMeasurementType = 1
	LatencyMeasurementType_TO_REMOTE_AFTER_HOLE_PUNCH LatencyMeasurementType = 2
)

func (LatencyMeasurementType) Descriptor added in v0.6.0

func (LatencyMeasurementType) Enum added in v0.6.0

func (LatencyMeasurementType) EnumDescriptor deprecated added in v0.6.0

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

Deprecated: Use LatencyMeasurementType.Descriptor instead.

func (LatencyMeasurementType) Number added in v0.6.0

func (LatencyMeasurementType) String added in v0.6.0

func (x LatencyMeasurementType) String() string

func (LatencyMeasurementType) Type added in v0.6.0

func (*LatencyMeasurementType) UnmarshalJSON deprecated added in v0.6.0

func (x *LatencyMeasurementType) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type NATMapping added in v0.7.0

type NATMapping struct {
	InternalPort *int32  `protobuf:"varint,1,req,name=internal_port,json=internalPort" json:"internal_port,omitempty"`
	ExternalPort *int32  `protobuf:"varint,2,req,name=external_port,json=externalPort" json:"external_port,omitempty"`
	Protocol     *string `protobuf:"bytes,3,req,name=protocol" json:"protocol,omitempty"`
	Addr         *string `protobuf:"bytes,4,req,name=addr" json:"addr,omitempty"`
	AddrNetwork  *string `protobuf:"bytes,5,req,name=addr_network,json=addrNetwork" json:"addr_network,omitempty"`
	// contains filtered or unexported fields
}

func (*NATMapping) Descriptor deprecated added in v0.7.0

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

Deprecated: Use NATMapping.ProtoReflect.Descriptor instead.

func (*NATMapping) GetAddr added in v0.7.0

func (x *NATMapping) GetAddr() string

func (*NATMapping) GetAddrNetwork added in v0.7.0

func (x *NATMapping) GetAddrNetwork() string

func (*NATMapping) GetExternalPort added in v0.7.0

func (x *NATMapping) GetExternalPort() int32

func (*NATMapping) GetInternalPort added in v0.7.0

func (x *NATMapping) GetInternalPort() int32

func (*NATMapping) GetProtocol added in v0.7.0

func (x *NATMapping) GetProtocol() string

func (*NATMapping) ProtoMessage added in v0.7.0

func (*NATMapping) ProtoMessage()

func (*NATMapping) ProtoReflect added in v0.7.0

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

func (*NATMapping) Reset added in v0.7.0

func (x *NATMapping) Reset()

func (*NATMapping) String added in v0.7.0

func (x *NATMapping) String() string

type NetworkInformation added in v0.6.0

type NetworkInformation struct {

	// The HTML login page of the router if it has changed
	RouterLoginHtml *string `protobuf:"bytes,1,opt,name=router_login_html,json=routerLoginHtml" json:"router_login_html,omitempty"`
	// The error that occurred when looking up the router login page
	RouterLoginHtmlError *string `protobuf:"bytes,2,opt,name=router_login_html_error,json=routerLoginHtmlError" json:"router_login_html_error,omitempty"`
	// Indicates whether the current network supports IPv6
	SupportsIpv6 *bool `protobuf:"varint,3,opt,name=supports_ipv6,json=supportsIpv6" json:"supports_ipv6,omitempty"`
	// The error that occurred when looking up the support for IPv6
	SupportsIpv6Error *string `protobuf:"bytes,4,opt,name=supports_ipv6_error,json=supportsIpv6Error" json:"supports_ipv6_error,omitempty"`
	// contains filtered or unexported fields
}

func (*NetworkInformation) Descriptor deprecated added in v0.6.0

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

Deprecated: Use NetworkInformation.ProtoReflect.Descriptor instead.

func (*NetworkInformation) GetRouterLoginHtml added in v0.6.0

func (x *NetworkInformation) GetRouterLoginHtml() string

func (*NetworkInformation) GetRouterLoginHtmlError added in v0.6.0

func (x *NetworkInformation) GetRouterLoginHtmlError() string

func (*NetworkInformation) GetSupportsIpv6 added in v0.6.0

func (x *NetworkInformation) GetSupportsIpv6() bool

func (*NetworkInformation) GetSupportsIpv6Error added in v0.6.0

func (x *NetworkInformation) GetSupportsIpv6Error() string

func (*NetworkInformation) ProtoMessage added in v0.6.0

func (*NetworkInformation) ProtoMessage()

func (*NetworkInformation) ProtoReflect added in v0.6.0

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

func (*NetworkInformation) Reset added in v0.6.0

func (x *NetworkInformation) Reset()

func (*NetworkInformation) String added in v0.6.0

func (x *NetworkInformation) String() string

type PunchrServiceClient

type PunchrServiceClient interface {
	// Register takes punchr client information and saves them to the database.
	// This should be called upon start of a client.
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	// GetAddrInfo returns peer address information that should be used to attempt
	// a hole punch. Clients should call this endpoint periodically.
	GetAddrInfo(ctx context.Context, in *GetAddrInfoRequest, opts ...grpc.CallOption) (*GetAddrInfoResponse, error)
	// TrackHolePunch takes measurement data from the client and persists them in the database
	TrackHolePunch(ctx context.Context, in *TrackHolePunchRequest, opts ...grpc.CallOption) (*TrackHolePunchResponse, error)
}

PunchrServiceClient is the client API for PunchrService 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 PunchrServiceServer

type PunchrServiceServer interface {
	// Register takes punchr client information and saves them to the database.
	// This should be called upon start of a client.
	Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
	// GetAddrInfo returns peer address information that should be used to attempt
	// a hole punch. Clients should call this endpoint periodically.
	GetAddrInfo(context.Context, *GetAddrInfoRequest) (*GetAddrInfoResponse, error)
	// TrackHolePunch takes measurement data from the client and persists them in the database
	TrackHolePunch(context.Context, *TrackHolePunchRequest) (*TrackHolePunchResponse, error)
	// contains filtered or unexported methods
}

PunchrServiceServer is the server API for PunchrService service. All implementations must embed UnimplementedPunchrServiceServer for forward compatibility

type RegisterRequest

type RegisterRequest struct {
	ClientId     []byte   `protobuf:"bytes,1,req,name=client_id,json=clientId" json:"client_id,omitempty"`
	AgentVersion *string  `protobuf:"bytes,2,req,name=agent_version,json=agentVersion" json:"agent_version,omitempty"`
	Protocols    []string `protobuf:"bytes,3,rep,name=protocols" json:"protocols,omitempty"`
	ApiKey       *string  `protobuf:"bytes,4,req,name=api_key,json=apiKey" json:"api_key,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterRequest) Descriptor deprecated

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

Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.

func (*RegisterRequest) GetAgentVersion

func (x *RegisterRequest) GetAgentVersion() string

func (*RegisterRequest) GetApiKey

func (x *RegisterRequest) GetApiKey() string

func (*RegisterRequest) GetClientId

func (x *RegisterRequest) GetClientId() []byte

func (*RegisterRequest) GetProtocols

func (x *RegisterRequest) GetProtocols() []string

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) ProtoReflect

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

func (*RegisterRequest) Reset

func (x *RegisterRequest) Reset()

func (*RegisterRequest) String

func (x *RegisterRequest) String() string

type RegisterResponse

type RegisterResponse struct {
	DbPeerId *int64 `protobuf:"varint,1,req,name=db_peer_id,json=dbPeerId" json:"db_peer_id,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterResponse) Descriptor deprecated

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

Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.

func (*RegisterResponse) GetDbPeerId

func (x *RegisterResponse) GetDbPeerId() int64

func (*RegisterResponse) ProtoMessage

func (*RegisterResponse) ProtoMessage()

func (*RegisterResponse) ProtoReflect

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

func (*RegisterResponse) Reset

func (x *RegisterResponse) Reset()

func (*RegisterResponse) String

func (x *RegisterResponse) String() string

type TrackHolePunchRequest

type TrackHolePunchRequest struct {

	// Peer ID of the requesting punchr client
	ClientId []byte `protobuf:"bytes,1,req,name=client_id,json=clientId" json:"client_id,omitempty"`
	// Peer ID of the remote peer that was hole punched
	RemoteId []byte `protobuf:"bytes,2,req,name=remote_id,json=remoteId" json:"remote_id,omitempty"`
	// The multi addresses that were used to attempt a hole punch
	// (the same that got served in the first place via GetAddrInfo)
	RemoteMultiAddresses [][]byte `protobuf:"bytes,3,rep,name=remote_multi_addresses,json=remoteMultiAddresses" json:"remote_multi_addresses,omitempty"`
	// Unix timestamp in nanoseconds of when the connection to the remote peer was initiated
	ConnectStartedAt *uint64 `protobuf:"varint,4,req,name=connect_started_at,json=connectStartedAt" json:"connect_started_at,omitempty"`
	// Unix timestamp in nanoseconds of when the connection to the remote peer via the relay was established (or has failed)
	ConnectEndedAt *uint64 `protobuf:"varint,5,req,name=connect_ended_at,json=connectEndedAt" json:"connect_ended_at,omitempty"`
	// Information about each hole punch attempt
	HolePunchAttempts []*HolePunchAttempt `protobuf:"bytes,6,rep,name=hole_punch_attempts,json=holePunchAttempts" json:"hole_punch_attempts,omitempty"`
	// The multi addresses of the open connections AFTER the hole punch process.
	// This field can be used to track which transport protocols were more successful for hole punching.
	OpenMultiAddresses [][]byte `protobuf:"bytes,7,rep,name=open_multi_addresses,json=openMultiAddresses" json:"open_multi_addresses,omitempty"`
	// Whether the open_multi_addresses contains at least one direct connection
	// to the remote peer.
	HasDirectConns *bool `protobuf:"varint,8,req,name=has_direct_conns,json=hasDirectConns" json:"has_direct_conns,omitempty"`
	// The error that occurred if the hole punch failed
	Error *string `protobuf:"bytes,9,opt,name=error" json:"error,omitempty"`
	// The reason why the hole punch ended (direct dial succeeded, protocol error occurred, hole punch procedure finished)
	Outcome *HolePunchOutcome `protobuf:"varint,10,req,name=outcome,enum=HolePunchOutcome" json:"outcome,omitempty"`
	// Unix timestamp in nanoseconds of when the overall hole punch process ended
	EndedAt *uint64 `protobuf:"varint,11,req,name=ended_at,json=endedAt" json:"ended_at,omitempty"`
	// All multi addresses the client is listening on
	ListenMultiAddresses [][]byte `protobuf:"bytes,12,rep,name=listen_multi_addresses,json=listenMultiAddresses" json:"listen_multi_addresses,omitempty"`
	// An authentication key for this request
	ApiKey *string `protobuf:"bytes,13,req,name=api_key,json=apiKey" json:"api_key,omitempty"`
	// Protocols filtered by
	Protocols []int32 `protobuf:"varint,14,rep,name=protocols" json:"protocols,omitempty"`
	// Information about the relays
	LatencyMeasurements []*LatencyMeasurement `protobuf:"bytes,15,rep,name=latency_measurements,json=latencyMeasurements" json:"latency_measurements,omitempty"`
	// Network information if the network has changed
	NetworkInformation *NetworkInformation `protobuf:"bytes,16,opt,name=network_information,json=networkInformation" json:"network_information,omitempty"`
	// AutoNAT port mappings
	NatMappings []*NATMapping `protobuf:"bytes,17,rep,name=nat_mappings,json=natMappings" json:"nat_mappings,omitempty"`
	// contains filtered or unexported fields
}

func (*TrackHolePunchRequest) Descriptor deprecated

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

Deprecated: Use TrackHolePunchRequest.ProtoReflect.Descriptor instead.

func (*TrackHolePunchRequest) GetApiKey added in v0.3.0

func (x *TrackHolePunchRequest) GetApiKey() string

func (*TrackHolePunchRequest) GetClientId

func (x *TrackHolePunchRequest) GetClientId() []byte

func (*TrackHolePunchRequest) GetConnectEndedAt

func (x *TrackHolePunchRequest) GetConnectEndedAt() uint64

func (*TrackHolePunchRequest) GetConnectStartedAt

func (x *TrackHolePunchRequest) GetConnectStartedAt() uint64

func (*TrackHolePunchRequest) GetEndedAt

func (x *TrackHolePunchRequest) GetEndedAt() uint64

func (*TrackHolePunchRequest) GetError

func (x *TrackHolePunchRequest) GetError() string

func (*TrackHolePunchRequest) GetHasDirectConns

func (x *TrackHolePunchRequest) GetHasDirectConns() bool

func (*TrackHolePunchRequest) GetHolePunchAttempts

func (x *TrackHolePunchRequest) GetHolePunchAttempts() []*HolePunchAttempt

func (*TrackHolePunchRequest) GetLatencyMeasurements added in v0.6.0

func (x *TrackHolePunchRequest) GetLatencyMeasurements() []*LatencyMeasurement

func (*TrackHolePunchRequest) GetListenMultiAddresses added in v0.3.0

func (x *TrackHolePunchRequest) GetListenMultiAddresses() [][]byte

func (*TrackHolePunchRequest) GetNatMappings added in v0.7.0

func (x *TrackHolePunchRequest) GetNatMappings() []*NATMapping

func (*TrackHolePunchRequest) GetNetworkInformation added in v0.6.0

func (x *TrackHolePunchRequest) GetNetworkInformation() *NetworkInformation

func (*TrackHolePunchRequest) GetOpenMultiAddresses

func (x *TrackHolePunchRequest) GetOpenMultiAddresses() [][]byte

func (*TrackHolePunchRequest) GetOutcome

func (x *TrackHolePunchRequest) GetOutcome() HolePunchOutcome

func (*TrackHolePunchRequest) GetProtocols added in v0.6.0

func (x *TrackHolePunchRequest) GetProtocols() []int32

func (*TrackHolePunchRequest) GetRemoteId

func (x *TrackHolePunchRequest) GetRemoteId() []byte

func (*TrackHolePunchRequest) GetRemoteMultiAddresses

func (x *TrackHolePunchRequest) GetRemoteMultiAddresses() [][]byte

func (*TrackHolePunchRequest) ProtoMessage

func (*TrackHolePunchRequest) ProtoMessage()

func (*TrackHolePunchRequest) ProtoReflect

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

func (*TrackHolePunchRequest) Reset

func (x *TrackHolePunchRequest) Reset()

func (*TrackHolePunchRequest) String

func (x *TrackHolePunchRequest) String() string

type TrackHolePunchResponse

type TrackHolePunchResponse struct {
	// contains filtered or unexported fields
}

func (*TrackHolePunchResponse) Descriptor deprecated

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

Deprecated: Use TrackHolePunchResponse.ProtoReflect.Descriptor instead.

func (*TrackHolePunchResponse) ProtoMessage

func (*TrackHolePunchResponse) ProtoMessage()

func (*TrackHolePunchResponse) ProtoReflect

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

func (*TrackHolePunchResponse) Reset

func (x *TrackHolePunchResponse) Reset()

func (*TrackHolePunchResponse) String

func (x *TrackHolePunchResponse) String() string

type UnimplementedPunchrServiceServer

type UnimplementedPunchrServiceServer struct {
}

UnimplementedPunchrServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPunchrServiceServer) GetAddrInfo

func (UnimplementedPunchrServiceServer) Register

func (UnimplementedPunchrServiceServer) TrackHolePunch

type UnsafePunchrServiceServer

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

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

Jump to

Keyboard shortcuts

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