Documentation
¶
Overview ¶
Package migration reads third-party session exports without modifying them.
Index ¶
Constants ¶
const MaxBytes int64 = 32 << 20
const MaxEntries = 10000
const MaxFiles = 1024
const MaxIssues = 10000
Variables ¶
var ( ErrFormat = errors.New("unsupported or malformed migration format") ErrTooLarge = errors.New("migration input exceeds limit") ErrNoEntries = errors.New("no SSH entries found") ErrRead = errors.New("cannot read migration input") ErrEncrypted = errors.New("encrypted migration input is not supported") )
Functions ¶
This section is empty.
Types ¶
type Encoding ¶ added in v1.1.2
type Encoding string
Encoding is a legacy code page an export that is neither UTF-8 nor UTF-16 with a byte order mark may be in: Windows clients write their INI files in the system's ANSI code page.
func Encodings ¶ added in v1.1.2
func Encodings() []Encoding
Encodings are the legacy code pages, in the order detection tries them after the preferred ones; Windows-1252 decodes nearly any bytes, so it comes last.
func LanguageEncoding ¶ added in v1.1.2
LanguageEncoding is the code page Windows writes legacy files in for a user of the language (a BCP 47 tag such as zh-Hans or ja).
type Entry ¶
type Entry struct {
ID, Name, Address, User, Group string
Port int
Password, PrivateKey, Passphrase []byte `json:"-" yaml:"-"`
KeyPath string
Jumps []Hop
Issues []Issue
}
Secrets are transient bytes and must never be serialized to application metadata.
type FormatError ¶ added in v1.1.2
FormatError is an ErrFormat at a line of a file: File is its base name, empty when the input was not a file.
func (*FormatError) Error ¶ added in v1.1.2
func (e *FormatError) Error() string
func (*FormatError) Unwrap ¶ added in v1.1.2
func (e *FormatError) Unwrap() error
type Options ¶ added in v1.1.2
type Options struct {
// Encoding is the code page such files are in; empty detects it.
Encoding Encoding
// Prefer is tried first when detecting, after the system's code page.
Prefer Encoding
}
Options says how Read decodes an export of an INI-style source that is neither UTF-8 nor UTF-16 with a byte order mark.
type Result ¶
type Result struct {
Entries []Entry
Issues []Issue
// Encoding is the legacy code page files were decoded in, empty when
// every file was UTF-8 or UTF-16.
Encoding Encoding
}
type Source ¶
type Source string
const ( Xshell Source = "Xshell" MobaXterm Source = "MobaXterm" PuTTY Source = "PuTTY" WindTerm Source = "WindTerm" Electerm Source = "Electerm" Tabby Source = "Tabby" Netcatty Source = "Netcatty" Remmina Source = "Remmina" MRemoteNG Source = "mRemoteNG" WinSCP Source = "WinSCP" // Text is a host list of key=value lines, typed, pasted or read // from a file; it is not one of the clients Sources lists. Text Source = "Text" // CSV is a host table whose header names the columns with the keys // of a Text host list; it is not one of the clients Sources lists. CSV Source = "CSV" )