settings

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(projectName string, hourlyRate float64) error

func CreateWithTemplate

func CreateWithTemplate(projectName string, hourlyRate float64, description string) error

func FormatDate

func FormatDate(t time.Time) string

func FormatDateDashed

func FormatDateDashed(t time.Time) string

func FormatDateLong

func FormatDateLong(t time.Time) string

func FormatDateTime

func FormatDateTime(t time.Time) string

func FormatDateTimeDashed

func FormatDateTimeDashed(t time.Time) string

func FormatDateTimeLong

func FormatDateTimeLong(t time.Time) string

func FormatTime

func FormatTime(t time.Time) string

func FormatTimePadded

func FormatTimePadded(t time.Time) string

func GetGlobalConfigPath

func GetGlobalConfigPath() (string, error)

Types

type Config

type Config struct {
	ProjectName string  `yaml:"project_name"`
	HourlyRate  float64 `yaml:"hourly_rate,omitempty"`
	Description string  `yaml:"description,omitempty"`
}

IMPORTANT: When adding new fields to this struct, also update configTemplate below.

func FindAndLoad

func FindAndLoad() (*Config, string, error)

func Load

func Load(path string) (*Config, error)

func (*Config) Save

func (c *Config) Save(path string) error

type GlobalConfig

type GlobalConfig struct {
	Currency   string `yaml:"currency"`
	DateFormat string `yaml:"date_format,omitempty"`
	TimeFormat string `yaml:"time_format,omitempty"`
	Timezone   string `yaml:"timezone,omitempty"`
}

func DefaultGlobalConfig

func DefaultGlobalConfig() *GlobalConfig

func LoadGlobalConfig

func LoadGlobalConfig() (*GlobalConfig, error)

func (*GlobalConfig) Save

func (gc *GlobalConfig) Save() error

Jump to

Keyboard shortcuts

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