Documentation
¶
Overview ¶
Package peernet runs a modlock peer: a PC's key on Spacewave's peer network, which links to other PCs directly when it can and through a relay when it cannot. A signaling service, hyperline.gg by default, introduces two peers that cannot reach each other on their own network. It admits a peer while that peer holds a socket signed by its key and carrying the creator's sign-in, and issues relay credentials to the same sign-in.
Index ¶
- Constants
- Variables
- func LoadKey(path string) (crypto.PrivKey, error)
- func NewSRPCPeerNetHandler(impl SRPCPeerNetServer, serviceID string) srpc.Handler
- func Run(ctx context.Context, le *logrus.Entry, parent bus.Bus, key crypto.PrivKey, ...) error
- func SRPCRegisterPeerNet(mux srpc.Mux, impl SRPCPeerNetServer) error
- type Admission
- type AdmissionState
- func (x AdmissionState) Enum() *AdmissionState
- func (x AdmissionState) MarshalJSON() ([]byte, error)
- func (x AdmissionState) MarshalProtoJSON(s *json.MarshalState)
- func (x AdmissionState) MarshalProtoText() string
- func (x AdmissionState) MarshalText() ([]byte, error)
- func (x AdmissionState) String() string
- func (x *AdmissionState) UnmarshalJSON(b []byte) error
- func (x *AdmissionState) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (x *AdmissionState) UnmarshalText(b []byte) error
- type Echo
- func (e *Echo) Close() error
- func (e *Echo) Execute(context.Context) error
- func (e *Echo) GetControllerInfo() *controller.Info
- func (e *Echo) HandleDirective(_ context.Context, inst directive.Instance) ([]directive.Resolver, error)
- func (e *Echo) HandleMountedStream(ctx context.Context, mounted link.MountedStream) error
- type GetPeerRequest
- func (m *GetPeerRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *GetPeerRequest) CloneVT() *GetPeerRequest
- func (this *GetPeerRequest) EqualMessageVT(thatMsg any) bool
- func (this *GetPeerRequest) EqualVT(that *GetPeerRequest) bool
- func (x *GetPeerRequest) MarshalJSON() ([]byte, error)
- func (x *GetPeerRequest) MarshalProtoJSON(s *json.MarshalState)
- func (x *GetPeerRequest) MarshalProtoText() string
- func (m *GetPeerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *GetPeerRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *GetPeerRequest) MarshalVT() (dAtA []byte, err error)
- func (*GetPeerRequest) ProtoMessage()
- func (x *GetPeerRequest) Reset()
- func (m *GetPeerRequest) SizeVT() (n int)
- func (x *GetPeerRequest) String() string
- func (x *GetPeerRequest) UnmarshalJSON(b []byte) error
- func (x *GetPeerRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *GetPeerRequest) UnmarshalVT(dAtA []byte) error
- type GetPeerResponse
- func (m *GetPeerResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *GetPeerResponse) CloneVT() *GetPeerResponse
- func (this *GetPeerResponse) EqualMessageVT(thatMsg any) bool
- func (this *GetPeerResponse) EqualVT(that *GetPeerResponse) bool
- func (x *GetPeerResponse) GetAccount() string
- func (x *GetPeerResponse) GetAdmission() AdmissionState
- func (x *GetPeerResponse) GetError() string
- func (x *GetPeerResponse) GetOrigin() string
- func (x *GetPeerResponse) GetPeerId() string
- func (x *GetPeerResponse) MarshalJSON() ([]byte, error)
- func (x *GetPeerResponse) MarshalProtoJSON(s *json.MarshalState)
- func (x *GetPeerResponse) MarshalProtoText() string
- func (m *GetPeerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *GetPeerResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *GetPeerResponse) MarshalVT() (dAtA []byte, err error)
- func (*GetPeerResponse) ProtoMessage()
- func (x *GetPeerResponse) Reset()
- func (m *GetPeerResponse) SizeVT() (n int)
- func (x *GetPeerResponse) String() string
- func (x *GetPeerResponse) UnmarshalJSON(b []byte) error
- func (x *GetPeerResponse) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *GetPeerResponse) UnmarshalVT(dAtA []byte) error
- type HostEvent
- func (m *HostEvent) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *HostEvent) CloneVT() *HostEvent
- func (this *HostEvent) EqualMessageVT(thatMsg any) bool
- func (this *HostEvent) EqualVT(that *HostEvent) bool
- func (m *HostEvent) GetBody() isHostEvent_Body
- func (x *HostEvent) GetJoinCode() string
- func (x *HostEvent) GetJoined() string
- func (x *HostEvent) GetLeft() string
- func (x *HostEvent) MarshalJSON() ([]byte, error)
- func (x *HostEvent) MarshalProtoJSON(s *json.MarshalState)
- func (x *HostEvent) MarshalProtoText() string
- func (m *HostEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *HostEvent) MarshalToVT(dAtA []byte) (int, error)
- func (m *HostEvent) MarshalVT() (dAtA []byte, err error)
- func (*HostEvent) ProtoMessage()
- func (x *HostEvent) Reset()
- func (m *HostEvent) SizeVT() (n int)
- func (x *HostEvent) String() string
- func (x *HostEvent) UnmarshalJSON(b []byte) error
- func (x *HostEvent) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *HostEvent) UnmarshalVT(dAtA []byte) error
- type HostEvent_JoinCode
- func (m *HostEvent_JoinCode) CloneOneofVT() isHostEvent_Body
- func (m *HostEvent_JoinCode) CloneVT() *HostEvent_JoinCode
- func (this *HostEvent_JoinCode) EqualVT(thatIface isHostEvent_Body) bool
- func (m *HostEvent_JoinCode) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *HostEvent_JoinCode) MarshalToVT(dAtA []byte) (int, error)
- func (m *HostEvent_JoinCode) SizeVT() (n int)
- type HostEvent_Joined
- func (m *HostEvent_Joined) CloneOneofVT() isHostEvent_Body
- func (m *HostEvent_Joined) CloneVT() *HostEvent_Joined
- func (this *HostEvent_Joined) EqualVT(thatIface isHostEvent_Body) bool
- func (m *HostEvent_Joined) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *HostEvent_Joined) MarshalToVT(dAtA []byte) (int, error)
- func (m *HostEvent_Joined) SizeVT() (n int)
- type HostEvent_Left
- func (m *HostEvent_Left) CloneOneofVT() isHostEvent_Body
- func (m *HostEvent_Left) CloneVT() *HostEvent_Left
- func (this *HostEvent_Left) EqualVT(thatIface isHostEvent_Body) bool
- func (m *HostEvent_Left) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *HostEvent_Left) MarshalToVT(dAtA []byte) (int, error)
- func (m *HostEvent_Left) SizeVT() (n int)
- type HostRequest
- func (m *HostRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *HostRequest) CloneVT() *HostRequest
- func (this *HostRequest) EqualMessageVT(thatMsg any) bool
- func (this *HostRequest) EqualVT(that *HostRequest) bool
- func (x *HostRequest) GetPort() uint32
- func (x *HostRequest) MarshalJSON() ([]byte, error)
- func (x *HostRequest) MarshalProtoJSON(s *json.MarshalState)
- func (x *HostRequest) MarshalProtoText() string
- func (m *HostRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *HostRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *HostRequest) MarshalVT() (dAtA []byte, err error)
- func (*HostRequest) ProtoMessage()
- func (x *HostRequest) Reset()
- func (m *HostRequest) SizeVT() (n int)
- func (x *HostRequest) String() string
- func (x *HostRequest) UnmarshalJSON(b []byte) error
- func (x *HostRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *HostRequest) UnmarshalVT(dAtA []byte) error
- type JoinCode
- type JoinEvent
- func (m *JoinEvent) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *JoinEvent) CloneVT() *JoinEvent
- func (this *JoinEvent) EqualMessageVT(thatMsg any) bool
- func (this *JoinEvent) EqualVT(that *JoinEvent) bool
- func (x *JoinEvent) GetAddress() string
- func (x *JoinEvent) GetArrived() bool
- func (m *JoinEvent) GetBody() isJoinEvent_Body
- func (x *JoinEvent) MarshalJSON() ([]byte, error)
- func (x *JoinEvent) MarshalProtoJSON(s *json.MarshalState)
- func (x *JoinEvent) MarshalProtoText() string
- func (m *JoinEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *JoinEvent) MarshalToVT(dAtA []byte) (int, error)
- func (m *JoinEvent) MarshalVT() (dAtA []byte, err error)
- func (*JoinEvent) ProtoMessage()
- func (x *JoinEvent) Reset()
- func (m *JoinEvent) SizeVT() (n int)
- func (x *JoinEvent) String() string
- func (x *JoinEvent) UnmarshalJSON(b []byte) error
- func (x *JoinEvent) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *JoinEvent) UnmarshalVT(dAtA []byte) error
- type JoinEvent_Address
- func (m *JoinEvent_Address) CloneOneofVT() isJoinEvent_Body
- func (m *JoinEvent_Address) CloneVT() *JoinEvent_Address
- func (this *JoinEvent_Address) EqualVT(thatIface isJoinEvent_Body) bool
- func (m *JoinEvent_Address) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *JoinEvent_Address) MarshalToVT(dAtA []byte) (int, error)
- func (m *JoinEvent_Address) SizeVT() (n int)
- type JoinEvent_Arrived
- func (m *JoinEvent_Arrived) CloneOneofVT() isJoinEvent_Body
- func (m *JoinEvent_Arrived) CloneVT() *JoinEvent_Arrived
- func (this *JoinEvent_Arrived) EqualVT(thatIface isJoinEvent_Body) bool
- func (m *JoinEvent_Arrived) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *JoinEvent_Arrived) MarshalToVT(dAtA []byte) (int, error)
- func (m *JoinEvent_Arrived) SizeVT() (n int)
- type JoinRequest
- func (m *JoinRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *JoinRequest) CloneVT() *JoinRequest
- func (this *JoinRequest) EqualMessageVT(thatMsg any) bool
- func (this *JoinRequest) EqualVT(that *JoinRequest) bool
- func (x *JoinRequest) GetCode() string
- func (x *JoinRequest) MarshalJSON() ([]byte, error)
- func (x *JoinRequest) MarshalProtoJSON(s *json.MarshalState)
- func (x *JoinRequest) MarshalProtoText() string
- func (m *JoinRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *JoinRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *JoinRequest) MarshalVT() (dAtA []byte, err error)
- func (*JoinRequest) ProtoMessage()
- func (x *JoinRequest) Reset()
- func (m *JoinRequest) SizeVT() (n int)
- func (x *JoinRequest) String() string
- func (x *JoinRequest) UnmarshalJSON(b []byte) error
- func (x *JoinRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *JoinRequest) UnmarshalVT(dAtA []byte) error
- type Node
- type ProbeRequest
- func (m *ProbeRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *ProbeRequest) CloneVT() *ProbeRequest
- func (this *ProbeRequest) EqualMessageVT(thatMsg any) bool
- func (this *ProbeRequest) EqualVT(that *ProbeRequest) bool
- func (x *ProbeRequest) GetPeerId() string
- func (x *ProbeRequest) MarshalJSON() ([]byte, error)
- func (x *ProbeRequest) MarshalProtoJSON(s *json.MarshalState)
- func (x *ProbeRequest) MarshalProtoText() string
- func (m *ProbeRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *ProbeRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *ProbeRequest) MarshalVT() (dAtA []byte, err error)
- func (*ProbeRequest) ProtoMessage()
- func (x *ProbeRequest) Reset()
- func (m *ProbeRequest) SizeVT() (n int)
- func (x *ProbeRequest) String() string
- func (x *ProbeRequest) UnmarshalJSON(b []byte) error
- func (x *ProbeRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *ProbeRequest) UnmarshalVT(dAtA []byte) error
- type ProbeResponse
- func (m *ProbeResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *ProbeResponse) CloneVT() *ProbeResponse
- func (this *ProbeResponse) EqualMessageVT(thatMsg any) bool
- func (this *ProbeResponse) EqualVT(that *ProbeResponse) bool
- func (x *ProbeResponse) GetRelayed() bool
- func (x *ProbeResponse) GetRttUs() uint32
- func (x *ProbeResponse) MarshalJSON() ([]byte, error)
- func (x *ProbeResponse) MarshalProtoJSON(s *json.MarshalState)
- func (x *ProbeResponse) MarshalProtoText() string
- func (m *ProbeResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *ProbeResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *ProbeResponse) MarshalVT() (dAtA []byte, err error)
- func (*ProbeResponse) ProtoMessage()
- func (x *ProbeResponse) Reset()
- func (m *ProbeResponse) SizeVT() (n int)
- func (x *ProbeResponse) String() string
- func (x *ProbeResponse) UnmarshalJSON(b []byte) error
- func (x *ProbeResponse) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *ProbeResponse) UnmarshalVT(dAtA []byte) error
- type Relay
- func (r *Relay) Close() error
- func (r *Relay) Execute(context.Context) error
- func (r *Relay) GetControllerInfo() *controller.Info
- func (r *Relay) HandleDirective(_ context.Context, inst directive.Instance) ([]directive.Resolver, error)
- func (r *Relay) ICEConfig(ctx context.Context) (*webrtc.WebRtcConfig, error)
- type RelayCredentials
- func (m *RelayCredentials) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *RelayCredentials) CloneVT() *RelayCredentials
- func (this *RelayCredentials) EqualMessageVT(thatMsg any) bool
- func (this *RelayCredentials) EqualVT(that *RelayCredentials) bool
- func (x *RelayCredentials) GetExpiresAt() int64
- func (x *RelayCredentials) GetServers() []*RelayServer
- func (x *RelayCredentials) MarshalJSON() ([]byte, error)
- func (x *RelayCredentials) MarshalProtoJSON(s *json.MarshalState)
- func (x *RelayCredentials) MarshalProtoText() string
- func (m *RelayCredentials) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *RelayCredentials) MarshalToVT(dAtA []byte) (int, error)
- func (m *RelayCredentials) MarshalVT() (dAtA []byte, err error)
- func (*RelayCredentials) ProtoMessage()
- func (x *RelayCredentials) Reset()
- func (m *RelayCredentials) SizeVT() (n int)
- func (x *RelayCredentials) String() string
- func (x *RelayCredentials) UnmarshalJSON(b []byte) error
- func (x *RelayCredentials) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *RelayCredentials) UnmarshalVT(dAtA []byte) error
- type RelayServer
- func (m *RelayServer) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *RelayServer) CloneVT() *RelayServer
- func (this *RelayServer) EqualMessageVT(thatMsg any) bool
- func (this *RelayServer) EqualVT(that *RelayServer) bool
- func (x *RelayServer) GetCredential() string
- func (x *RelayServer) GetUrls() []string
- func (x *RelayServer) GetUsername() string
- func (x *RelayServer) MarshalJSON() ([]byte, error)
- func (x *RelayServer) MarshalProtoJSON(s *json.MarshalState)
- func (x *RelayServer) MarshalProtoText() string
- func (m *RelayServer) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *RelayServer) MarshalToVT(dAtA []byte) (int, error)
- func (m *RelayServer) MarshalVT() (dAtA []byte, err error)
- func (*RelayServer) ProtoMessage()
- func (x *RelayServer) Reset()
- func (m *RelayServer) SizeVT() (n int)
- func (x *RelayServer) String() string
- func (x *RelayServer) UnmarshalJSON(b []byte) error
- func (x *RelayServer) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *RelayServer) UnmarshalVT(dAtA []byte) error
- type SRPCPeerNetClient
- type SRPCPeerNetHandler
- func (SRPCPeerNetHandler) GetMethodIDs() []string
- func (d *SRPCPeerNetHandler) GetServiceID() string
- func (d *SRPCPeerNetHandler) InvokeMethod(serviceID, methodID string, strm srpc.Stream) (bool, error)
- func (SRPCPeerNetHandler) InvokeMethod_GetPeer(impl SRPCPeerNetServer, strm srpc.Stream) error
- func (SRPCPeerNetHandler) InvokeMethod_Host(impl SRPCPeerNetServer, strm srpc.Stream) error
- func (SRPCPeerNetHandler) InvokeMethod_Join(impl SRPCPeerNetServer, strm srpc.Stream) error
- func (SRPCPeerNetHandler) InvokeMethod_Probe(impl SRPCPeerNetServer, strm srpc.Stream) error
- type SRPCPeerNetServer
- type SRPCPeerNet_GetPeerStream
- type SRPCPeerNet_HostClient
- type SRPCPeerNet_HostStream
- type SRPCPeerNet_JoinClient
- type SRPCPeerNet_JoinStream
- type SRPCPeerNet_ProbeStream
- type Service
- func (s *Service) GetPeer(ctx context.Context, _ *GetPeerRequest) (*GetPeerResponse, error)
- func (s *Service) Host(req *HostRequest, strm SRPCPeerNet_HostStream) error
- func (s *Service) Join(req *JoinRequest, strm SRPCPeerNet_JoinStream) error
- func (s *Service) Probe(ctx context.Context, req *ProbeRequest) (*ProbeResponse, error)
- func (s *Service) Register(mux srpc.Mux) error
- func (s *Service) Run(ctx context.Context, le *logrus.Entry) error
- type SignIn
Constants ¶
const AdmitPath = "/api/signal/peer"
AdmitPath is where the service admits a signed-in peer to signaling for as long as its socket stays open.
const GameProtocolID = protocol.ID("modlock/game/1")
GameProtocolID identifies game streams between modlock peers, which gamelink forwards. The handshake's generation is the hosted session, so only a guest holding the join code reaches the server.
const ProbeProtocolID = protocol.ID("modlock/probe/1")
ProbeProtocolID identifies probe streams between modlock peers. The stream is an unreliable message stream, like a game's, and the answering peer returns each probe packet to its sender.
const RelayPath = "/api/turn-credentials"
RelayPath is where the service issues relay credentials to a signed-in creator.
const SRPCPeerNetServiceID = "modlock.peernet.PeerNet"
const SigningEnv = "hyperline"
SigningEnv separates the signatures a peer sends hyperline.gg from requests to any other service its key could sign for.
Variables ¶
var ( AdmissionState_name = map[int32]string{ 0: "ADMISSION_STATE_SIGNED_OUT", 1: "ADMISSION_STATE_CONNECTING", 2: "ADMISSION_STATE_ADMITTED", 3: "ADMISSION_STATE_REFUSED", } AdmissionState_value = map[string]int32{ "ADMISSION_STATE_SIGNED_OUT": 0, "ADMISSION_STATE_CONNECTING": 1, "ADMISSION_STATE_ADMITTED": 2, "ADMISSION_STATE_REFUSED": 3, } )
Enum value maps for AdmissionState.
Functions ¶
func LoadKey ¶
LoadKey reads the peer key at path, creating it on first use. Only one process may call it for a path at a time, such as the daemon that holds its state directory.
func NewSRPCPeerNetHandler ¶
func NewSRPCPeerNetHandler(impl SRPCPeerNetServer, serviceID string) srpc.Handler
NewSRPCPeerNetHandler constructs a new RPC handler. serviceID: if empty, uses default: modlock.peernet.PeerNet
func Run ¶
func Run( ctx context.Context, le *logrus.Entry, parent bus.Bus, key crypto.PrivKey, origin string, serve func(ctx context.Context, node *Node) error, ) error
Run starts a peer for key that signals through the service at origin and runs serve with it until serve returns or the peer stops. The node's bus resolves directives it does not own, such as relay credentials, on parent. A peer the service does not admit yet retries signaling without delaying serve; links that need no signaling keep working meanwhile.
func SRPCRegisterPeerNet ¶
func SRPCRegisterPeerNet(mux srpc.Mux, impl SRPCPeerNetServer) error
SRPCRegisterPeerNet registers the implementation with the mux. Uses the default serviceID: modlock.peernet.PeerNet
Types ¶
type Admission ¶
type Admission struct {
// contains filtered or unexported fields
}
Admission holds a peer's admission to signaling at a service. It reads the sign-in again before each attempt, retries a dropped socket, and waits for Wake while signed out or refused, since only a new sign-in can change that.
func NewAdmission ¶
NewAdmission constructs the admission of key at origin.
type AdmissionState ¶
type AdmissionState int32
AdmissionState is where a peer stands with the signaling service, which introduces it to peers it cannot reach on its own network.
const ( // ADMISSION_STATE_SIGNED_OUT means no sign-in is saved, so the service // does not know the peer. AdmissionState_ADMISSION_STATE_SIGNED_OUT AdmissionState = 0 // ADMISSION_STATE_CONNECTING means the peer is opening its admission // socket, or waits to retry after it dropped. AdmissionState_ADMISSION_STATE_CONNECTING AdmissionState = 1 // ADMISSION_STATE_ADMITTED means the service signals for the peer. AdmissionState_ADMISSION_STATE_ADMITTED AdmissionState = 2 // ADMISSION_STATE_REFUSED means the service refused the saved sign-in, // which has expired or was signed out. AdmissionState_ADMISSION_STATE_REFUSED AdmissionState = 3 )
func (AdmissionState) Enum ¶
func (x AdmissionState) Enum() *AdmissionState
func (AdmissionState) MarshalJSON ¶
func (x AdmissionState) MarshalJSON() ([]byte, error)
MarshalJSON marshals the AdmissionState to JSON.
func (AdmissionState) MarshalProtoJSON ¶
func (x AdmissionState) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the AdmissionState to JSON.
func (AdmissionState) MarshalProtoText ¶
func (x AdmissionState) MarshalProtoText() string
func (AdmissionState) MarshalText ¶
func (x AdmissionState) MarshalText() ([]byte, error)
MarshalText marshals the AdmissionState to text.
func (AdmissionState) String ¶
func (x AdmissionState) String() string
func (*AdmissionState) UnmarshalJSON ¶
func (x *AdmissionState) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the AdmissionState from JSON.
func (*AdmissionState) UnmarshalProtoJSON ¶
func (x *AdmissionState) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the AdmissionState from JSON.
func (*AdmissionState) UnmarshalText ¶
func (x *AdmissionState) UnmarshalText(b []byte) error
UnmarshalText unmarshals the AdmissionState from text.
type Echo ¶
type Echo struct {
// contains filtered or unexported fields
}
Echo answers probe streams from any peer to the local peer for as long as its controller runs on the bus.
func (*Echo) GetControllerInfo ¶
func (e *Echo) GetControllerInfo() *controller.Info
GetControllerInfo identifies the echo.
func (*Echo) HandleDirective ¶
func (e *Echo) HandleDirective(_ context.Context, inst directive.Instance) ([]directive.Resolver, error)
HandleDirective accepts probe streams to the local peer.
func (*Echo) HandleMountedStream ¶
HandleMountedStream returns each probe packet to its sender until the stream closes or the limit passes.
type GetPeerRequest ¶
type GetPeerRequest struct {
// contains filtered or unexported fields
}
GetPeerRequest asks for the daemon's peer.
func (*GetPeerRequest) CloneMessageVT ¶
func (m *GetPeerRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*GetPeerRequest) CloneVT ¶
func (m *GetPeerRequest) CloneVT() *GetPeerRequest
func (*GetPeerRequest) EqualMessageVT ¶
func (this *GetPeerRequest) EqualMessageVT(thatMsg any) bool
func (*GetPeerRequest) EqualVT ¶
func (this *GetPeerRequest) EqualVT(that *GetPeerRequest) bool
func (*GetPeerRequest) MarshalJSON ¶
func (x *GetPeerRequest) MarshalJSON() ([]byte, error)
MarshalJSON marshals the GetPeerRequest to JSON.
func (*GetPeerRequest) MarshalProtoJSON ¶
func (x *GetPeerRequest) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the GetPeerRequest message to JSON.
func (*GetPeerRequest) MarshalProtoText ¶
func (x *GetPeerRequest) MarshalProtoText() string
func (*GetPeerRequest) MarshalToSizedBufferVT ¶
func (m *GetPeerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*GetPeerRequest) MarshalToVT ¶
func (m *GetPeerRequest) MarshalToVT(dAtA []byte) (int, error)
func (*GetPeerRequest) MarshalVT ¶
func (m *GetPeerRequest) MarshalVT() (dAtA []byte, err error)
func (*GetPeerRequest) ProtoMessage ¶
func (*GetPeerRequest) ProtoMessage()
func (*GetPeerRequest) Reset ¶
func (x *GetPeerRequest) Reset()
func (*GetPeerRequest) SizeVT ¶
func (m *GetPeerRequest) SizeVT() (n int)
func (*GetPeerRequest) String ¶
func (x *GetPeerRequest) String() string
func (*GetPeerRequest) UnmarshalJSON ¶
func (x *GetPeerRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the GetPeerRequest from JSON.
func (*GetPeerRequest) UnmarshalProtoJSON ¶
func (x *GetPeerRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the GetPeerRequest message from JSON.
func (*GetPeerRequest) UnmarshalVT ¶
func (m *GetPeerRequest) UnmarshalVT(dAtA []byte) error
type GetPeerResponse ¶
type GetPeerResponse struct {
// peer_id is the PC's peer on the network.
PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
// origin is the signaling service, such as https://hyperline.gg.
Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"`
// admission is the peer's standing with that service.
Admission AdmissionState `protobuf:"varint,3,opt,name=admission,proto3" json:"admission,omitempty"`
// account is the signed-in name, when a sign-in is saved.
Account string `protobuf:"bytes,4,opt,name=account,proto3" json:"account,omitempty"`
// error says why the last admission attempt failed while connecting.
Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
// contains filtered or unexported fields
}
GetPeerResponse describes the daemon's peer.
func (*GetPeerResponse) CloneMessageVT ¶
func (m *GetPeerResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*GetPeerResponse) CloneVT ¶
func (m *GetPeerResponse) CloneVT() *GetPeerResponse
func (*GetPeerResponse) EqualMessageVT ¶
func (this *GetPeerResponse) EqualMessageVT(thatMsg any) bool
func (*GetPeerResponse) EqualVT ¶
func (this *GetPeerResponse) EqualVT(that *GetPeerResponse) bool
func (*GetPeerResponse) GetAccount ¶
func (x *GetPeerResponse) GetAccount() string
func (*GetPeerResponse) GetAdmission ¶
func (x *GetPeerResponse) GetAdmission() AdmissionState
func (*GetPeerResponse) GetError ¶
func (x *GetPeerResponse) GetError() string
func (*GetPeerResponse) GetOrigin ¶
func (x *GetPeerResponse) GetOrigin() string
func (*GetPeerResponse) GetPeerId ¶
func (x *GetPeerResponse) GetPeerId() string
func (*GetPeerResponse) MarshalJSON ¶
func (x *GetPeerResponse) MarshalJSON() ([]byte, error)
MarshalJSON marshals the GetPeerResponse to JSON.
func (*GetPeerResponse) MarshalProtoJSON ¶
func (x *GetPeerResponse) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the GetPeerResponse message to JSON.
func (*GetPeerResponse) MarshalProtoText ¶
func (x *GetPeerResponse) MarshalProtoText() string
func (*GetPeerResponse) MarshalToSizedBufferVT ¶
func (m *GetPeerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*GetPeerResponse) MarshalToVT ¶
func (m *GetPeerResponse) MarshalToVT(dAtA []byte) (int, error)
func (*GetPeerResponse) MarshalVT ¶
func (m *GetPeerResponse) MarshalVT() (dAtA []byte, err error)
func (*GetPeerResponse) ProtoMessage ¶
func (*GetPeerResponse) ProtoMessage()
func (*GetPeerResponse) Reset ¶
func (x *GetPeerResponse) Reset()
func (*GetPeerResponse) SizeVT ¶
func (m *GetPeerResponse) SizeVT() (n int)
func (*GetPeerResponse) String ¶
func (x *GetPeerResponse) String() string
func (*GetPeerResponse) UnmarshalJSON ¶
func (x *GetPeerResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the GetPeerResponse from JSON.
func (*GetPeerResponse) UnmarshalProtoJSON ¶
func (x *GetPeerResponse) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the GetPeerResponse message from JSON.
func (*GetPeerResponse) UnmarshalVT ¶
func (m *GetPeerResponse) UnmarshalVT(dAtA []byte) error
type HostEvent ¶
type HostEvent struct {
// Types that are assignable to Body:
// *HostEvent_JoinCode
// *HostEvent_Joined
// *HostEvent_Left
Body isHostEvent_Body `protobuf_oneof:"body"`
// contains filtered or unexported fields
}
HostEvent is one change to a hosted session.
func (*HostEvent) CloneMessageVT ¶
func (m *HostEvent) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*HostEvent) EqualMessageVT ¶
func (*HostEvent) GetJoinCode ¶
func (*HostEvent) MarshalJSON ¶
MarshalJSON marshals the HostEvent to JSON.
func (*HostEvent) MarshalProtoJSON ¶
func (x *HostEvent) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the HostEvent message to JSON.
func (*HostEvent) MarshalProtoText ¶
func (*HostEvent) MarshalToSizedBufferVT ¶
func (*HostEvent) ProtoMessage ¶
func (*HostEvent) ProtoMessage()
func (*HostEvent) UnmarshalJSON ¶
UnmarshalJSON unmarshals the HostEvent from JSON.
func (*HostEvent) UnmarshalProtoJSON ¶
func (x *HostEvent) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the HostEvent message from JSON.
func (*HostEvent) UnmarshalVT ¶
type HostEvent_JoinCode ¶
type HostEvent_JoinCode struct {
// join_code is the code a guest passes to modlock join. It names the
// host's peer and the session, and comes first.
JoinCode string `protobuf:"bytes,1,opt,name=join_code,json=joinCode,proto3,oneof"`
}
func (*HostEvent_JoinCode) CloneOneofVT ¶
func (m *HostEvent_JoinCode) CloneOneofVT() isHostEvent_Body
func (*HostEvent_JoinCode) CloneVT ¶
func (m *HostEvent_JoinCode) CloneVT() *HostEvent_JoinCode
func (*HostEvent_JoinCode) EqualVT ¶
func (this *HostEvent_JoinCode) EqualVT(thatIface isHostEvent_Body) bool
func (*HostEvent_JoinCode) MarshalToSizedBufferVT ¶
func (m *HostEvent_JoinCode) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*HostEvent_JoinCode) MarshalToVT ¶
func (m *HostEvent_JoinCode) MarshalToVT(dAtA []byte) (int, error)
func (*HostEvent_JoinCode) SizeVT ¶
func (m *HostEvent_JoinCode) SizeVT() (n int)
type HostEvent_Joined ¶
type HostEvent_Joined struct {
// joined is the peer of a guest whose game stream the host accepted.
Joined string `protobuf:"bytes,2,opt,name=joined,proto3,oneof"`
}
func (*HostEvent_Joined) CloneOneofVT ¶
func (m *HostEvent_Joined) CloneOneofVT() isHostEvent_Body
func (*HostEvent_Joined) CloneVT ¶
func (m *HostEvent_Joined) CloneVT() *HostEvent_Joined
func (*HostEvent_Joined) EqualVT ¶
func (this *HostEvent_Joined) EqualVT(thatIface isHostEvent_Body) bool
func (*HostEvent_Joined) MarshalToSizedBufferVT ¶
func (m *HostEvent_Joined) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*HostEvent_Joined) MarshalToVT ¶
func (m *HostEvent_Joined) MarshalToVT(dAtA []byte) (int, error)
func (*HostEvent_Joined) SizeVT ¶
func (m *HostEvent_Joined) SizeVT() (n int)
type HostEvent_Left ¶
type HostEvent_Left struct {
// left is the peer of a guest whose game stream ended.
Left string `protobuf:"bytes,3,opt,name=left,proto3,oneof"`
}
func (*HostEvent_Left) CloneOneofVT ¶
func (m *HostEvent_Left) CloneOneofVT() isHostEvent_Body
func (*HostEvent_Left) CloneVT ¶
func (m *HostEvent_Left) CloneVT() *HostEvent_Left
func (*HostEvent_Left) EqualVT ¶
func (this *HostEvent_Left) EqualVT(thatIface isHostEvent_Body) bool
func (*HostEvent_Left) MarshalToSizedBufferVT ¶
func (m *HostEvent_Left) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*HostEvent_Left) MarshalToVT ¶
func (m *HostEvent_Left) MarshalToVT(dAtA []byte) (int, error)
func (*HostEvent_Left) SizeVT ¶
func (m *HostEvent_Left) SizeVT() (n int)
type HostRequest ¶
type HostRequest struct {
// port is the server's UDP game port on loopback.
Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"`
// contains filtered or unexported fields
}
HostRequest names the game server to serve.
func (*HostRequest) CloneMessageVT ¶
func (m *HostRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*HostRequest) CloneVT ¶
func (m *HostRequest) CloneVT() *HostRequest
func (*HostRequest) EqualMessageVT ¶
func (this *HostRequest) EqualMessageVT(thatMsg any) bool
func (*HostRequest) EqualVT ¶
func (this *HostRequest) EqualVT(that *HostRequest) bool
func (*HostRequest) GetPort ¶
func (x *HostRequest) GetPort() uint32
func (*HostRequest) MarshalJSON ¶
func (x *HostRequest) MarshalJSON() ([]byte, error)
MarshalJSON marshals the HostRequest to JSON.
func (*HostRequest) MarshalProtoJSON ¶
func (x *HostRequest) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the HostRequest message to JSON.
func (*HostRequest) MarshalProtoText ¶
func (x *HostRequest) MarshalProtoText() string
func (*HostRequest) MarshalToSizedBufferVT ¶
func (m *HostRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*HostRequest) MarshalToVT ¶
func (m *HostRequest) MarshalToVT(dAtA []byte) (int, error)
func (*HostRequest) MarshalVT ¶
func (m *HostRequest) MarshalVT() (dAtA []byte, err error)
func (*HostRequest) ProtoMessage ¶
func (*HostRequest) ProtoMessage()
func (*HostRequest) Reset ¶
func (x *HostRequest) Reset()
func (*HostRequest) SizeVT ¶
func (m *HostRequest) SizeVT() (n int)
func (*HostRequest) String ¶
func (x *HostRequest) String() string
func (*HostRequest) UnmarshalJSON ¶
func (x *HostRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the HostRequest from JSON.
func (*HostRequest) UnmarshalProtoJSON ¶
func (x *HostRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the HostRequest message from JSON.
func (*HostRequest) UnmarshalVT ¶
func (m *HostRequest) UnmarshalVT(dAtA []byte) error
type JoinCode ¶
type JoinCode struct {
// Host is the hosting PC's peer.
Host peer.ID
// Session is the session's nonzero secret.
Session uint64
}
JoinCode names a hosted session: the host's peer and the session's secret.
func ParseJoinCode ¶
ParseJoinCode reads a code that JoinCode.String formatted.
type JoinEvent ¶
type JoinEvent struct {
// Types that are assignable to Body:
// *JoinEvent_Address
// *JoinEvent_Arrived
Body isJoinEvent_Body `protobuf_oneof:"body"`
// contains filtered or unexported fields
}
JoinEvent is one step of joining a hosted session.
func (*JoinEvent) CloneMessageVT ¶
func (m *JoinEvent) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*JoinEvent) EqualMessageVT ¶
func (*JoinEvent) GetAddress ¶
func (*JoinEvent) GetArrived ¶
func (*JoinEvent) MarshalJSON ¶
MarshalJSON marshals the JoinEvent to JSON.
func (*JoinEvent) MarshalProtoJSON ¶
func (x *JoinEvent) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the JoinEvent message to JSON.
func (*JoinEvent) MarshalProtoText ¶
func (*JoinEvent) MarshalToSizedBufferVT ¶
func (*JoinEvent) ProtoMessage ¶
func (*JoinEvent) ProtoMessage()
func (*JoinEvent) UnmarshalJSON ¶
UnmarshalJSON unmarshals the JoinEvent from JSON.
func (*JoinEvent) UnmarshalProtoJSON ¶
func (x *JoinEvent) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the JoinEvent message from JSON.
func (*JoinEvent) UnmarshalVT ¶
type JoinEvent_Address ¶
type JoinEvent_Address struct {
// address is the loopback endpoint the local game connects to, sent once
// the host accepted the guest.
Address string `protobuf:"bytes,1,opt,name=address,proto3,oneof"`
}
func (*JoinEvent_Address) CloneOneofVT ¶
func (m *JoinEvent_Address) CloneOneofVT() isJoinEvent_Body
func (*JoinEvent_Address) CloneVT ¶
func (m *JoinEvent_Address) CloneVT() *JoinEvent_Address
func (*JoinEvent_Address) EqualVT ¶
func (this *JoinEvent_Address) EqualVT(thatIface isJoinEvent_Body) bool
func (*JoinEvent_Address) MarshalToSizedBufferVT ¶
func (m *JoinEvent_Address) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*JoinEvent_Address) MarshalToVT ¶
func (m *JoinEvent_Address) MarshalToVT(dAtA []byte) (int, error)
func (*JoinEvent_Address) SizeVT ¶
func (m *JoinEvent_Address) SizeVT() (n int)
type JoinEvent_Arrived ¶
type JoinEvent_Arrived struct {
// arrived reports the game's first packet through address.
Arrived bool `protobuf:"varint,2,opt,name=arrived,proto3,oneof"`
}
func (*JoinEvent_Arrived) CloneOneofVT ¶
func (m *JoinEvent_Arrived) CloneOneofVT() isJoinEvent_Body
func (*JoinEvent_Arrived) CloneVT ¶
func (m *JoinEvent_Arrived) CloneVT() *JoinEvent_Arrived
func (*JoinEvent_Arrived) EqualVT ¶
func (this *JoinEvent_Arrived) EqualVT(thatIface isJoinEvent_Body) bool
func (*JoinEvent_Arrived) MarshalToSizedBufferVT ¶
func (m *JoinEvent_Arrived) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*JoinEvent_Arrived) MarshalToVT ¶
func (m *JoinEvent_Arrived) MarshalToVT(dAtA []byte) (int, error)
func (*JoinEvent_Arrived) SizeVT ¶
func (m *JoinEvent_Arrived) SizeVT() (n int)
type JoinRequest ¶
type JoinRequest struct {
// code is the host's join code.
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
// contains filtered or unexported fields
}
JoinRequest names the session to join.
func (*JoinRequest) CloneMessageVT ¶
func (m *JoinRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*JoinRequest) CloneVT ¶
func (m *JoinRequest) CloneVT() *JoinRequest
func (*JoinRequest) EqualMessageVT ¶
func (this *JoinRequest) EqualMessageVT(thatMsg any) bool
func (*JoinRequest) EqualVT ¶
func (this *JoinRequest) EqualVT(that *JoinRequest) bool
func (*JoinRequest) GetCode ¶
func (x *JoinRequest) GetCode() string
func (*JoinRequest) MarshalJSON ¶
func (x *JoinRequest) MarshalJSON() ([]byte, error)
MarshalJSON marshals the JoinRequest to JSON.
func (*JoinRequest) MarshalProtoJSON ¶
func (x *JoinRequest) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the JoinRequest message to JSON.
func (*JoinRequest) MarshalProtoText ¶
func (x *JoinRequest) MarshalProtoText() string
func (*JoinRequest) MarshalToSizedBufferVT ¶
func (m *JoinRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*JoinRequest) MarshalToVT ¶
func (m *JoinRequest) MarshalToVT(dAtA []byte) (int, error)
func (*JoinRequest) MarshalVT ¶
func (m *JoinRequest) MarshalVT() (dAtA []byte, err error)
func (*JoinRequest) ProtoMessage ¶
func (*JoinRequest) ProtoMessage()
func (*JoinRequest) Reset ¶
func (x *JoinRequest) Reset()
func (*JoinRequest) SizeVT ¶
func (m *JoinRequest) SizeVT() (n int)
func (*JoinRequest) String ¶
func (x *JoinRequest) String() string
func (*JoinRequest) UnmarshalJSON ¶
func (x *JoinRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the JoinRequest from JSON.
func (*JoinRequest) UnmarshalProtoJSON ¶
func (x *JoinRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the JoinRequest message from JSON.
func (*JoinRequest) UnmarshalVT ¶
func (m *JoinRequest) UnmarshalVT(dAtA []byte) error
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is a running peer: the bus that dials and serves peer streams under the node's peer ID.
type ProbeRequest ¶
type ProbeRequest struct {
// peer_id is the other PC's peer.
PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
// contains filtered or unexported fields
}
ProbeRequest names the peer to measure.
func (*ProbeRequest) CloneMessageVT ¶
func (m *ProbeRequest) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*ProbeRequest) CloneVT ¶
func (m *ProbeRequest) CloneVT() *ProbeRequest
func (*ProbeRequest) EqualMessageVT ¶
func (this *ProbeRequest) EqualMessageVT(thatMsg any) bool
func (*ProbeRequest) EqualVT ¶
func (this *ProbeRequest) EqualVT(that *ProbeRequest) bool
func (*ProbeRequest) GetPeerId ¶
func (x *ProbeRequest) GetPeerId() string
func (*ProbeRequest) MarshalJSON ¶
func (x *ProbeRequest) MarshalJSON() ([]byte, error)
MarshalJSON marshals the ProbeRequest to JSON.
func (*ProbeRequest) MarshalProtoJSON ¶
func (x *ProbeRequest) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the ProbeRequest message to JSON.
func (*ProbeRequest) MarshalProtoText ¶
func (x *ProbeRequest) MarshalProtoText() string
func (*ProbeRequest) MarshalToSizedBufferVT ¶
func (m *ProbeRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*ProbeRequest) MarshalToVT ¶
func (m *ProbeRequest) MarshalToVT(dAtA []byte) (int, error)
func (*ProbeRequest) MarshalVT ¶
func (m *ProbeRequest) MarshalVT() (dAtA []byte, err error)
func (*ProbeRequest) ProtoMessage ¶
func (*ProbeRequest) ProtoMessage()
func (*ProbeRequest) Reset ¶
func (x *ProbeRequest) Reset()
func (*ProbeRequest) SizeVT ¶
func (m *ProbeRequest) SizeVT() (n int)
func (*ProbeRequest) String ¶
func (x *ProbeRequest) String() string
func (*ProbeRequest) UnmarshalJSON ¶
func (x *ProbeRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the ProbeRequest from JSON.
func (*ProbeRequest) UnmarshalProtoJSON ¶
func (x *ProbeRequest) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the ProbeRequest message from JSON.
func (*ProbeRequest) UnmarshalVT ¶
func (m *ProbeRequest) UnmarshalVT(dAtA []byte) error
type ProbeResponse ¶
type ProbeResponse struct {
// rtt_us is the shortest round trip of the probe's packets, in
// microseconds.
RttUs uint32 `protobuf:"varint,1,opt,name=rtt_us,json=rttUs,proto3" json:"rttUs,omitempty"`
// relayed reports that the link runs through the service's relay rather
// than directly between the PCs.
Relayed bool `protobuf:"varint,2,opt,name=relayed,proto3" json:"relayed,omitempty"`
// contains filtered or unexported fields
}
ProbeResponse reports one measured link.
func Probe ¶
Probe opens a probe stream from local to remote on b and returns the shortest round trip of its packets and whether the link is relayed.
func (*ProbeResponse) CloneMessageVT ¶
func (m *ProbeResponse) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*ProbeResponse) CloneVT ¶
func (m *ProbeResponse) CloneVT() *ProbeResponse
func (*ProbeResponse) EqualMessageVT ¶
func (this *ProbeResponse) EqualMessageVT(thatMsg any) bool
func (*ProbeResponse) EqualVT ¶
func (this *ProbeResponse) EqualVT(that *ProbeResponse) bool
func (*ProbeResponse) GetRelayed ¶
func (x *ProbeResponse) GetRelayed() bool
func (*ProbeResponse) GetRttUs ¶
func (x *ProbeResponse) GetRttUs() uint32
func (*ProbeResponse) MarshalJSON ¶
func (x *ProbeResponse) MarshalJSON() ([]byte, error)
MarshalJSON marshals the ProbeResponse to JSON.
func (*ProbeResponse) MarshalProtoJSON ¶
func (x *ProbeResponse) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the ProbeResponse message to JSON.
func (*ProbeResponse) MarshalProtoText ¶
func (x *ProbeResponse) MarshalProtoText() string
func (*ProbeResponse) MarshalToSizedBufferVT ¶
func (m *ProbeResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*ProbeResponse) MarshalToVT ¶
func (m *ProbeResponse) MarshalToVT(dAtA []byte) (int, error)
func (*ProbeResponse) MarshalVT ¶
func (m *ProbeResponse) MarshalVT() (dAtA []byte, err error)
func (*ProbeResponse) ProtoMessage ¶
func (*ProbeResponse) ProtoMessage()
func (*ProbeResponse) Reset ¶
func (x *ProbeResponse) Reset()
func (*ProbeResponse) SizeVT ¶
func (m *ProbeResponse) SizeVT() (n int)
func (*ProbeResponse) String ¶
func (x *ProbeResponse) String() string
func (*ProbeResponse) UnmarshalJSON ¶
func (x *ProbeResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the ProbeResponse from JSON.
func (*ProbeResponse) UnmarshalProtoJSON ¶
func (x *ProbeResponse) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the ProbeResponse message from JSON.
func (*ProbeResponse) UnmarshalVT ¶
func (m *ProbeResponse) UnmarshalVT(dAtA []byte) error
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
Relay supplies relay credentials from the creator's sign-in to one local peer's links, for the PCs that cannot link directly. Without them a link still tries the direct path.
func (*Relay) GetControllerInfo ¶
func (r *Relay) GetControllerInfo() *controller.Info
GetControllerInfo identifies the relay credentials.
type RelayCredentials ¶
type RelayCredentials struct {
// servers are the relay servers the peer may use.
Servers []*RelayServer `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"`
// expires_at is when the credentials stop working, in Unix milliseconds.
ExpiresAt int64 `protobuf:"varint,2,opt,name=expires_at,json=expiresAt,proto3" json:"expiresAt,omitempty"`
// contains filtered or unexported fields
}
RelayCredentials answers GET /api/turn-credentials, which issues short-lived relay credentials to a signed-in creator.
func (*RelayCredentials) CloneMessageVT ¶
func (m *RelayCredentials) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*RelayCredentials) CloneVT ¶
func (m *RelayCredentials) CloneVT() *RelayCredentials
func (*RelayCredentials) EqualMessageVT ¶
func (this *RelayCredentials) EqualMessageVT(thatMsg any) bool
func (*RelayCredentials) EqualVT ¶
func (this *RelayCredentials) EqualVT(that *RelayCredentials) bool
func (*RelayCredentials) GetExpiresAt ¶
func (x *RelayCredentials) GetExpiresAt() int64
func (*RelayCredentials) GetServers ¶
func (x *RelayCredentials) GetServers() []*RelayServer
func (*RelayCredentials) MarshalJSON ¶
func (x *RelayCredentials) MarshalJSON() ([]byte, error)
MarshalJSON marshals the RelayCredentials to JSON.
func (*RelayCredentials) MarshalProtoJSON ¶
func (x *RelayCredentials) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the RelayCredentials message to JSON.
func (*RelayCredentials) MarshalProtoText ¶
func (x *RelayCredentials) MarshalProtoText() string
func (*RelayCredentials) MarshalToSizedBufferVT ¶
func (m *RelayCredentials) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*RelayCredentials) MarshalToVT ¶
func (m *RelayCredentials) MarshalToVT(dAtA []byte) (int, error)
func (*RelayCredentials) MarshalVT ¶
func (m *RelayCredentials) MarshalVT() (dAtA []byte, err error)
func (*RelayCredentials) ProtoMessage ¶
func (*RelayCredentials) ProtoMessage()
func (*RelayCredentials) Reset ¶
func (x *RelayCredentials) Reset()
func (*RelayCredentials) SizeVT ¶
func (m *RelayCredentials) SizeVT() (n int)
func (*RelayCredentials) String ¶
func (x *RelayCredentials) String() string
func (*RelayCredentials) UnmarshalJSON ¶
func (x *RelayCredentials) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the RelayCredentials from JSON.
func (*RelayCredentials) UnmarshalProtoJSON ¶
func (x *RelayCredentials) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the RelayCredentials message from JSON.
func (*RelayCredentials) UnmarshalVT ¶
func (m *RelayCredentials) UnmarshalVT(dAtA []byte) error
type RelayServer ¶
type RelayServer struct {
// urls are the server's STUN and TURN addresses.
Urls []string `protobuf:"bytes,1,rep,name=urls,proto3" json:"urls,omitempty"`
// username is the credential's identifier.
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
// credential is the credential's secret.
Credential string `protobuf:"bytes,3,opt,name=credential,proto3" json:"credential,omitempty"`
// contains filtered or unexported fields
}
RelayServer is one relay and its credential.
func (*RelayServer) CloneMessageVT ¶
func (m *RelayServer) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*RelayServer) CloneVT ¶
func (m *RelayServer) CloneVT() *RelayServer
func (*RelayServer) EqualMessageVT ¶
func (this *RelayServer) EqualMessageVT(thatMsg any) bool
func (*RelayServer) EqualVT ¶
func (this *RelayServer) EqualVT(that *RelayServer) bool
func (*RelayServer) GetCredential ¶
func (x *RelayServer) GetCredential() string
func (*RelayServer) GetUrls ¶
func (x *RelayServer) GetUrls() []string
func (*RelayServer) GetUsername ¶
func (x *RelayServer) GetUsername() string
func (*RelayServer) MarshalJSON ¶
func (x *RelayServer) MarshalJSON() ([]byte, error)
MarshalJSON marshals the RelayServer to JSON.
func (*RelayServer) MarshalProtoJSON ¶
func (x *RelayServer) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the RelayServer message to JSON.
func (*RelayServer) MarshalProtoText ¶
func (x *RelayServer) MarshalProtoText() string
func (*RelayServer) MarshalToSizedBufferVT ¶
func (m *RelayServer) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*RelayServer) MarshalToVT ¶
func (m *RelayServer) MarshalToVT(dAtA []byte) (int, error)
func (*RelayServer) MarshalVT ¶
func (m *RelayServer) MarshalVT() (dAtA []byte, err error)
func (*RelayServer) ProtoMessage ¶
func (*RelayServer) ProtoMessage()
func (*RelayServer) Reset ¶
func (x *RelayServer) Reset()
func (*RelayServer) SizeVT ¶
func (m *RelayServer) SizeVT() (n int)
func (*RelayServer) String ¶
func (x *RelayServer) String() string
func (*RelayServer) UnmarshalJSON ¶
func (x *RelayServer) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the RelayServer from JSON.
func (*RelayServer) UnmarshalProtoJSON ¶
func (x *RelayServer) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the RelayServer message from JSON.
func (*RelayServer) UnmarshalVT ¶
func (m *RelayServer) UnmarshalVT(dAtA []byte) error
type SRPCPeerNetClient ¶
type SRPCPeerNetClient interface {
// SRPCClient returns the underlying SRPC client.
SRPCClient() srpc.Client
// GetPeer returns the daemon's peer and its admission to signaling.
GetPeer(ctx context.Context, in *GetPeerRequest) (*GetPeerResponse, error)
// Probe opens a stream to another peer and measures its round trip.
Probe(ctx context.Context, in *ProbeRequest) (*ProbeResponse, error)
// Host serves the local game server to guests holding the join code it
// sends first, for as long as the call stays open.
Host(ctx context.Context, in *HostRequest) (SRPCPeerNet_HostClient, error)
// Join links to a hosted game server and serves it to the local game on a
// loopback port until the game leaves or the call ends.
Join(ctx context.Context, in *JoinRequest) (SRPCPeerNet_JoinClient, error)
}
func NewSRPCPeerNetClient ¶
func NewSRPCPeerNetClient(cc srpc.Client) SRPCPeerNetClient
func NewSRPCPeerNetClientWithServiceID ¶
func NewSRPCPeerNetClientWithServiceID(cc srpc.Client, serviceID string) SRPCPeerNetClient
type SRPCPeerNetHandler ¶
type SRPCPeerNetHandler struct {
// contains filtered or unexported fields
}
func (SRPCPeerNetHandler) GetMethodIDs ¶
func (SRPCPeerNetHandler) GetMethodIDs() []string
func (*SRPCPeerNetHandler) GetServiceID ¶
func (d *SRPCPeerNetHandler) GetServiceID() string
func (*SRPCPeerNetHandler) InvokeMethod ¶
func (SRPCPeerNetHandler) InvokeMethod_GetPeer ¶
func (SRPCPeerNetHandler) InvokeMethod_GetPeer(impl SRPCPeerNetServer, strm srpc.Stream) error
func (SRPCPeerNetHandler) InvokeMethod_Host ¶
func (SRPCPeerNetHandler) InvokeMethod_Host(impl SRPCPeerNetServer, strm srpc.Stream) error
func (SRPCPeerNetHandler) InvokeMethod_Join ¶
func (SRPCPeerNetHandler) InvokeMethod_Join(impl SRPCPeerNetServer, strm srpc.Stream) error
func (SRPCPeerNetHandler) InvokeMethod_Probe ¶
func (SRPCPeerNetHandler) InvokeMethod_Probe(impl SRPCPeerNetServer, strm srpc.Stream) error
type SRPCPeerNetServer ¶
type SRPCPeerNetServer interface {
// GetPeer returns the daemon's peer and its admission to signaling.
GetPeer(context.Context, *GetPeerRequest) (*GetPeerResponse, error)
// Probe opens a stream to another peer and measures its round trip.
Probe(context.Context, *ProbeRequest) (*ProbeResponse, error)
// Host serves the local game server to guests holding the join code it
// sends first, for as long as the call stays open.
Host(*HostRequest, SRPCPeerNet_HostStream) error
// Join links to a hosted game server and serves it to the local game on a
// loopback port until the game leaves or the call ends.
Join(*JoinRequest, SRPCPeerNet_JoinStream) error
}
type SRPCPeerNet_HostClient ¶
type SRPCPeerNet_HostStream ¶
type SRPCPeerNet_JoinClient ¶
type SRPCPeerNet_JoinStream ¶
type SRPCPeerNet_ProbeStream ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service runs a PC's peer with its admission and relay credentials, and serves the PeerNet service for it. Its calls wait for Run to load the key, so a daemon can register the service before it holds its state directory.
func NewService ¶
NewService constructs the peer whose key lives at keyPath, signaling at origin.
func (*Service) GetPeer ¶
func (s *Service) GetPeer(ctx context.Context, _ *GetPeerRequest) (*GetPeerResponse, error)
GetPeer returns the peer and its admission. A call also asks the admission to read the sign-in again, since a client may have just signed in.
func (*Service) Host ¶
func (s *Service) Host(req *HostRequest, strm SRPCPeerNet_HostStream) error
Host serves the local game server to guests holding the join code it sends first, until the call ends.
func (*Service) Join ¶
func (s *Service) Join(req *JoinRequest, strm SRPCPeerNet_JoinStream) error
Join links to the session the code names and serves it to the local game on a loopback port until the game leaves or the call ends.
func (*Service) Probe ¶
func (s *Service) Probe(ctx context.Context, req *ProbeRequest) (*ProbeResponse, error)
Probe measures the link to another peer once the local peer is ready.