proxy

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAgentNotFound                      = errors.New("agent not found")
	ErrCredentialFetchNotSupportedByAgent = errors.New("agent does not support credentials fetching")
)

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ConnectedAtIso8601     string `json:"connectedAtIso8601,omitempty"`
	NodeIP                 string `json:"nodeIp,omitempty"`
	OrgID                  string `json:"orgId,omitempty"`
	EnvID                  string `json:"envId,omitempty"`
	K8SClusterRoleSupport  bool   `json:"k8sClusterRoleSupport,omitempty"`
	AgentIdentifier        string `json:"agentIdentifier,omitempty"`
	AgentVersion           string `json:"agentVersion,omitempty"`
	IPAddress              string `json:"ipAddress,omitempty"`
	LastHeartbeatAtIso8601 string `json:"lastHeartbeatAtIso8601,omitempty"`
	StreamID               string `json:"streamId,omitempty"`
}

type AgentGroup

type AgentGroup struct {
	AgentIdentifier string `json:"agentIdentifier"`
	OrganizationId  string `json:"orgId"`
	EnvironmentId   string `json:"envId"`
}

type KubernetesCredentials

type KubernetesCredentials struct {
	Error                        string `json:"error"`
	StackTrace                   string `json:"stackTrace"`
	RootCaBase64EncodedByteArray string `json:"rootCa"`
	TokenBase64EncodedByteArray  string `json:"tokenFile"`
	Host                         string `json:"host"`
	Port                         int32  `json:"port"`
}

type SessionCredentials

type SessionCredentials struct {
	User                  string                `json:"user"`
	Password              string                `json:"password"`
	Host                  string                `json:"host"`
	Port                  int                   `json:"port"`
	ExpiresAt             time.Time             `json:"expiresAtIso8601"`
	KubernetesCredentials KubernetesCredentials `json:"kubernetesCredentials"`
}

type SessionOverrides

type SessionOverrides struct {
	User string
	Host string
	Port int
}

type WormholeService

type WormholeService struct {
	WormholeBaseUrl  string
	TokenSupplier    tokenSupplier
	SessionOverrides *SessionOverrides
	// contains filtered or unexported fields
}

func New

func New(baseURL string, overrides *SessionOverrides, tokenSupplier tokenSupplier) *WormholeService

func NewWithLogger

func NewWithLogger(baseURL string, overrides *SessionOverrides, tokenSupplier tokenSupplier, log *zap.SugaredLogger) *WormholeService

func (*WormholeService) GetKubernetesClusterCredentialsFromAgent

func (ws *WormholeService) GetKubernetesClusterCredentialsFromAgent(ctx context.Context, agentGroup *AgentGroup) (*KubernetesCredentials, error)

func (*WormholeService) GetProxyConfiguredTransport

func (ws *WormholeService) GetProxyConfiguredTransport(ctx context.Context, agentGroup *AgentGroup) (*http.Transport, error)

func (*WormholeService) GetProxyEnabledClusterConfig

func (ws *WormholeService) GetProxyEnabledClusterConfig(ctx context.Context, agentGroup *AgentGroup) (*rest.Config, error)

func (*WormholeService) GetProxyFunction

func (ws *WormholeService) GetProxyFunction(ctx context.Context, agentGroup *AgentGroup) (func(*http.Request) (*url.URL, error), error)

func (*WormholeService) ListAgents

func (ws *WormholeService) ListAgents(ctx context.Context, orgID, envID string) ([]*Agent, error)

Jump to

Keyboard shortcuts

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