config

package
v0.0.0-...-b74d91b Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package config groups the goproject configuration and profile management mechanism

Package config groups the configuration and profile management mechanism

Package config groups the configuration and profile management mechanism

Package config groups the configuration and profile management mechanism

Index

Constants

View Source
const (
	// DefaultTargetProjectLocation is the default location to deploy the new project in
	DefaultTargetProjectLocation string = "."

	// DefaultConfigProfileKeyName is the application's configuration entry label for the default profile to use
	DefaultConfigProfileKeyName string = "defaultprofile"

	// DefaultAutoUpdateKeyName is the application's configuration entry label for auto-updates
	DefaultAutoUpdateKeyName string = "autoupdate"
	// DefaultAutoUpdateValue is the default value for auto-updates
	DefaultAutoUpdateValue string = "true"

	// DirMode is the default file permissions mode
	DirMode os.FileMode = 0700
	// FileMode is the default directory permissions mode
	FileMode os.FileMode = 0600
)

Variables

This section is empty.

Functions

func CreateNewProfileFile

func CreateNewProfileFile(profile string) (string, error)

CreateNewProfileFile creates a new file for the given profile name if it does not exist

func EditProfile

func EditProfile(profile string) error

EditProfile opens a text editor to the specified profile configuration file

func GetProfileDirName

func GetProfileDirName() (string, error)

GetProfileDirName returns the path to the goproject profile directory

func Initialise

func Initialise()

Initialise reads or creates configurations in order to aliment the program with needed input

func ListProfiles

func ListProfiles() ([]string, error)

ListProfiles returns the list of available profiles

func SetDefaultProfile

func SetDefaultProfile(profile string) error

SetDefaultProfile sets the given profile as default

Types

type Author

type Author struct {
	Name    string
	Contact string
}

Author represents the developer and holds their contact information

type Profile

type Profile struct {
	Author *Author
	Conf   *viper.Viper
}

Profile associates an Author to a configuration file, describing a desired project layout

func LoadProfile

func LoadProfile(name string) (*Profile, error)

LoadProfile loads a profile from disk and returns a populated profile structure

Jump to

Keyboard shortcuts

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