Documentation
¶
Index ¶
- Constants
- func WithTunnelOptions(ctx context.Context, opts TunnelOptions) context.Context
- type Addr
- type Authentication
- type Endpoint
- type EndpointListener
- type EndpointWatch
- type GameProfile
- type GameProfileProperty
- type Listener
- type Player
- type ReceiveProposal
- type RejectionReason
- type Session
- type SessionProposal
- type SessionRejection
- type Tunnel
- type TunnelListener
- type TunnelOptions
- type Tunneler
- type WatchRequest
- type WatchResponse
- type Watcher
Constants ¶
const ( MDPrefix = "connect-" // The prefix of Connect metadata keys. MDSession = MDPrefix + "session" // Metadata key specifying the session id for a Tunnel. MDEndpoint = MDPrefix + "endpoint" // Metadata key specifying the watching Endpoint. )
Well-known headers / metadata keys
Variables ¶
This section is empty.
Functions ¶
func WithTunnelOptions ¶ added in v0.4.0
func WithTunnelOptions(ctx context.Context, opts TunnelOptions) context.Context
WithTunnelOptions stores TunnelOptions in a context.
Types ¶
type Authentication ¶ added in v0.2.0
type Authentication = pb.Authentication
Type alias to better support updating versions. See the referenced type for documentation.
Other go files should only ever use the provided alias type and never import a specific proto version.
type Endpoint ¶
Endpoint is an endpoint that listens for sessions to either reject them or establish a tunnel for receiving the connection.
type EndpointListener ¶ added in v0.4.0
type EndpointListener interface {
AcceptEndpoint(context.Context, EndpointWatch) error
}
EndpointListener is a network listener for endpoint watches.
type EndpointWatch ¶ added in v0.4.0
type EndpointWatch interface { // Propose proposes a session to the Endpoint. // The Endpoint either rejects the proposal or initiates // a Tunnel to receive the session connection. Propose(context.Context, *Session) error Rejections() <-chan *SessionRejection // Rejections receives rejected session proposals from the Endpoint. }
EndpointWatch is a watching Endpoint.
type GameProfile ¶
type GameProfile = pb.GameProfile
Type alias to better support updating versions. See the referenced type for documentation.
Other go files should only ever use the provided alias type and never import a specific proto version.
type GameProfileProperty ¶
type GameProfileProperty = pb.GameProfileProperty
Type alias to better support updating versions. See the referenced type for documentation.
Other go files should only ever use the provided alias type and never import a specific proto version.
type Listener ¶ added in v0.4.0
type Listener interface { EndpointListener TunnelListener }
Listener listens for watching endpoints and tunnel connections from endpoints.
type Player ¶
Type alias to better support updating versions. See the referenced type for documentation.
Other go files should only ever use the provided alias type and never import a specific proto version.
type ReceiveProposal ¶ added in v0.4.0
type ReceiveProposal func(proposal SessionProposal) error
ReceiveProposal is called when Watcher receives a SessionProposal.
type RejectionReason ¶
Type alias to better support updating versions. See the referenced type for documentation.
Other go files should only ever use the provided alias type and never import a specific proto version.
type Session ¶
Type alias to better support updating versions. See the referenced type for documentation.
Other go files should only ever use the provided alias type and never import a specific proto version.
type SessionProposal ¶
type SessionProposal interface { Session() *Session // The session proposed to connect to the Endpoint. Reject(context.Context, *RejectionReason) error // Rejects the session proposal with an optional reason. }
SessionProposal specifies an incoming session proposal. Use the Session to create the connection tunnel or reject the session with an optional reason.
type SessionRejection ¶
type SessionRejection = pb.SessionRejection
Type alias to better support updating versions. See the referenced type for documentation.
Other go files should only ever use the provided alias type and never import a specific proto version.
type Tunnel ¶
Tunnel represents an outbound only tunnel initiated by an Endpoint for a specific SessionProposal.
type TunnelListener ¶ added in v0.4.0
TunnelListener is a network listener for tunnel connections.
type TunnelOptions ¶
type TunnelOptions struct { // LocalAddr fakes the local address of the Tunnel when specified. // // If this TunnelOptions destine to Tunneler // it is recommended to use the Endpoint address/name. // // If this TunnelOptions destine to TunnelListener // it is recommended to use the underlying network listener address. LocalAddr net.Addr // RemoteAddr fakes the remote address of the Tunnel when specified. // // If this TunnelOptions destine to Tunneler // it is recommended to use the underlying connection remote address. // // If this TunnelOptions destine to TunnelListener // it is recommended to use the Endpoint address/name. RemoteAddr net.Addr // It is recommended to use the player address. }
TunnelOptions are options for Tunneler and TunnelListener. Use WithTunnelOptions to propagate TunnelOptions in context.
type WatchRequest ¶
type WatchRequest = pb.WatchRequest
Type alias to better support updating versions. See the referenced type for documentation.
Other go files should only ever use the provided alias type and never import a specific proto version.
type WatchResponse ¶
type WatchResponse = pb.WatchResponse
Type alias to better support updating versions. See the referenced type for documentation.
Other go files should only ever use the provided alias type and never import a specific proto version.