Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Machine ¶
type Machine struct { Name string Login string Password string Account string // contains filtered or unexported fields }
Machine contains information about a remote machine.
func FindMachine ¶
FindMachine parses the netrc file identified by filename and returns the Machine named by name. If a problem occurs parsing the file at filename, an error is returned. If a machine named by name exists, it is returned. If no Machine with name name is found and there is a “default” machine, the “default” machine is returned. Otherwise, nil is returned.
func (*Machine) IsDefault ¶
IsDefault returns true if the machine is a "default" token, denoted by an empty name.
func (*Machine) UpdateAccount ¶
UpdateAccount sets the login for the Machine m.
func (*Machine) UpdateLogin ¶
UpdateLogin sets the login for the Machine m.
func (*Machine) UpdatePassword ¶
UpdatePassword sets the password for the Machine m.
type Netrc ¶
type Netrc struct { Filename string // contains filtered or unexported fields }
func Parse ¶
Parse parses from the the Reader r as a netrc file and returns the set of machine information and macros defined in it. The “default” machine, which is intended to be used when no machine name matches, is identified by an empty machine name. There can be only one “default” machine.
If there is a parsing error, an Error is returned.
func (*Netrc) FindMachine ¶
FindMachine returns the Machine in n named by name. If a machine named by name exists, it is returned. If no Machine with name name is found and there is a “default” machine, the “default” machine is returned. Otherwise, nil is returned.
func (*Netrc) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface to encode a Netrc into text format.