options

package
v2.0.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package options defines a number of types that represent options that can be set in the SSH configuration file.

Index

Constants

View Source
const (
	BooleanOptionNo  = BooleanOption(boolNo)
	BooleanOptionYes = BooleanOption(boolYes)
)
View Source
const (
	CanonicalizeHostnameNo     = CanonicalizeHostnameOption(boolNo)
	CanonicalizeHostnameYes    = CanonicalizeHostnameOption(boolYes)
	CanonicalizeHostnameAlways = CanonicalizeHostnameOption(optAlways)
)
View Source
const (
	AddKeysToAgentNo      = AddKeysToAgentOption(boolNo)
	AddKeysToAgentYes     = AddKeysToAgentOption(boolYes)
	AddKeysToAgentAsk     = AddKeysToAgentOption(optAsk)
	AddKeysToAgentConfirm = AddKeysToAgentOption(optConfirm)
)
View Source
const (
	ControlMasterNo      = ControlMasterOption(boolNo)
	ControlMasterYes     = ControlMasterOption(boolYes)
	ControlMasterAsk     = ControlMasterOption(optAsk)
	ControlMasterAuto    = ControlMasterOption(optAuto)
	ControlMasterAutoAsk = ControlMasterOption(optAutoAsk)
)
View Source
const (
	ControlPersistOptionNo  = ControlPersistOption(boolNo)
	ControlPersistOptionYes = ControlPersistOption(boolYes)
)
View Source
const (
	FingerprintHashMD5    = FingerprintHashOption("MD5")
	FingerprintHashSHA256 = FingerprintHashOption("SHA256")
)
View Source
const (
	ForwardAgentNo  = ForwardAgentOption(boolNo)
	ForwardAgentYes = ForwardAgentOption(boolYes)
)
View Source
const (
	ObscureKeystrokeTimingOptionNo  = ObscureKeystrokeTimingOption(boolNo)
	ObscureKeystrokeTimingOptionYes = ObscureKeystrokeTimingOption(boolYes)
)
View Source
const (
	IPQoSOptionAf11        = IPQoSOption("af11")
	IPQoSOptionAf12        = IPQoSOption("af12")
	IPQoSOptionAf13        = IPQoSOption("af13")
	IPQoSOptionAf21        = IPQoSOption("af21")
	IPQoSOptionAf22        = IPQoSOption("af22")
	IPQoSOptionAf23        = IPQoSOption("af23")
	IPQoSOptionAf31        = IPQoSOption("af31")
	IPQoSOptionAf32        = IPQoSOption("af32")
	IPQoSOptionAf33        = IPQoSOption("af33")
	IPQoSOptionAf41        = IPQoSOption("af41")
	IPQoSOptionAf42        = IPQoSOption("af42")
	IPQoSOptionAf43        = IPQoSOption("af43")
	IPQoSOptionCs0         = IPQoSOption("cs0")
	IPQoSOptionCs1         = IPQoSOption("cs1")
	IPQoSOptionCs2         = IPQoSOption("cs2")
	IPQoSOptionCs3         = IPQoSOption("cs3")
	IPQoSOptionCs4         = IPQoSOption("cs4")
	IPQoSOptionCs5         = IPQoSOption("cs5")
	IPQoSOptionCs6         = IPQoSOption("cs6")
	IPQoSOptionCs7         = IPQoSOption("cs7")
	IPQoSOptionEf          = IPQoSOption("ef")
	IPQoSOptionLe          = IPQoSOption("le")
	IPQoSOptionLowDelay    = IPQoSOption("lowdelay")
	IPQoSOptionThroughput  = IPQoSOption("throughput")
	IPQoSOptionReliability = IPQoSOption("reliability")
	IPQoSOptionNone        = IPQoSOption(optNone)
)
View Source
const (
	PubkeyAuthenticationOptionYes       = PubkeyAuthenticationOption(boolYes)
	PubkeyAuthenticationOptionNo        = PubkeyAuthenticationOption(boolNo)
	PubkeyAuthenticationOptionUnbound   = PubkeyAuthenticationOption("unbound")
	PubkeyAuthenticationOptionHostbound = PubkeyAuthenticationOption("host-bound")
)
View Source
const (
	RequestTTYOptionYes   = RequestTTYOption(boolYes)
	RequestTTYOptionNo    = RequestTTYOption(boolNo)
	RequestTTYOptionForce = RequestTTYOption("force")
	RequestTTYOptionAuto  = RequestTTYOption(optAuto)
)
View Source
const (
	StrictHostKeyCheckingOptionYes       = StrictHostKeyCheckingOption(boolYes)
	StrictHostKeyCheckingOptionNo        = StrictHostKeyCheckingOption(boolNo)
	StrictHostKeyCheckingOptionAcceptNew = StrictHostKeyCheckingOption("accept-new")
	StrictHostKeyCheckingOptionAsk       = StrictHostKeyCheckingOption(optAsk)
)
View Source
const (
	TunnelOptionYes          = TunnelOption(boolYes)
	TunnelOptionNo           = TunnelOption(boolNo)
	TunnelOptionPointToPoint = TunnelOption("point-to-point")
	TunnelOptionEthernet     = TunnelOption("ethernet")
)
View Source
const (
	UpdateHostKeysOptionYes = UpdateHostKeysOption(boolYes)
	UpdateHostKeysOptionNo  = UpdateHostKeysOption(boolNo)
	UpdateHostKeysOptionAsk = UpdateHostKeysOption(optAsk)
)
View Source
const (
	VerifyHostKeyDNSOptionYes = VerifyHostKeyDNSOption(boolYes)
	VerifyHostKeyDNSOptionNo  = VerifyHostKeyDNSOption(boolNo)
	VerifyHostKeyDNSOptionAsk = VerifyHostKeyDNSOption(optAsk)
)
View Source
const (
	EscapeCharOptionNone    = EscapeCharOption("none")
	EscapeCharOptionDefault = EscapeCharOption("~")
)

