netrc

package
v0.0.0-...-dbf8b16 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package netrc parses .netrc files containing network credentials.

https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Machine

type Machine struct {
	Machine  string
	Login    string
	Password string
	Account  string
	Macros   map[string]string
}

Machine describes a "machine" or "default" entry in a .netrc file.

func Parse

func Parse(r io.Reader) ([]Machine, error)

Parse parses the supplied .netrc data and returns all machines.

func Read

func Read(path string) ([]Machine, error)

Read reads and parses the specified .netrc file.

func ReadMachine

func ReadMachine(path, machine string) (*Machine, error)

ReadMachine reads and parses the specified .netrc file and returns the named machine. A nil pointer and nil error are returned if the machine is not found.

Jump to

Keyboard shortcuts

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