config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config handles application configuration from multiple sources.

Index

Constants

View Source
const (
	// DefaultHost is the default Pantheon API host
	DefaultHost = "terminus.pantheon.io"
	// DefaultPort is the default API port
	DefaultPort = 443
	// DefaultProtocol is the default protocol
	DefaultProtocol = "https"
	// DefaultTimeout is the default timeout in seconds
	DefaultTimeout = 86400
	// DefaultDateFormat is the default date format
	DefaultDateFormat = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// API settings
	Host     string
	Port     int
	Protocol string
	Timeout  int

	// Paths
	HomeDir     string
	CacheDir    string
	PluginsDir  string
	TokensDir   string
	SessionFile string
	ConfigFile  string

	// Display settings
	DateFormat string
	// contains filtered or unexported fields
}

Config represents the application configuration

func New

func New() (*Config, error)

New creates a new configuration with defaults

func (*Config) Get

func (c *Config) Get(key string) (interface{}, bool)

Get returns a configuration value by key

func (*Config) GetBaseURL

func (c *Config) GetBaseURL() string

GetBaseURL returns the full API base URL

func (*Config) GetBool

func (c *Config) GetBool(key string) bool

GetBool returns a boolean configuration value

func (*Config) GetInt

func (c *Config) GetInt(key string) int

GetInt returns an integer configuration value

func (*Config) GetString

func (c *Config) GetString(key string) string

GetString returns a string configuration value

Jump to

Keyboard shortcuts

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