Documentation ¶
Index ¶
- func CloudflaredServer_ServerToClient(s SessionManager, c ConfigurationManager) tunnelrpc.CloudflaredServer
- func ConfigurationManager_ServerToClient(c ConfigurationManager) tunnelrpc.ConfigurationManager
- func MarshalAuthenticateResponse(s tunnelrpc.AuthenticateResponse, p *AuthenticateResponse) error
- func MarshalAuthentication(s tunnelrpc.Authentication, p *Authentication) error
- func MarshalError(s tunnelrpc.ConnectionError, err error) error
- func MarshalRegistrationOptions(s tunnelrpc.RegistrationOptions, p *RegistrationOptions) error
- func MarshalServerInfo(s tunnelrpc.ServerInfo, p *ServerInfo) error
- func MarshalTunnelRegistration(s tunnelrpc.TunnelRegistration, p *TunnelRegistration) error
- func RegistrationServer_ServerToClient(s RegistrationServer) tunnelrpc.RegistrationServer
- func SessionManager_ServerToClient(s SessionManager) tunnelrpc.SessionManager
- func TunnelServer_ServerToClient(s TunnelServer) tunnelrpc.TunnelServer
- type AuthFail
- type AuthOutcome
- type AuthSuccess
- type AuthUnknown
- type AuthenticateResponse
- type Authentication
- type ClientInfo
- type CloudflaredServer
- type CloudflaredServer_PogsClient
- type CloudflaredServer_PogsImpl
- type ConfigurationManager
- type ConfigurationManager_PogsClient
- type ConfigurationManager_PogsImpl
- type ConnectionDetails
- type ConnectionOptions
- type PermanentRegistrationError
- type RPCError
- type RegisterUdpSessionResponse
- type RegistrationOptions
- type RegistrationServer
- type RegistrationServer_PogsClient
- func (c RegistrationServer_PogsClient) Close() error
- func (c RegistrationServer_PogsClient) RegisterConnection(ctx context.Context, auth TunnelAuth, tunnelID uuid.UUID, connIndex byte, ...) (*ConnectionDetails, error)
- func (c RegistrationServer_PogsClient) SendLocalConfiguration(ctx context.Context, config []byte) error
- func (c RegistrationServer_PogsClient) UnregisterConnection(ctx context.Context) error
- type RegistrationServer_PogsImpl
- func (i RegistrationServer_PogsImpl) RegisterConnection(p tunnelrpc.RegistrationServer_registerConnection) error
- func (i RegistrationServer_PogsImpl) UnregisterConnection(p tunnelrpc.RegistrationServer_unregisterConnection) error
- func (i RegistrationServer_PogsImpl) UpdateLocalConfiguration(c tunnelrpc.RegistrationServer_updateLocalConfiguration) error
- type RetryableError
- type RetryableRegistrationError
- type ServerInfo
- type SessionManager
- type SessionManager_PogsClient
- func (c SessionManager_PogsClient) Close() error
- func (c SessionManager_PogsClient) RegisterUdpSession(ctx context.Context, sessionID uuid.UUID, dstIP net.IP, dstPort uint16, ...) (*RegisterUdpSessionResponse, error)
- func (c SessionManager_PogsClient) UnregisterUdpSession(ctx context.Context, sessionID uuid.UUID, message string) error
- type SessionManager_PogsImpl
- type SuccessfulTunnelRegistration
- type Tag
- type TunnelAuth
- type TunnelRegistration
- type TunnelRegistrationError
- type TunnelServer
- type TunnelServer_PogsClient
- func (c TunnelServer_PogsClient) Authenticate(ctx context.Context, originCert []byte, hostname string, ...) (*AuthenticateResponse, error)
- func (c TunnelServer_PogsClient) Close() error
- func (c TunnelServer_PogsClient) GetServerInfo(ctx context.Context) (*ServerInfo, error)
- func (c TunnelServer_PogsClient) ReconnectTunnel(ctx context.Context, jwt, eventDigest []byte, connDigest []byte, ...) *TunnelRegistration
- func (c TunnelServer_PogsClient) RegisterTunnel(ctx context.Context, originCert []byte, hostname string, ...) *TunnelRegistration
- func (c TunnelServer_PogsClient) UnregisterTunnel(ctx context.Context, gracePeriodNanoSec int64) error
- type TunnelServer_PogsImpl
- func (i TunnelServer_PogsImpl) Authenticate(p tunnelrpc.TunnelServer_authenticate) error
- func (i TunnelServer_PogsImpl) GetServerInfo(p tunnelrpc.TunnelServer_getServerInfo) error
- func (i TunnelServer_PogsImpl) ObsoleteDeclarativeTunnelConnect(p tunnelrpc.TunnelServer_obsoleteDeclarativeTunnelConnect) error
- func (i TunnelServer_PogsImpl) ReconnectTunnel(p tunnelrpc.TunnelServer_reconnectTunnel) error
- func (i TunnelServer_PogsImpl) RegisterTunnel(p tunnelrpc.TunnelServer_registerTunnel) error
- func (i TunnelServer_PogsImpl) UnregisterTunnel(p tunnelrpc.TunnelServer_unregisterTunnel) error
- type UpdateConfigurationResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloudflaredServer_ServerToClient ¶
func CloudflaredServer_ServerToClient(s SessionManager, c ConfigurationManager) tunnelrpc.CloudflaredServer
func ConfigurationManager_ServerToClient ¶
func ConfigurationManager_ServerToClient(c ConfigurationManager) tunnelrpc.ConfigurationManager
func MarshalAuthenticateResponse ¶
func MarshalAuthenticateResponse(s tunnelrpc.AuthenticateResponse, p *AuthenticateResponse) error
func MarshalAuthentication ¶
func MarshalAuthentication(s tunnelrpc.Authentication, p *Authentication) error
func MarshalError ¶
func MarshalError(s tunnelrpc.ConnectionError, err error) error
func MarshalRegistrationOptions ¶
func MarshalRegistrationOptions(s tunnelrpc.RegistrationOptions, p *RegistrationOptions) error
func MarshalServerInfo ¶
func MarshalServerInfo(s tunnelrpc.ServerInfo, p *ServerInfo) error
func MarshalTunnelRegistration ¶
func MarshalTunnelRegistration(s tunnelrpc.TunnelRegistration, p *TunnelRegistration) error
func RegistrationServer_ServerToClient ¶
func RegistrationServer_ServerToClient(s RegistrationServer) tunnelrpc.RegistrationServer
func SessionManager_ServerToClient ¶
func SessionManager_ServerToClient(s SessionManager) tunnelrpc.SessionManager
func TunnelServer_ServerToClient ¶
func TunnelServer_ServerToClient(s TunnelServer) tunnelrpc.TunnelServer
Types ¶
type AuthFail ¶
type AuthFail struct {
// contains filtered or unexported fields
}
AuthFail means this cloudflared has the wrong auth and should exit.
func NewAuthFail ¶
func (AuthFail) Serialize ¶
func (ao AuthFail) Serialize() AuthenticateResponse
Serialize into an AuthenticateResponse which can be sent via Capnp
type AuthOutcome ¶
type AuthOutcome interface { // Serialize into an AuthenticateResponse which can be sent via Capnp Serialize() AuthenticateResponse // contains filtered or unexported methods }
AuthOutcome is a programmer-friendly sum type denoting the possible outcomes of Authenticate.
type AuthSuccess ¶
type AuthSuccess struct {
// contains filtered or unexported fields
}
AuthSuccess means the backend successfully authenticated this cloudflared.
func NewAuthSuccess ¶
func NewAuthSuccess(jwt []byte, hoursUntilRefresh uint8) AuthSuccess
func (AuthSuccess) JWT ¶
func (ao AuthSuccess) JWT() []byte
func (AuthSuccess) RefreshAfter ¶
func (ao AuthSuccess) RefreshAfter() time.Duration
RefreshAfter is how long cloudflared should wait before rerunning Authenticate.
func (AuthSuccess) Serialize ¶
func (ao AuthSuccess) Serialize() AuthenticateResponse
Serialize into an AuthenticateResponse which can be sent via Capnp
type AuthUnknown ¶
type AuthUnknown struct {
// contains filtered or unexported fields
}
AuthUnknown means the backend couldn't finish checking authentication. Try again later.
func NewAuthUnknown ¶
func NewAuthUnknown(err error, hoursUntilRefresh uint8) AuthUnknown
func (AuthUnknown) Error ¶
func (ao AuthUnknown) Error() string
func (AuthUnknown) RefreshAfter ¶
func (ao AuthUnknown) RefreshAfter() time.Duration
RefreshAfter is how long cloudflared should wait before rerunning Authenticate.
func (AuthUnknown) Serialize ¶
func (ao AuthUnknown) Serialize() AuthenticateResponse
Serialize into an AuthenticateResponse which can be sent via Capnp
type AuthenticateResponse ¶
type AuthenticateResponse struct { PermanentErr string RetryableErr string Jwt []byte HoursUntilRefresh uint8 }
AuthenticateResponse is the serialized response from the Authenticate RPC. It's a 1:1 representation of the capnp message, so it's not very useful for programmers. Instead, you should call the `Outcome()` method to get a programmer-friendly sum type, with one case for each possible outcome.
func UnmarshalAuthenticateResponse ¶
func UnmarshalAuthenticateResponse(s tunnelrpc.AuthenticateResponse) (*AuthenticateResponse, error)
func (AuthenticateResponse) Outcome ¶
func (ar AuthenticateResponse) Outcome() AuthOutcome
Outcome turns the deserialized response of Authenticate into a programmer-friendly sum type.
type Authentication ¶
func UnmarshalAuthentication ¶
func UnmarshalAuthentication(s tunnelrpc.Authentication) (*Authentication, error)
type ClientInfo ¶
type CloudflaredServer ¶
type CloudflaredServer interface { SessionManager ConfigurationManager }
type CloudflaredServer_PogsClient ¶
type CloudflaredServer_PogsClient struct { SessionManager_PogsClient ConfigurationManager_PogsClient Client capnp.Client Conn *rpc.Conn }
func NewCloudflaredServer_PogsClient ¶
func NewCloudflaredServer_PogsClient(client capnp.Client, conn *rpc.Conn) CloudflaredServer_PogsClient
func (CloudflaredServer_PogsClient) Close ¶
func (c CloudflaredServer_PogsClient) Close() error
type CloudflaredServer_PogsImpl ¶
type CloudflaredServer_PogsImpl struct { SessionManager_PogsImpl ConfigurationManager_PogsImpl }
type ConfigurationManager ¶
type ConfigurationManager interface {
UpdateConfiguration(ctx context.Context, version int32, config []byte) *UpdateConfigurationResponse
}
type ConfigurationManager_PogsClient ¶
func (ConfigurationManager_PogsClient) Close ¶
func (c ConfigurationManager_PogsClient) Close() error
func (ConfigurationManager_PogsClient) UpdateConfiguration ¶
func (c ConfigurationManager_PogsClient) UpdateConfiguration(ctx context.Context, version int32, config []byte) (*UpdateConfigurationResponse, error)
type ConfigurationManager_PogsImpl ¶
type ConfigurationManager_PogsImpl struct {
// contains filtered or unexported fields
}
func (ConfigurationManager_PogsImpl) UpdateConfiguration ¶
func (i ConfigurationManager_PogsImpl) UpdateConfiguration(p tunnelrpc.ConfigurationManager_updateConfiguration) error
type ConnectionDetails ¶
func (*ConnectionDetails) MarshalCapnproto ¶
func (details *ConnectionDetails) MarshalCapnproto(s tunnelrpc.ConnectionDetails) error
func (*ConnectionDetails) UnmarshalCapnproto ¶
func (details *ConnectionDetails) UnmarshalCapnproto(s tunnelrpc.ConnectionDetails) error
type ConnectionOptions ¶
type ConnectionOptions struct { Client ClientInfo OriginLocalIP net.IP `capnp:"originLocalIp"` ReplaceExisting bool CompressionQuality uint8 NumPreviousAttempts uint8 }
func (*ConnectionOptions) MarshalCapnproto ¶
func (p *ConnectionOptions) MarshalCapnproto(s tunnelrpc.ConnectionOptions) error
func (*ConnectionOptions) UnmarshalCapnproto ¶
func (p *ConnectionOptions) UnmarshalCapnproto(s tunnelrpc.ConnectionOptions) error
type PermanentRegistrationError ¶
type PermanentRegistrationError struct {
// contains filtered or unexported fields
}
func (*PermanentRegistrationError) Error ¶
func (pre *PermanentRegistrationError) Error() string
func (*PermanentRegistrationError) IsPermanent ¶
func (*PermanentRegistrationError) IsPermanent() bool
func (*PermanentRegistrationError) Serialize ¶
func (pre *PermanentRegistrationError) Serialize() *TunnelRegistration
type RPCError ¶
type RPCError struct {
// contains filtered or unexported fields
}
RPCError is used to indicate errors returned by the RPC subsystem rather than failure of a remote operation
type RegisterUdpSessionResponse ¶
func (*RegisterUdpSessionResponse) Marshal ¶
func (p *RegisterUdpSessionResponse) Marshal(s tunnelrpc.RegisterUdpSessionResponse) error
func (*RegisterUdpSessionResponse) Unmarshal ¶
func (p *RegisterUdpSessionResponse) Unmarshal(s tunnelrpc.RegisterUdpSessionResponse) error
type RegistrationOptions ¶
type RegistrationOptions struct { ClientID string `capnp:"clientId"` Version string OS string `capnp:"os"` ExistingTunnelPolicy tunnelrpc.ExistingTunnelPolicy PoolName string `capnp:"poolName"` Tags []Tag ConnectionID uint8 `capnp:"connectionId"` OriginLocalIP string `capnp:"originLocalIp"` IsAutoupdated bool `capnp:"isAutoupdated"` RunFromTerminal bool `capnp:"runFromTerminal"` CompressionQuality uint64 `capnp:"compressionQuality"` UUID string `capnp:"uuid"` NumPreviousAttempts uint8 Features []string }
func UnmarshalRegistrationOptions ¶
func UnmarshalRegistrationOptions(s tunnelrpc.RegistrationOptions) (*RegistrationOptions, error)
type RegistrationServer ¶
type RegistrationServer interface { RegisterConnection(ctx context.Context, auth TunnelAuth, tunnelID uuid.UUID, connIndex byte, options *ConnectionOptions) (*ConnectionDetails, error) UnregisterConnection(ctx context.Context) UpdateLocalConfiguration(ctx context.Context, config []byte) error }
type RegistrationServer_PogsClient ¶
func (RegistrationServer_PogsClient) Close ¶
func (c RegistrationServer_PogsClient) Close() error
func (RegistrationServer_PogsClient) RegisterConnection ¶
func (c RegistrationServer_PogsClient) RegisterConnection(ctx context.Context, auth TunnelAuth, tunnelID uuid.UUID, connIndex byte, options *ConnectionOptions) (*ConnectionDetails, error)
func (RegistrationServer_PogsClient) SendLocalConfiguration ¶
func (c RegistrationServer_PogsClient) SendLocalConfiguration(ctx context.Context, config []byte) error
func (RegistrationServer_PogsClient) UnregisterConnection ¶
func (c RegistrationServer_PogsClient) UnregisterConnection(ctx context.Context) error
type RegistrationServer_PogsImpl ¶
type RegistrationServer_PogsImpl struct {
// contains filtered or unexported fields
}
func (RegistrationServer_PogsImpl) RegisterConnection ¶
func (i RegistrationServer_PogsImpl) RegisterConnection(p tunnelrpc.RegistrationServer_registerConnection) error
func (RegistrationServer_PogsImpl) UnregisterConnection ¶
func (i RegistrationServer_PogsImpl) UnregisterConnection(p tunnelrpc.RegistrationServer_unregisterConnection) error
func (RegistrationServer_PogsImpl) UpdateLocalConfiguration ¶
func (i RegistrationServer_PogsImpl) UpdateLocalConfiguration(c tunnelrpc.RegistrationServer_updateLocalConfiguration) error
type RetryableError ¶
func RetryErrorAfter ¶
func RetryErrorAfter(err error, delay time.Duration) *RetryableError
RetryErrorAfter wraps err to indicate that client should retry after delay
func (*RetryableError) Error ¶
func (re *RetryableError) Error() string
func (*RetryableError) Unwrap ¶
func (re *RetryableError) Unwrap() error
type RetryableRegistrationError ¶
type RetryableRegistrationError struct {
// contains filtered or unexported fields
}
func (*RetryableRegistrationError) Error ¶
func (rre *RetryableRegistrationError) Error() string
func (*RetryableRegistrationError) IsPermanent ¶
func (*RetryableRegistrationError) IsPermanent() bool
func (*RetryableRegistrationError) Serialize ¶
func (rre *RetryableRegistrationError) Serialize() *TunnelRegistration
type ServerInfo ¶
type ServerInfo struct {
LocationName string
}
func UnmarshalServerInfo ¶
func UnmarshalServerInfo(s tunnelrpc.ServerInfo) (*ServerInfo, error)
type SessionManager ¶
type SessionManager interface { // RegisterUdpSession is the call provided to cloudflared to handle an incoming // capnproto RegisterUdpSession request from the edge. RegisterUdpSession(ctx context.Context, sessionID uuid.UUID, dstIP net.IP, dstPort uint16, closeAfterIdleHint time.Duration, traceContext string) (*RegisterUdpSessionResponse, error) // UnregisterUdpSession is the call provided to cloudflared to handle an incoming // capnproto UnregisterUdpSession request from the edge. UnregisterUdpSession(ctx context.Context, sessionID uuid.UUID, message string) error }
type SessionManager_PogsClient ¶
func (SessionManager_PogsClient) Close ¶
func (c SessionManager_PogsClient) Close() error
func (SessionManager_PogsClient) RegisterUdpSession ¶
func (SessionManager_PogsClient) UnregisterUdpSession ¶
type SessionManager_PogsImpl ¶
type SessionManager_PogsImpl struct {
// contains filtered or unexported fields
}
func (SessionManager_PogsImpl) RegisterUdpSession ¶
func (i SessionManager_PogsImpl) RegisterUdpSession(p tunnelrpc.SessionManager_registerUdpSession) error
func (SessionManager_PogsImpl) UnregisterUdpSession ¶
func (i SessionManager_PogsImpl) UnregisterUdpSession(p tunnelrpc.SessionManager_unregisterUdpSession) error
type TunnelAuth ¶
func (*TunnelAuth) MarshalCapnproto ¶
func (a *TunnelAuth) MarshalCapnproto(s tunnelrpc.TunnelAuth) error
func (*TunnelAuth) UnmarshalCapnproto ¶
func (a *TunnelAuth) UnmarshalCapnproto(s tunnelrpc.TunnelAuth) error
type TunnelRegistration ¶
type TunnelRegistration struct { SuccessfulTunnelRegistration Err string PermanentFailure bool RetryAfterSeconds uint16 }
func UnmarshalTunnelRegistration ¶
func UnmarshalTunnelRegistration(s tunnelrpc.TunnelRegistration) (*TunnelRegistration, error)
func (TunnelRegistration) DeserializeError ¶
func (tr TunnelRegistration) DeserializeError() TunnelRegistrationError
Not calling this function Error() to avoid confusion with implementing error interface
type TunnelRegistrationError ¶
type TunnelRegistrationError interface { error Serialize() *TunnelRegistration IsPermanent() bool }
func NewPermanentRegistrationError ¶
func NewPermanentRegistrationError(err error) TunnelRegistrationError
func NewRetryableRegistrationError ¶
func NewRetryableRegistrationError(err error, retryAfterSeconds uint16) TunnelRegistrationError
type TunnelServer ¶
type TunnelServer interface { RegistrationServer RegisterTunnel(ctx context.Context, originCert []byte, hostname string, options *RegistrationOptions) *TunnelRegistration GetServerInfo(ctx context.Context) (*ServerInfo, error) UnregisterTunnel(ctx context.Context, gracePeriodNanoSec int64) error Authenticate(ctx context.Context, originCert []byte, hostname string, options *RegistrationOptions) (*AuthenticateResponse, error) ReconnectTunnel(ctx context.Context, jwt, eventDigest, connDigest []byte, hostname string, options *RegistrationOptions) (*TunnelRegistration, error) }
type TunnelServer_PogsClient ¶
type TunnelServer_PogsClient struct { RegistrationServer_PogsClient Client capnp.Client Conn *rpc.Conn }
func (TunnelServer_PogsClient) Authenticate ¶
func (c TunnelServer_PogsClient) Authenticate(ctx context.Context, originCert []byte, hostname string, options *RegistrationOptions) (*AuthenticateResponse, error)
func (TunnelServer_PogsClient) Close ¶
func (c TunnelServer_PogsClient) Close() error
func (TunnelServer_PogsClient) GetServerInfo ¶
func (c TunnelServer_PogsClient) GetServerInfo(ctx context.Context) (*ServerInfo, error)
func (TunnelServer_PogsClient) ReconnectTunnel ¶
func (c TunnelServer_PogsClient) ReconnectTunnel( ctx context.Context, jwt, eventDigest []byte, connDigest []byte, hostname string, options *RegistrationOptions, ) *TunnelRegistration
func (TunnelServer_PogsClient) RegisterTunnel ¶
func (c TunnelServer_PogsClient) RegisterTunnel(ctx context.Context, originCert []byte, hostname string, options *RegistrationOptions) *TunnelRegistration
func (TunnelServer_PogsClient) UnregisterTunnel ¶
func (c TunnelServer_PogsClient) UnregisterTunnel(ctx context.Context, gracePeriodNanoSec int64) error
type TunnelServer_PogsImpl ¶
type TunnelServer_PogsImpl struct { RegistrationServer_PogsImpl // contains filtered or unexported fields }
func (TunnelServer_PogsImpl) Authenticate ¶
func (i TunnelServer_PogsImpl) Authenticate(p tunnelrpc.TunnelServer_authenticate) error
func (TunnelServer_PogsImpl) GetServerInfo ¶
func (i TunnelServer_PogsImpl) GetServerInfo(p tunnelrpc.TunnelServer_getServerInfo) error
func (TunnelServer_PogsImpl) ObsoleteDeclarativeTunnelConnect ¶
func (i TunnelServer_PogsImpl) ObsoleteDeclarativeTunnelConnect(p tunnelrpc.TunnelServer_obsoleteDeclarativeTunnelConnect) error
func (TunnelServer_PogsImpl) ReconnectTunnel ¶
func (i TunnelServer_PogsImpl) ReconnectTunnel(p tunnelrpc.TunnelServer_reconnectTunnel) error
func (TunnelServer_PogsImpl) RegisterTunnel ¶
func (i TunnelServer_PogsImpl) RegisterTunnel(p tunnelrpc.TunnelServer_registerTunnel) error
func (TunnelServer_PogsImpl) UnregisterTunnel ¶
func (i TunnelServer_PogsImpl) UnregisterTunnel(p tunnelrpc.TunnelServer_unregisterTunnel) error
type UpdateConfigurationResponse ¶
type UpdateConfigurationResponse struct { LastAppliedVersion int32 `json:"lastAppliedVersion"` Err error `json:"err"` }
func (*UpdateConfigurationResponse) Marshal ¶
func (p *UpdateConfigurationResponse) Marshal(s tunnelrpc.UpdateConfigurationResponse) error
func (*UpdateConfigurationResponse) Unmarshal ¶
func (p *UpdateConfigurationResponse) Unmarshal(s tunnelrpc.UpdateConfigurationResponse) error