config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIOptionParser

type CLIOptionParser interface {
	OptionParser
	FlagName() string
	Usage() string
	// returns whether it should be considered as a boolean flag (parsed using flag.Bool(), with no flag value)
	// or as a flag with a value. If IsBoolFlag returns true, the Parse() method will be called with "yes" or "no"
	// depending of the boolean value of the arg
	IsBoolFlag() bool
}

type Config

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

func NewConfig

func NewConfig(username string, hostname string, port int, urlPath string, authMethods []interface{}, options map[OptionName]Option) (*Config, error)

func (*Config) AuthMethods

func (o *Config) AuthMethods() []interface{}

func (*Config) CanonicalHostFormat

func (o *Config) CanonicalHostFormat() string

Returns the canonical host representation used by SSH3. The format is <urlhostnameport><path> <urlhostnameport> is the host:port pair in the format returned by URLHostnamePort() <path> is the URL path, it always starts with a "/", it is therefore never empty.

func (*Config) Hostname

func (o *Config) Hostname() string

func (*Config) Options

func (o *Config) Options() map[OptionName]Option

func (*Config) Port

func (o *Config) Port() int

func (*Config) URLHostnamePort

func (o *Config) URLHostnamePort() string

Returns the pair hostname:port in a valid URL format. This means that an IPv6 will be written inside square brackets []. examples: "127.0.0.1:443", "example.org:1234", "[::1]:22""

func (*Config) UrlPath

func (o *Config) UrlPath() string

func (*Config) Username

func (o *Config) Username() string

type Option

type Option any

Option defnes a generic client option that can be manipulated by the client and by different auth plugins. Plugins can define their own option types

type OptionName

type OptionName string

type OptionParser

type OptionParser interface {
	// returns the option config keyword
	// This keyword is used when parsing the SSH config.
	OptionConfigName() string

	// returns the Option represented by this list of config values
	// the values are all retrieved from the config.
	// values contain several entries if the keyword (see `OptionConfigName`) is
	// present several times in the config.
	Parse(values []string) (Option, error)
}

OptionParser allows parsing an client config option from a string.

type StringOption

type StringOption interface {
	Option
	Value() string
}

StringOptions is a client option whose value is a string

Jump to

Keyboard shortcuts

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