locations

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	Key  string
	Path string
	// filePath.join(home.GetHome, fmt.Sprintf("%s.gitconfig", Key))
	ConfigFile string
}

func NewLocation

func NewLocation(key string, location string) *Location

func (Location) ToSection

func (l Location) ToSection() (string, error)

Returns the section composed from the location object this section is the text that usually goes into the gitconfig file

type LocationManager

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

func NewLocationManager

func NewLocationManager(gitconfigPath string, fs *afero.Afero) *LocationManager

func (*LocationManager) FindLocationByKey

func (t *LocationManager) FindLocationByKey(key string) (*Location, error)

FindLocationByKey search the specified location in configured gitconfig file by key. Accepts the key to search as string as parameter It returns if found, the location information but also an error in case of any issue

func (LocationManager) GetLocations

func (t LocationManager) GetLocations() ([]Location, error)

Get all configured locations in specified gitconfig file

func (LocationManager) SaveLocation

func (t LocationManager) SaveLocation(key string, location string) error

Jump to

Keyboard shortcuts

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