clockin

package
v0.0.0-...-e60242c Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBaseDirPath = "~/.clockin/"
	ConfigFileName     = "config.yml"
)
View Source
const (
	DEFAULT_FILE_MODE fs.FileMode = 0644
)
View Source
const (
	PROJECT_FILE string = "projects.yml"
)

Variables

View Source
var (
	ValidConfigPaths []string = []string{"./config.yml", "~/.clockin/config.yml"}
)

Functions

func AddProject

func AddProject(c *Config, project, module string) error

func CreateIfNotPresent

func CreateIfNotPresent(path string) error

func DoesPathExist

func DoesPathExist(path string) (bool, error)

func PrintAllProjects

func PrintAllProjects(c *Config) error

func SanitizePath

func SanitizePath(Path string) (string, error)

Types

type Config

type Config struct {
	BaseDir string
}

func InitializeConfig

func InitializeConfig() (*Config, error)

func LoadConfig

func LoadConfig() (*Config, error)

func LoadOrInitialiseConfig

func LoadOrInitialiseConfig() (*Config, error)

func (*Config) GetBaseDir

func (c *Config) GetBaseDir() (string, error)

func (*Config) LoadDefaultConfig

func (c *Config) LoadDefaultConfig() error

func (*Config) Print

func (c *Config) Print()

func (*Config) ReadAndSave

func (c *Config) ReadAndSave()

func (*Config) Save

func (c *Config) Save() error

func (*Config) SetBaseDir

func (c *Config) SetBaseDir(dirPath string) error

type Entry

type Entry struct {
	Timestamp string
	Project   string
	Module    string
	Remarks   string
}

type EntryFile

type EntryFile struct {
	Entries []Entry
}

type Module

type Module string

type Project

type Project struct {
	ProjectName string
	Modules     []Module
}

Jump to

Keyboard shortcuts

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