Documentation ¶
Index ¶
- func FilePath(ctx context.Context, v *viper.Viper) (string, error)
- func ImportFilePath(_ context.Context, v *viper.Viper) (string, error)
- func InternalFilePath(ctx context.Context, v *viper.Viper) (string, error)
- func ReadInConfig(v *viper.Viper, configFilePath string) error
- func WakaResourcesDir(ctx context.Context) (string, error)
- type WakaHomeType
- type Writer
- type WriterConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportFilePath ¶ added in v1.42.1
ImportFilePath returns the path for custom wakatime config file. It's used to keep the api key out ofthe home folder, and usually it's to avoid backing up sensitive wakatime config file. https://github.com/wakatime/wakatime-cli/issues/464
func InternalFilePath ¶ added in v1.30.3
InternalFilePath returns the path for the wakatime internal config file which contains last heartbeat timestamp and backoff time.
func ReadInConfig ¶ added in v1.30.3
ReadInConfig reads wakatime config file in memory.
Types ¶
type WakaHomeType ¶ added in v1.73.0
type WakaHomeType int
WakaHomeType is WakaTime home type.
const ( // DateFormat is the default format for date in config file. DateFormat = time.RFC3339 // WakaHomeTypeUnknown is unknown WakaTime home type. WakaHomeTypeUnknown WakaHomeType = iota // WakaHomeTypeEnvVar is WakaTime home type from environment variable. WakaHomeTypeEnvVar // WakaHomeTypeOSDir is WakaTime home type from OS directory. WakaHomeTypeOSDir )
func WakaHomeDir ¶ added in v1.30.3
func WakaHomeDir(ctx context.Context) (string, WakaHomeType, error)
WakaHomeDir returns the current user's home directory.
type Writer ¶ added in v1.30.3
type Writer interface {
Write(ctx context.Context, 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 { ConfigFilepath string File *ini.File }
WriterConfig stores the configuration necessary to write to config file.
Click to show internal directories.
Click to hide internal directories.