Variables

View Source
var CanonicalizeHostnameOptions = map[string]CanonicalizeHostnameOption{
	// contains filtered or unexported fields
}
View Source
var ControlMasterOptions = map[string]ControlMasterOption{
	// contains filtered or unexported fields
}
View Source
var IPQoSOptions = map[string]IPQoSOption{
	"af11":        IPQoSOptionAf11,
	"af12":        IPQoSOptionAf12,
	"af13":        IPQoSOptionAf13,
	"af21":        IPQoSOptionAf21,
	"af22":        IPQoSOptionAf22,
	"af23":        IPQoSOptionAf23,
	"af31":        IPQoSOptionAf31,
	"af32":        IPQoSOptionAf32,
	"af33":        IPQoSOptionAf33,
	"af41":        IPQoSOptionAf41,
	"af42":        IPQoSOptionAf42,
	"af43":        IPQoSOptionAf43,
	"cs0":         IPQoSOptionCs0,
	"cs1":         IPQoSOptionCs1,
	"cs2":         IPQoSOptionCs2,
	"cs3":         IPQoSOptionCs3,
	"cs4":         IPQoSOptionCs4,
	"cs5":         IPQoSOptionCs5,
	"cs6":         IPQoSOptionCs6,
	"cs7":         IPQoSOptionCs7,
	"ef":          IPQoSOptionEf,
	"le":          IPQoSOptionLe,
	"lowdelay":    IPQoSOptionLowDelay,
	"throughput":  IPQoSOptionThroughput,
	"reliability": IPQoSOptionReliability,
	// contains filtered or unexported fields
}

Functions

func AddIntervalSuffix

func AddIntervalSuffix(s string) string

Adds an "s" suffix to a duration string if it ends with a number.

Types

type AddKeysToAgentOption

type AddKeysToAgentOption string

AddKeysToAgentOption is an extended boolean option that can be set to yes, no, ask, confirm, confirm with a time interval or a time interval.

func (AddKeysToAgentOption) HasInterval

func (a AddKeysToAgentOption) HasInterval() bool

HasInterval returns true if the option has an interval set.

func (AddKeysToAgentOption) Interval

func (a AddKeysToAgentOption) Interval() (time.Duration, error)

Interval returns the time interval set in the option. If the option does not have an interval an error is returned.

func (AddKeysToAgentOption) IsAsk

func (a AddKeysToAgentOption) IsAsk() bool

IsAsk returns true if the option is set to ask.

func (AddKeysToAgentOption) IsConfirm

func (a AddKeysToAgentOption) IsConfirm() bool

IsConfirm returns true if the option is set to confirm.

func (AddKeysToAgentOption) IsFalse

func (a AddKeysToAgentOption) IsFalse() bool

