config

package
v1.7.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilePath

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

FilePath returns the path for wakatime config file.

func ReadInConfig

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

ReadInConfig reads wakatime config file in memory.

Types

type ErrFileParse

type ErrFileParse string

ErrFileParse handles a custom error while parsing wakatime config file.

func (ErrFileParse) Error

func (e ErrFileParse) Error() string

Error implements error interface.

type ErrFileWrite

type ErrFileWrite string

ErrFileWrite handles a custom error while writing to wakatime config file.

func (ErrFileWrite) Error

func (e ErrFileWrite) Error() string

Error implements error interface.

type IniWriter

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

IniWriter stores the configuration necessary to write to config file.

func NewIniWriter

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

NewIniWriter creates a new IniWriter instance.

func (*IniWriter) Write

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

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

type Writer

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

Writer defines the methods to write to config file.

Jump to

Keyboard shortcuts

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