ini

package
v1.35.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DateFormat is the default format for date in config file.
	DateFormat = time.RFC3339
)

Variables

This section is empty.

Functions

func FilePath added in v1.30.3

func FilePath(v *viper.Viper) (string, error)

FilePath returns the path for wakatime config file.

func InternalFilePath added in v1.30.3

func InternalFilePath(v *viper.Viper) (string, error)

InternalFilePath returns the path for the wakatime internal config file.

func ReadInConfig added in v1.30.3

func ReadInConfig(v *viper.Viper, configFilePath string) error

ReadInConfig reads wakatime config file in memory.

func WakaHomeDir added in v1.30.3

func WakaHomeDir() (string, error)

WakaHomeDir returns the current user's home directory.

Types

type Writer added in v1.30.3

type Writer interface {
	Write(section string, keyValue map[string]string) error
}

Writer defines the methods to write to config file.

type WriterConfig added in v1.30.3

type WriterConfig struct {
	File           *ini.File
	ConfigFilepath string
}

WriterConfig stores the configuration necessary to write to config file.

func NewIniWriter added in v1.30.3

func NewIniWriter(v *viper.Viper, filepathFn func(v *viper.Viper) (string, error)) (*WriterConfig, error)

NewIniWriter creates a new IniWriter instance.

func (*WriterConfig) Write added in v1.30.3

func (w *WriterConfig) Write(section string, keyValue map[string]string) error

Write persists key(s) and value(s) on disk.

Jump to

Keyboard shortcuts

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