IsFalse returns true if the option is set to no.

func (AddKeysToAgentOption) IsTrue

func (a AddKeysToAgentOption) IsTrue() bool

IsTrue returns true if the option is set to yes.

func (AddKeysToAgentOption) Normalize

Normalize returns the normalized value of the option or an error if the value is invalid.

func (AddKeysToAgentOption) String

func (a AddKeysToAgentOption) String() string

String returns the string representation of the option.

type BooleanOption

type BooleanOption string

BooleanOption is an option that can be set to yes or no.

func (BooleanOption) IsFalse

func (b BooleanOption) IsFalse() bool

IsFalse returns true if the option is set to no.

func (BooleanOption) IsTrue

func (b BooleanOption) IsTrue() bool

IsTrue returns true if the option is set to yes.

func (BooleanOption) Normalize

func (b BooleanOption) Normalize() (BooleanOption, error)

Normalize returns the normalized value of the option or an error if the value is invalid.

func (BooleanOption) String

func (b BooleanOption) String() string

String returns the string representation of the option.

type CanonicalizeHostnameOption

type CanonicalizeHostnameOption string

CanonicalizeHostnameOption is an option that can be set to no, yes or always.

func (CanonicalizeHostnameOption) IsAlways

func (c CanonicalizeHostnameOption) IsAlways() bool

IsAlways returns true if the option is set to always.

func (CanonicalizeHostnameOption) IsFalse

func (c CanonicalizeHostnameOption) IsFalse() bool

IsFalse returns true if the option is set to no.

func (CanonicalizeHostnameOption) IsTrue

func (c CanonicalizeHostnameOption) IsTrue() bool

IsTrue returns true if the option is set to yes or always.

func (CanonicalizeHostnameOption) Normalize

Normalize returns the normalized value of the option or an error if the value is invalid.

func (CanonicalizeHostnameOption) String

String returns the string representation of the option.

type ControlMasterOption

type ControlMasterOption string

ControlMasterOption is an extended boolean option that can be set to yes, no, ask, auto or autoask.

func (ControlMasterOption) IsAsk

func (c ControlMasterOption) IsAsk() bool

IsAsk returns true if the option is set to ask.

func (ControlMasterOption) IsAuto

func (c ControlMasterOption) IsAuto() bool

IsAuto returns true if the option is set to auto.

func (ControlMasterOption) IsAutoAsk

func (c ControlMasterOption) IsAutoAsk() bool

IsAutoAsk returns true if the option is set to autoask.

func (ControlMasterOption) IsFalse

func (c ControlMasterOption) IsFalse() bool

IsFalse returns true if the option is set to no.

func (ControlMasterOption) IsTrue

func (c ControlMasterOption) IsTrue() bool

IsTrue returns true if the option is set to yes.

func (ControlMasterOption) Normalize

Normalize returns the normalized value of the option or an error if the value is invalid.

func (ControlMasterOption) String

func (c ControlMasterOption) String() string

String returns the string representation of the option.

type ControlPersistOption

type ControlPersistOption string

ControlPersistOption is an extended boolean option that can be set to yes, no or a time interval.

func (ControlPersistOption) HasInterval

func (c ControlPersistOption) HasInterval() bool

HasInterval returns true if the option has an interval set.

func (ControlPersistOption) Interval

func (c ControlPersistOption) Interval() (time.Duration, error)

Interval returns the time interval set in the option. If the option does not have an interval an error is returned.

func (ControlPersistOption) IsFalse

func (c ControlPersistOption) IsFalse() bool

IsFalse returns true if the option is set to no.

func (ControlPersistOption) IsTrue

func (c ControlPersistOption) IsTrue() bool

IsTrue returns true if the option is set to yes or 0.

func (ControlPersistOption) Normalize

Normalize returns the normalized value of the option or an error if the value is invalid.

func (ControlPersistOption) String

func (c ControlPersistOption) String() string

String returns the string representation of the option.

type EscapeCharOption

type EscapeCharOption string

EscapeCharOption is the type for the EscapeChar option.

func (EscapeCharOption) Byte

func (e EscapeCharOption) Byte() byte

Byte returns the byte representation of the option.

func (EscapeCharOption) IsNone

func (e EscapeCharOption) IsNone() bool

IsNone returns true if the option is "none".

func (EscapeCharOption) Normalize

