router

package
v17.3.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayURLQuerier

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

func NewGatewayURLQuerier

func NewGatewayURLQuerier(kubeClient kubernetes.Interface, namespace, podLabelSelector, urlScheme, urlPort string) *GatewayURLQuerier

func (*GatewayURLQuerier) CachedGatewayURLs

func (q *GatewayURLQuerier) CachedGatewayURLs(agentID int64) []string

func (*GatewayURLQuerier) PollGatewayURLs

func (q *GatewayURLQuerier) PollGatewayURLs(ctx context.Context, agentID int64, cb tunserver.PollGatewayURLsCallback)

func (*GatewayURLQuerier) Run

func (q *GatewayURLQuerier) Run(ctx context.Context) error

type Plugin

type Plugin struct {
	Registry              *Registry
	AgentkPool            grpctool.PoolInterface
	GatewayQuerier        tunserver.PollingGatewayURLQuerier
	API                   modshared.API
	OwnPrivateAPIURL      string
	Creds                 credentials.PerRPCCredentials
	PollConfig            retry.PollConfigFactory
	TryNewGatewayInterval time.Duration
	TunnelFindTimeout     time.Duration
}

func (*Plugin) FindReadyGateway

func (p *Plugin) FindReadyGateway(ctx context.Context, log *slog.Logger, method string) (tunserver.ReadyGateway, *slog.Logger, int64, error)

func (*Plugin) FindTunnel

func (p *Plugin) FindTunnel(stream grpc.ServerStream, rpcAPI modshared.RPCAPI) (bool, *slog.Logger, tunserver.FindHandle, error)

func (*Plugin) PrepareStreamForForwarding

func (p *Plugin) PrepareStreamForForwarding(stream grpc.ServerStream) (grpc.ServerStream, error)

type Registry

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

func NewRegistry

func NewRegistry(log *slog.Logger) *Registry

func (*Registry) FindTunnel

func (r *Registry) FindTunnel(ctx context.Context, service, method string) (bool, tunserver.FindHandle)

func (*Registry) HandleTunnel

func (r *Registry) HandleTunnel(ageCtx context.Context, server rpc.ReverseTunnel_ConnectServer) error

HandleTunnel is called with server-side interface of the reverse tunnel. It registers the tunnel and blocks, waiting for a request to proxy through the tunnel. The method returns the error value to return to gRPC framework. ageCtx can be used to unblock the method if the tunnel is not being used already.

Jump to

Keyboard shortcuts

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