common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	VerboseFlag             = "verbose"
	VerboseShortFlag        = "v"
	VerboseFlagDefaultValue = 0
)

Exportable flags

View Source
const (
	// AppName reflects the application name
	AppName = "fyt"
	// AppEnv reflects application environment prefix.
	AppEnv = "FYT"

	// CobraGroupMain reflects main application group
	CobraGroupMain = "Main"
	// CobraGroupAux reflects auxiliaries application group
	CobraGroupAux = "Aux"
)

Variables

View Source
var GlobalFlags = &pflag.FlagSet{}

GlobalFlags keeps package global flat-set entry

Functions

func Env

func Env(envPrefixes ...string) func(string) string

Env provides a helper to join environment variable prefixes together and return one argument function as a helper.

func EnvJoin

func EnvJoin(tail string, envPrefixes ...string) string

EnvJoin adds tail to the end of envPrefixes and calls Env

func LogTimesheetDiagnostics

func LogTimesheetDiagnostics(cmd *cobra.Command, err error)

LogTimesheetDiagnostics reports each input problem once through the command's logger.

func ProcessTimesheet

func ProcessTimesheet(cmd *cobra.Command, sheet *timesheet.Timesheet, processing v1alpha1.ProcessingConfig) ([]timesheet.ProcessedEntry, error)

ProcessTimesheet validates the source entries, handles duplicates and checks overlaps.

func SetVerbosity

func SetVerbosity(verbosity int)

SetVerbosity sets a verbosity level globally

Types

type Err

type Err struct {
	Type    int
	Message string
}

Err is for common error objects

func NewError

func NewError(errType int, format string, args ...any) *Err

NewError returns configured Err object

func (Err) Error

func (e Err) Error() string

Error implements error interface

Jump to

Keyboard shortcuts

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