connect

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAssetNotFound                 = errors.New("asset not found")
	ErrAssetAmbiguous                = errors.New("asset is ambiguous")
	ErrAccountNotFound               = errors.New("account not found")
	ErrAccountAmbiguous              = errors.New("account is ambiguous")
	ErrInteractiveCredentialRequired = errors.New("interactive account credential is required")
)

Functions

func ResolveAsset

func ResolveAsset(ctx context.Context, api AssetAPI, reference string) (jumpserver.AssetDetail, error)

Types

type API

type API interface {
	AssetAPI
	CreateConnectionToken(context.Context, jumpserver.ConnectionRequest) (string, error)
	GetClientConnection(context.Context, string) (jumpserver.ClientConnection, error)
}

type AssetAPI

type AssetAPI interface {
	ListAssets(context.Context, jumpserver.AssetQuery) (jumpserver.AssetPage, error)
	GetAsset(context.Context, string) (jumpserver.AssetDetail, error)
}

type ConfigLoader

type ConfigLoader interface {
	Load() (projectconfig.Config, error)
}

type Options

type Options struct {
	Target         target.Input
	Protocol       string
	NonInteractive bool
	SelectAccount  func([]jumpserver.Account) (jumpserver.Account, error)
}

type Prepared

type Prepared struct {
	Selection  target.Selection
	Asset      jumpserver.AssetDetail
	Account    jumpserver.Account
	Connection jumpserver.ClientConnection
}

type Service

type Service struct {
	Config ConfigLoader
	Tokens TokenManager
	NewAPI func(site, accessToken, organization string) (API, error)
}

func (Service) Prepare

func (s Service) Prepare(ctx context.Context, options Options) (Prepared, error)

type TokenManager

type TokenManager interface {
	EnsureFresh(context.Context, string) (credential.Token, error)
}

Jump to

Keyboard shortcuts

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