config

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LayoutHorizontal = "horizontal"
	LayoutVertical   = "vertical"
)

Layout constants

View Source
const (
	DefaultEndpoint = "api.rootly.com"
)
View Source
const DefaultLanguage = "en_US"
View Source
const DefaultLayout = "horizontal"
View Source
const DefaultTimezone = "UTC"

Variables

This section is empty.

Functions

func DetectTimezone

func DetectTimezone() string

DetectTimezone returns the local system timezone name. Falls back to UTC if detection fails.

func Dir

func Dir() string

func Exists

func Exists() bool

func ListTimezones

func ListTimezones() []string

ListTimezones returns a sorted list of available IANA timezone names. It reads from the system's zoneinfo directory.

func Path

func Path() string

func Save

func Save(cfg *Config) error

Types

type Config

type Config struct {
	APIKey   string `yaml:"api_key"`
	Endpoint string `yaml:"endpoint"`
	Timezone string `yaml:"timezone"`
	Language string `yaml:"language"`
	Layout   string `yaml:"layout"`
}

func Load

func Load() (*Config, error)

func (*Config) GetLocation

func (c *Config) GetLocation() *time.Location

GetLocation returns the time.Location for the configured timezone. Falls back to UTC if the timezone is invalid.

func (*Config) IsValid

func (c *Config) IsValid() bool

Jump to

Keyboard shortcuts

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