netrc

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: GPL-3.0, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoEntry = errors.New("no entry for hostname")

ErrNoEntry represents the case that there is no entry for a given hostname in the netrc

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	// Login is typically the username
	Login string
	// Password contains the secret to authenticate with
	Password string
}

Credentials for a host

func GetCredentials

func GetCredentials(lines []Line, host string) (*Credentials, error)

GetCredentials from given netrc lines and the given host

type Line

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

Line representing a netrc entry

func ReadUserNetrc

func ReadUserNetrc() ([]Line, error)

ReadUserNetrc looks up the netrc for the user if set and returns the parsed result in case there is no netrc an error is returned

Jump to

Keyboard shortcuts

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