internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const LuaConfigKey = "*__xs_config"

Variables

View Source
var (
	// Version is the version of this software.
	// This value is overwritten by the build script.
	Version = "0.0.0"

	// CommitHash is the git commit hash of this software.
	// This value is overwritten by the build script.
	CommitHash = "unknown"
)
View Source
var ListCommand = &cli.Command{
	Name:                   "list",
	Aliases:                []string{"ls"},
	Usage:                  "List defined hosts",
	UseShortOptionHandling: true,
	Before: func(cCtx *cli.Context) error {

		debuglogger.Get(cCtx).IsDebug = false
		return nil
	},
	Action: listAction,
	Flags: []cli.Flag{
		listAllFlag,
	},
}
View Source
var SSHConfigCommand = &cli.Command{
	Name:                   "ssh-config",
	Usage:                  "Output ssh_config to STDOUT",
	UseShortOptionHandling: true,
	Before: func(cCtx *cli.Context) error {

		debuglogger.Get(cCtx).IsDebug = false
		return nil
	},
	Action: sshConfigAction,
	Flags:  []cli.Flag{},
}
View Source
var ZshCompletion = &cli.Command{
	Name:                   "zsh-completion",
	Usage:                  "Output zsh completion script to STDOUT",
	UseShortOptionHandling: true,
	Before: func(cCtx *cli.Context) error {

		debuglogger.Get(cCtx).IsDebug = false
		return nil
	},
	Action: zshCompletionAction,
	Flags: []cli.Flag{
		zshCompletionHostsFlag,
	},
}

Functions

func Run

func Run(args []string) error

Types

type Config

type Config struct {
	Filepath    string
	Hosts       []*Host
	DebugLogger *debuglogger.Logger
}

func (*Config) AddHost

func (cfg *Config) AddHost(h *Host) error

func (*Config) NewHostFilter

func (cfg *Config) NewHostFilter() *HostFilter

type ConfigLoadError

type ConfigLoadError struct {
	Err  error
	Path string
}

func (*ConfigLoadError) Error

func (e *ConfigLoadError) Error() string

type Host

type Host struct {
	Name              string
	Description       string
	Hidden            bool
	SSHConfig         map[string]string
	OnBeforeConnect   []any
	OnAfterConnect    []any
	OnAfterDisconnect []any
}

func (*Host) SortedSSHConfig

func (h *Host) SortedSSHConfig() []map[string]string

type HostFilter

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

func (*HostFilter) ExcludeHidden

func (f *HostFilter) ExcludeHidden() *HostFilter

func (*HostFilter) GetHostByName

func (f *HostFilter) GetHostByName(name string) *Host

func (*HostFilter) GetHosts

func (f *HostFilter) GetHosts() []*Host

type SimpleTableWriter

type SimpleTableWriter struct {
	table.Writer
	Out io.Writer
}

func (*SimpleTableWriter) Render

func (t *SimpleTableWriter) Render() string

Directories

Path Synopsis
lualib

Jump to

Keyboard shortcuts

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