func (e EscapeCharOption) Normalize() (EscapeCharOption, error)

Normalize returns the normalized value of the option or an error if the value is invalid.

func (EscapeCharOption) String

func (e EscapeCharOption) String() string

String returns the string representation of the option.

type FingerprintHashOption

type FingerprintHashOption string

FingerprintHashOption is an option that can be set to md5 or sha256.

func (FingerprintHashOption) Normalize

Normalize returns the normalized value of the option or an error if the value is invalid.

func (FingerprintHashOption) String

func (f FingerprintHashOption) String() string

String returns the string representation of the option.

type ForwardAgentOption

type ForwardAgentOption string

ForwardAgentOption is an extended boolean option that can be set to yes, no or a path to an agent socket or the name of an environment variable prefixed with a dollar sign.

func (ForwardAgentOption) IsFalse

func (f ForwardAgentOption) IsFalse() bool

IsFalse returns true if the option is set to no.

func (ForwardAgentOption) IsSocket

func (f ForwardAgentOption) IsSocket() bool

IsSocket returns true if the option is non-empty and not a boolean value.

func (ForwardAgentOption) IsTrue

func (f ForwardAgentOption) IsTrue() bool

IsTrue returns true if the option is set to yes.

func (ForwardAgentOption) Normalize

func (f ForwardAgentOption) Normalize() (ForwardAgentOption, error)

Normalize returns the normalized value of the option or an error if the value is invalid.

func (ForwardAgentOption) Socket

func (f ForwardAgentOption) Socket() string

Socket returns the path to the agent socket or the value of the environment variable.

func (ForwardAgentOption) String

func (f ForwardAgentOption) String() string

String returns the string representation of the option.

type IPQoSOption

type IPQoSOption string

IPQoSOption is the type for the IPQoS option.

func (IPQoSOption) Normalize

func (o IPQoSOption) Normalize() (IPQoSOption, error)

Normalize returns the normalized value of the option or an error if the value is invalid.

func (IPQoSOption) String

func (o IPQoSOption) String() string

String returns the string representation of the option.

type IdentityAgentOption

type IdentityAgentOption string

IdentityAgentOption is an option that can be set to a path to an agent socket or the name of an environment variable prefixed with a dollar sign.

func (IdentityAgentOption) Normalize

Normalize returns the normalized value of the option or an error if the value is invalid. The value is always valid but the function is provided for consistency.

func (IdentityAgentOption) Socket

func (i IdentityAgentOption) Socket() string

Socket returns the path to the agent socket or the value of the environment variable.

func (IdentityAgentOption) String

func (i IdentityAgentOption) String() string

String returns the string representation of the option.

type ObscureKeystrokeTimingOption

type ObscureKeystrokeTimingOption string

ObscureKeystrokeTimingOption is an extended boolean option that can be set to yes, no or interval:ms.

func (ObscureKeystrokeTimingOption) HasInterval

func (o ObscureKeystrokeTimingOption) HasInterval() bool

HasInterval returns true if the option has an interval set.

func (ObscureKeystrokeTimingOption) Interval

Interval returns the time interval set in the option. If the option does not have an interval an error is returned.

func (ObscureKeystrokeTimingOption) IsFalse

func (o ObscureKeystrokeTimingOption) IsFalse() bool

IsFalse returns true if the option is set to no.

func (ObscureKeystrokeTimingOption) IsTrue

IsTrue returns true if the option is set to yes.

func (ObscureKeystrokeTimingOption) Normalize

Normalize returns the normalized value of the option or an error if the value is invalid.

func (ObscureKeystrokeTimingOption) String

String returns the string representation of the option.

type PubkeyAuthenticationOption

type PubkeyAuthenticationOption string

PubkeyAuthenticationOption is the type for the PubkeyAuthentication option.

func (PubkeyAuthenticationOption) IsFalse

func (o PubkeyAuthenticationOption) IsFalse() bool

IsFalse returns true if the option is false.

func (PubkeyAuthenticationOption) IsTrue

func (o PubkeyAuthenticationOption) IsTrue() bool

IsTrue returns true if the option is true.

func (PubkeyAuthenticationOption) Normalize

Normalize returns the normalized value of the option or an error if the value is invalid.

func (PubkeyAuthenticationOption) String

String returns the string representation of the option.

type RekeyLimitOption

type RekeyLimitOption struct {
	MaxData int64
	MaxTime time.Duration
}

