config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 5 Imported by: 0 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

Package config handles Mush configuration using Viper.

Configuration sources (in priority order):

  1. Environment variables (MUSH_*)
  2. Config file (~/.config/mush/config.yaml)
  3. Built-in defaults

Index

Constants

View Source
const (
	// DefaultAPIURL is the default Musher API endpoint.
	DefaultAPIURL = "https://api.musher.dev"
	// DefaultPollInterval is the default poll interval in seconds.
	DefaultPollInterval = 30
	// DefaultHeartbeatInterval is the default heartbeat interval in seconds.
	DefaultHeartbeatInterval = 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config holds the Mush configuration.

func Load

func Load() *Config

Load reads configuration from all sources.

func (*Config) APIURL

func (c *Config) APIURL() string

APIURL returns the configured API URL.

func (*Config) All

func (c *Config) All() map[string]interface{}

All returns all configuration as a map.

func (*Config) Get

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

Get returns a configuration value.

func (*Config) GetInt

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

GetInt returns a configuration value as int.

func (*Config) GetString

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

GetString returns a configuration value as string.

func (*Config) HeartbeatInterval

func (c *Config) HeartbeatInterval() int

HeartbeatInterval returns the heartbeat interval in seconds.

func (*Config) PollInterval

func (c *Config) PollInterval() int

PollInterval returns the poll interval in seconds.

func (*Config) Set

func (c *Config) Set(key string, value interface{}) error

Set sets a configuration value and persists it.

Jump to

Keyboard shortcuts

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