config

package
v0.0.2-beta.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobalConfig

type GlobalConfig struct {
	Author        string            `json:"author"`
	FileName      string            `json:"filename"`
	TemplatesPath string            `json:"templates_path" mapstructure:"templates_path"`
	Scripts       map[string]string `json:"scripts"`

	// Keep track of where the config file was found
	// Important since can be set through environment variables
	ConfigPath string
}

func GlobalConfigFromViper

func GlobalConfigFromViper(v *viper.Viper) (*GlobalConfig, error)

func NewGlobalConfig

func NewGlobalConfig(author string, filename string, scripts map[string]string) *GlobalConfig

func (*GlobalConfig) GetTemplatesPath

func (c *GlobalConfig) GetTemplatesPath() string

type ProjectConfig

type ProjectConfig struct {
	Name        string            `json:"name"`
	Version     string            `json:"version"`
	Description string            `json:"description"`
	Author      string            `json:"author"`
	Scripts     map[string]string `json:"scripts"`
}

func NewProjectConfig

func NewProjectConfig(name string, version string, description string, author string, scripts map[string]string) *ProjectConfig

func ParseMergeProjectConfigFile

func ParseMergeProjectConfigFile(globalConfig *GlobalConfig) (*ProjectConfig, error)

func ParseProjectConfigFile

func ParseProjectConfigFile(filePath string) (*ProjectConfig, error)

func (*ProjectConfig) MergeGlobalConfig

func (projectConfig *ProjectConfig) MergeGlobalConfig(globalConfig *GlobalConfig) *ProjectConfig

func (*ProjectConfig) RunScript

func (projectConfig *ProjectConfig) RunScript(scriptName string) error

func (*ProjectConfig) RunScriptArgs

func (projectConfig *ProjectConfig) RunScriptArgs(scriptName string, arguments []string) error

func (*ProjectConfig) WriteToFile

func (projectConfig *ProjectConfig) WriteToFile(filePath string) error

Jump to

Keyboard shortcuts

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