Categorygithub.com/jdx/go-netrc
modulepackage
1.0.0
Repository: https://github.com/jdx/go-netrc.git
Documentation: pkg.go.dev

# README

go-netrc GoDoc CircleCI

A netrc parser for Go.

Usage

Getting credentials for a host.

usr, err := user.Current()
n, err := netrc.Parse(filepath.Join(usr.HomeDir, ".netrc"))
fmt.Println(n.Machine("api.heroku.com").Get("password"))

Setting credentials on a host.

usr, err := user.Current()
n, err := netrc.Parse(filepath.Join(usr.HomeDir, ".netrc"))
n.Machine("api.heroku.com").Set("password", "newapikey")
n.Save()

# Functions

New creates and returns a new empty Netrc for writing to.
Parse the netrc file at the given path It returns a Netrc instance.
ParseString behaves just like Parse, but can be used to parse netrc data without loading it from a file.

# Variables

ErrInvalidNetrc means there was an error parsing the netrc file.

# Structs

Machine from the netrc file.
Netrc file.

# Type aliases

No description provided by the author