dirprefs

package
v0.12.0-rc Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2016 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package dirprefs provides directory/project specific preference settings

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirPreferences

type DirPreferences struct {
	Organization string `json:"org,omitempty"`
	Project      string `json:"project,omitempty"`
	Path         string `json:"-"`
}

DirPreferences holds preferences for arguments set in .torus.json files

func Load

func Load(recurse bool) (*DirPreferences, error)

Load loads DirPreferences. It starts in the current working directory, looking for a readable '.torus.json' file, and walks up the directory hierarchy until it finds one, or reaches the root of the fs.

It returns an empty DirPreferences is no '.torus.json' files are found. It returns an error if a malformed file is found, or if any errors occur during file system access.

func (*DirPreferences) Remove

func (d *DirPreferences) Remove() error

Remove removes the backing file for this DirPreferences

func (*DirPreferences) Save

func (d *DirPreferences) Save() error

Save writes the DirPreferences values to the file in the struct's Path field

Jump to

Keyboard shortcuts

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