commons

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 7 Imported by: 1

README

commons

These are my very own tools for Go that I use regularly for most of my little command line tools.

You don't need that.

CSV

LOG

Config

A basic config struct that gives you some flags and some info. Logging is established.

###Debugging info ...

Flags

-logcolour Use coloured logging (switch off when redirecting log output). (default true) -logfile string Sets the name of the logfile. Uses STDOUT if empty. -loglevel string Determines logging verbosity. [All|Info|Debug|Warn|Error|Fatal|Off]. (default "Warn") -version Show version info.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonConfig

type CommonConfig struct {
	BuildTimeStamp time.Time
	GitVersion     string
	ShowVersion    bool
	ActiveLogLevel log.LogLevel

	LogFileName      string
	Logger           *log.Logger
	WorkingDirectory string
	// contains filtered or unexported fields
}

func (*CommonConfig) AddCleanUpFn

func (cfg *CommonConfig) AddCleanUpFn(f func() error)

func (*CommonConfig) CleanUp

func (cfg *CommonConfig) CleanUp()

func (*CommonConfig) FatalExit

func (cfg *CommonConfig) FatalExit()

func (*CommonConfig) FlagDefinition

func (cfg *CommonConfig) FlagDefinition()

func (CommonConfig) GetInspectData

func (cfg CommonConfig) GetInspectData() string

GetInspectData offers some additional debugging information

func (*CommonConfig) Initialize

func (cfg *CommonConfig) Initialize(version string, buildtimestamp string) *CommonConfig

func (CommonConfig) String

func (cfg CommonConfig) String() string

Directories

Path Synopsis
strategies
structures

Jump to

Keyboard shortcuts

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