RekeyLimitOption is the type for the RekeyLimit option.

func (RekeyLimitOption) String

func (o RekeyLimitOption) String() string

String returns the string representation of the option. If MaxData lines up with a K, M, or G suffix, it will be printed as such. If MaxTime is under a minute, it will be printed as a number of seconds.

type RequestTTYOption

type RequestTTYOption string

RequestTTYOption is the type for the RequestTTY option.

func (RequestTTYOption) IsFalse

func (r RequestTTYOption) IsFalse() bool

IsFalse returns true if the option is false.

func (RequestTTYOption) IsTrue

func (r RequestTTYOption) IsTrue() bool

IsTrue returns true if the option is true.

func (RequestTTYOption) Normalize

func (r RequestTTYOption) Normalize() (RequestTTYOption, error)

Normalize returns the normalized value of the option or an error if the value is invalid.

func (RequestTTYOption) String

func (r RequestTTYOption) String() string

String returns the string representation of the option.

type StrictHostKeyCheckingOption

type StrictHostKeyCheckingOption string

StrictHostKeyCheckingOption is the type for the StrictHostKeyChecking option.

func (StrictHostKeyCheckingOption) IsAcceptNew

func (s StrictHostKeyCheckingOption) IsAcceptNew() bool

IsAcceptNew returns true if the option is "accept-new".

func (StrictHostKeyCheckingOption) IsAsk

IsAsk returns true if the option is "ask".

func (StrictHostKeyCheckingOption) IsFalse

func (s StrictHostKeyCheckingOption) IsFalse() bool

IsFalse returns true if the option is false.

func (StrictHostKeyCheckingOption) IsTrue

func (s StrictHostKeyCheckingOption) IsTrue() bool

IsTrue returns true if the option is true.

func (StrictHostKeyCheckingOption) Normalize

Normalize returns the normalized value of the option or an error if the value is invalid.

func (StrictHostKeyCheckingOption) String

String returns the string representation of the option.

type TunnelOption

type TunnelOption string

TunnelOption is the type for the Tunnel option.

func (TunnelOption) IsFalse

func (t TunnelOption) IsFalse() bool

IsFalse returns true if the option is false.

func (TunnelOption) IsTrue

func (t TunnelOption) IsTrue() bool

IsTrue returns true if the option is true.

func (TunnelOption) Normalize

func (t TunnelOption) Normalize() (TunnelOption, error)

Normalize returns the normalized value of the option or an error if the value is invalid.

func (TunnelOption) String

func (t TunnelOption) String() string

String returns the string representation of the option.

type UpdateHostKeysOption

type UpdateHostKeysOption string

UpdateHostKeysOption is the type for the UpdateHostKeys option.

func (UpdateHostKeysOption) IsAsk

func (u UpdateHostKeysOption) IsAsk() bool

IsAsk returns true if the option is "ask".

func (UpdateHostKeysOption) IsFalse

func (u UpdateHostKeysOption) IsFalse() bool

IsFalse returns true if the option is false.

func (UpdateHostKeysOption) IsTrue

func (u UpdateHostKeysOption) IsTrue() bool

IsTrue returns true if the option is true.

func (UpdateHostKeysOption) Normalize

Normalize returns the normalized value of the option or an error if the value is invalid.

func (UpdateHostKeysOption) String

func (u UpdateHostKeysOption) String() string

String returns the string representation of the option.

type VerifyHostKeyDNSOption

type VerifyHostKeyDNSOption string

VerifyHostKeyDNSOption is the type for the UpdateHostKeys option.

func (VerifyHostKeyDNSOption) IsAsk

func (u VerifyHostKeyDNSOption) IsAsk() bool

IsAsk returns true if the option is "ask".

func (VerifyHostKeyDNSOption) IsFalse

func (u VerifyHostKeyDNSOption) IsFalse() bool

IsFalse returns true if the option is false.

func (VerifyHostKeyDNSOption) IsTrue

func (u VerifyHostKeyDNSOption) IsTrue() bool

IsTrue returns true if the option is true.

func (VerifyHostKeyDNSOption) Normalize

Normalize returns the normalized value of the option or an error if the value is invalid.

func (VerifyHostKeyDNSOption) String

func (u VerifyHostKeyDNSOption) String() string

String returns the string representation of the option.

Jump to

Keyboard shortcuts

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