pogs

package
v0.0.0-...-628176a Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigurationManager_ServerToClient

func ConfigurationManager_ServerToClient(c ConfigurationManager) proto.ConfigurationManager

func MarshalError

func MarshalError(s proto.ConnectionError, err error) error

func RegistrationServer_ServerToClient

func RegistrationServer_ServerToClient(s RegistrationServer) proto.RegistrationServer

func SessionManager_ServerToClient

func SessionManager_ServerToClient(s SessionManager) proto.SessionManager

Types

type ClientInfo

type ClientInfo struct {
	ClientID []byte `capnp:"clientId"` // must be a slice for capnp compatibility
	Features []string
	Version  string
	Arch     string
}

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

type ConfigurationManager

type ConfigurationManager interface {
	// UpdateConfiguration is the call provided to cloudflared to load the latest remote configuration.
	UpdateConfiguration(ctx context.Context, version int32, config []byte) *UpdateConfigurationResponse
}

type ConfigurationManager_PogsClient

type ConfigurationManager_PogsClient struct {
	Client capnp.Client
	Conn   *rpc.Conn
}

func (ConfigurationManager_PogsClient) Close

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

type ConnectRequest

type ConnectRequest struct {
	Dest     string         `capnp:"dest"`
	Type     ConnectionType `capnp:"type"`
	Metadata []Metadata     `capnp:"metadata"`
}

ConnectRequest is the representation of metadata sent at the start of a QUIC application handshake.

func (*ConnectRequest) FromPogs

func (r *ConnectRequest) FromPogs(msg *capnp.Message) error

func (*ConnectRequest) MetadataMap

func (r *ConnectRequest) MetadataMap() map[string]string

MetadataMap returns a map format of []Metadata.

func (*ConnectRequest) ToPogs

func (r *ConnectRequest) ToPogs() (*capnp.Message, error)

type ConnectResponse

type ConnectResponse struct {
	Error    string     `capnp:"error"`
	Metadata []Metadata `capnp:"metadata"`
}

ConnectResponse is a representation of metadata sent as a response to a QUIC application handshake.

func (*ConnectResponse) FromPogs

func (r *ConnectResponse) FromPogs(msg *capnp.Message) error

func (*ConnectResponse) ToPogs

func (r *ConnectResponse) ToPogs() (*capnp.Message, error)

type ConnectionDetails

type ConnectionDetails struct {
	UUID                    uuid.UUID
	Location                string
	TunnelIsRemotelyManaged bool
}

func (*ConnectionDetails) MarshalCapnproto

func (details *ConnectionDetails) MarshalCapnproto(s proto.ConnectionDetails) error

func (*ConnectionDetails) UnmarshalCapnproto

func (details *ConnectionDetails) UnmarshalCapnproto(s proto.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 proto.ConnectionOptions) error

func (*ConnectionOptions) UnmarshalCapnproto

func (p *ConnectionOptions) UnmarshalCapnproto(s proto.ConnectionOptions) error

type ConnectionType

type ConnectionType uint16

ConnectionType indicates the type of underlying connection proxied within the QUIC stream.

const (
	ConnectionTypeHTTP ConnectionType = iota
	ConnectionTypeWebsocket
	ConnectionTypeTCP
)

func (ConnectionType) String

func (c ConnectionType) String() string

type Metadata

type Metadata struct {
	Key string `capnp:"key"`
	Val string `capnp:"val"`
}

Metadata is a representation of key value based data sent via RequestMeta.

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

func (*RPCError) Error

func (re *RPCError) Error() string

func (*RPCError) Unwrap

func (re *RPCError) Unwrap() error

type RegisterUdpSessionResponse

type RegisterUdpSessionResponse struct {
	Err   error
	Spans []byte // Spans in protobuf format
}

func (*RegisterUdpSessionResponse) Marshal

func (*RegisterUdpSessionResponse) Unmarshal

type RegistrationServer

type RegistrationServer interface {
	// RegisterConnection is the call typically handled by the edge to initiate and authenticate a new connection
	// for cloudflared.
	RegisterConnection(ctx context.Context, auth TunnelAuth, tunnelID uuid.UUID, connIndex byte, options *ConnectionOptions) (*ConnectionDetails, error)
	// UnregisterConnection is the call typically handled by the edge to close an existing connection for cloudflared.
	UnregisterConnection(ctx context.Context)
	// UpdateLocalConfiguration is the call typically handled by the edge for cloudflared to provide the current
	// configuration it is operating with.
	UpdateLocalConfiguration(ctx context.Context, config []byte) error
}

type RegistrationServer_PogsClient

type RegistrationServer_PogsClient struct {
	Client capnp.Client
	Conn   *rpc.Conn
}

func NewRegistrationServer_PogsClient

func NewRegistrationServer_PogsClient(client capnp.Client, conn *rpc.Conn) RegistrationServer_PogsClient

func (RegistrationServer_PogsClient) Close

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 (RegistrationServer_PogsImpl) UnregisterConnection

func (RegistrationServer_PogsImpl) UpdateLocalConfiguration

type RetryableError

type RetryableError struct {
	Delay time.Duration
	// contains filtered or unexported fields
}

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

type SessionManager_PogsClient struct {
	Client capnp.Client
	Conn   *rpc.Conn
}

func NewSessionManager_PogsClient

func NewSessionManager_PogsClient(client capnp.Client, conn *rpc.Conn) SessionManager_PogsClient

func (SessionManager_PogsClient) Close

func (c SessionManager_PogsClient) Close() error

func (SessionManager_PogsClient) RegisterUdpSession

func (c SessionManager_PogsClient) RegisterUdpSession(ctx context.Context, sessionID uuid.UUID, dstIP net.IP, dstPort uint16, closeAfterIdleHint time.Duration, traceContext string) (*RegisterUdpSessionResponse, error)

func (SessionManager_PogsClient) UnregisterUdpSession

func (c SessionManager_PogsClient) UnregisterUdpSession(ctx context.Context, sessionID uuid.UUID, message string) error

type SessionManager_PogsImpl

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

func (SessionManager_PogsImpl) RegisterUdpSession

func (SessionManager_PogsImpl) UnregisterUdpSession

type Tag

type Tag struct {
	Name  string
	Value string
}

Tag previously was a legacy tunnel capnp struct but was deprecated. To help reduce the amount of changes imposed by removing this simple struct, it was copied out of the capnp and provided here instead.

type TunnelAuth

type TunnelAuth struct {
	AccountTag   string
	TunnelSecret []byte
}

func (*TunnelAuth) MarshalCapnproto

func (a *TunnelAuth) MarshalCapnproto(s proto.TunnelAuth) error

func (*TunnelAuth) UnmarshalCapnproto

func (a *TunnelAuth) UnmarshalCapnproto(s proto.TunnelAuth) error

type UpdateConfigurationResponse

type UpdateConfigurationResponse struct {
	LastAppliedVersion int32 `json:"lastAppliedVersion"`
	Err                error `json:"err"`
}

func (*UpdateConfigurationResponse) Marshal

func (*UpdateConfigurationResponse) Unmarshal

Jump to

Keyboard shortcuts

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