tunnel

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int    `json:"statusCode"`
	Message    string `json:"error"`
}

APIError represents an error returned by the API.

func (APIError) Error

func (a APIError) Error() string

type Backend

type Backend interface {
	ListClusterTunnelEndpoints(ctx context.Context) ([]Endpoint, error)
}

Backend is able to call hub-tunnel API.

type Client

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

Client allows interacting with the tunnel service.

func NewClient

func NewClient(baseURL, token string) (*Client, error)

NewClient creates a new client for the tunnel service.

func (*Client) ListClusterTunnelEndpoints

func (c *Client) ListClusterTunnelEndpoints(ctx context.Context) ([]Endpoint, error)

ListClusterTunnelEndpoints lists all tunnels the agent needs to open.

type Endpoint

type Endpoint struct {
	TunnelID       string `json:"tunnelId"`
	BrokerEndpoint string `json:"brokerEndpoint"`
}

Endpoint represents a tunnel endpoint.

type Manager

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

Manager manages tunnels.

func NewManager

func NewManager(tunnels Backend, traefikTunnelAddr, token string) Manager

NewManager returns a new manager instance.

func (*Manager) Run

func (m *Manager) Run(ctx context.Context)

Run runs the manager. While running, the manager fetches every minute the tunnels available for this cluster and create/delete tunnels accordingly.

Jump to

Keyboard shortcuts

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