config

package
v0.0.0-...-fd57926 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppName is the application name used for config files and directories
	AppName = "go-app-composer"

	// EnvPrefix is the prefix for environment variables
	EnvPrefix = "APP_COMPOSER"
)

Variables

View Source
var (
	// Global configuration instance
	Instance AppConfig

	// Status indicators
	ConfigLoaded bool
	ConfigFile   string
)

Global variables

Functions

func GetMDMConfig

func GetMDMConfig() (interface{}, error)

GetMDMConfig returns the configuration for the specified MDM provider

func GetStorageConfig

func GetStorageConfig() (interface{}, error)

GetStorageConfig returns the configuration for the specified storage provider

func Initialize

func Initialize(cfgFile string) error

Initialize sets up the configuration system

func SaveConfig

func SaveConfig(filePath string) error

SaveConfig saves the current configuration to a file

Types

type AppConfig

type AppConfig struct {
	// Core settings
	Debug     bool   `mapstructure:"debug"`
	LogFormat string `mapstructure:"log_format"`
	LogFile   string `mapstructure:"log_file"`

	// MDM settings
	MDM struct {
		Provider string `mapstructure:"provider"` // jamf, intune, mosyle, etc.

		// Jamf settings
		Jamf struct {
			URL      string `mapstructure:"url"`
			Username string `mapstructure:"username"`
			Password string `mapstructure:"password"`
		} `mapstructure:"jamf"`

		// Intune settings
		Intune struct {
			TenantID     string `mapstructure:"tenant_id"`
			ClientID     string `mapstructure:"client_id"`
			ClientSecret string `mapstructure:"client_secret"`
		} `mapstructure:"intune"`

		// Mosyle settings
		Mosyle struct {
			APIKey string `mapstructure:"api_key"`
			Domain string `mapstructure:"domain"`
		} `mapstructure:"mosyle"`
	} `mapstructure:"mdm"`

	// Storage settings
	Storage struct {
		Provider string `mapstructure:"provider"` // s3, gcp, etc.

		// AWS S3 settings
		S3 struct {
			Bucket     string `mapstructure:"bucket"`
			Region     string `mapstructure:"region"`
			AccessKey  string `mapstructure:"access_key"`
			SecretKey  string `mapstructure:"secret_key"`
			Endpoint   string `mapstructure:"endpoint"`    // For custom S3-compatible storage
			DisableSSL bool   `mapstructure:"disable_ssl"` // For development/testing
		} `mapstructure:"s3"`

		// GCP settings
		GCP struct {
			Bucket          string `mapstructure:"bucket"`
			CredentialsFile string `mapstructure:"credentials_file"`
			ProjectID       string `mapstructure:"project_id"`
		} `mapstructure:"gcp"`
	} `mapstructure:"storage"`

	// Packaging settings
	Packaging struct {
		TempDir        string `mapstructure:"temp_dir"`
		CacheDir       string `mapstructure:"cache_dir"`
		SigningID      string `mapstructure:"signing_id"`      // For code signing
		NotarizationID string `mapstructure:"notarization_id"` // For macOS notarization
	} `mapstructure:"packaging"`
}

AppConfig holds the application configuration

Jump to

Keyboard shortcuts

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