config

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Example

Example tests if help is is parsed properly

// Save the original osExit
origExit := osExit
defer func() { osExit = origExit }()

// Override with a fake exit
// var exitCode int
osExit = func(code int) {
	_ = code
}

// Save the original arguments
origArgs := os.Args
defer func() { os.Args = origArgs }()

// Override with our input
os.Args = []string{"gorilla.exe", "--help"}

// Run code, ignoring the return values
_, _, _, _ = parseArguments()
Output:

unknown unknown

Gorilla - Munki-like Application Management for Windows
https://github.com/1dustindavis/gorilla

Usage: gorilla.exe [options]

Options:
-c, -config         path to configuration file in yaml format
-C, -checkonly	    enable check only mode
-v, -verbose        enable verbose output
-d, -debug          enable debug output
-a, -about          displays the version number and other build info
-V, -version        display the version number
-h, -help           display this help message

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	URL            string   `yaml:"url"`
	URLPackages    string   `yaml:"url_packages"`
	Manifest       string   `yaml:"manifest"`
	LocalManifests []string `yaml:"local_manifests,omitempty"`
	Catalogs       []string `yaml:"catalogs"`
	AppDataPath    string   `yaml:"app_data_path"`
	Verbose        bool     `yaml:"verbose,omitempty"`
	Debug          bool     `yaml:"debug,omitempty"`
	CheckOnly      bool     `yaml:"checkonly,omitempty"`
	AuthUser       string   `yaml:"auth_user,omitempty"`
	AuthPass       string   `yaml:"auth_pass,omitempty"`
	TLSAuth        bool     `yaml:"tls_auth,omitempty"`
	TLSClientCert  string   `yaml:"tls_client_cert,omitempty"`
	TLSClientKey   string   `yaml:"tls_client_key,omitempty"`
	TLSServerCert  string   `yaml:"tls_server_cert,omitempty"`
	CachePath      string
}

Configuration stores all of the possible parameters a config file could contain

func Get

func Get() Configuration

Get retrieves and parses the config file and returns a Configuration struct and any errors

Jump to

Keyboard shortcuts

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