config

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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{"sofcat.exe", "--help"}

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

SofCat - Munki-like Application Management for Windows
https://github.com/hurricanehrndz/sofcat

Usage: sofcat.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
-s, -service        run SofCat as a Windows service
-S, -servicecmd     send a command to a running SofCat service (GetServiceInfo|ListOptionalInstalls|GetBranding|InstallItem:itemName|RemoveItem:itemName|StreamOperationStatus:operationId|CancelOperation:operationId)
-serviceinstall     install SofCat as a Windows service and restrict its data directory to SYSTEM and Administrators
-serviceremove      remove SofCat Windows service
-servicestart       start SofCat Windows service
-servicestop        stop SofCat Windows service
-servicestatus      show SofCat Windows service status
-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 Branding

type Branding struct {
	Title     string `yaml:"title,omitempty"`
	Tagline   string `yaml:"tagline,omitempty"`
	HelpURL   string `yaml:"help_url,omitempty"`
	HelpLabel string `yaml:"help_label,omitempty"`
	Accent    string `yaml:"accent,omitempty"`
}

Branding is the optional organisation branding block for SofCat UI. Policy registry values override it per field; pkg/branding merges and validates both.

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"`
	LogFilePlain    bool     `yaml:"log_file_plain,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
	ServiceMode     bool `yaml:"service_mode,omitempty"`
	ServiceCommand  string
	ServiceInstall  bool
	ServiceRemove   bool
	ServiceStart    bool
	ServiceStop     bool
	ServiceStatus   bool
	ServiceName     string   `yaml:"service_name,omitempty"`
	ServiceInterval string   `yaml:"service_interval,omitempty"`
	ServicePipeName string   `yaml:"service_pipe_name,omitempty"`
	Branding        Branding `yaml:"branding,omitempty"`
	ConfigPath      string
	// RequestedBy maps a self-service item to the user whose request the run
	// is carrying out, for the inventory. The service sets it per run; it is
	// never read from config.yaml.
	RequestedBy map[string]string `yaml:"-"`
}

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