utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateFormat       string        = "2006-01-02"
	HumanDateFormat  string        = "Mon Jan 02 2006"
	AssignDateFormat string        = "02-01-2006"
	HoursInDay       int           = 24
	DaysInWeek       int           = 7
	DayDuration      time.Duration = time.Duration(HoursInDay) * time.Hour
	WeekDuration     time.Duration = DayDuration * time.Duration(DaysInWeek)
)

Variables

This section is empty.

Functions

func Close

func Close(c io.Closer)

Simple wrapper for objects that need to be closed. Could be used with defer statement to avoid unhandled error from Close function.

func GetDate

func GetDate(date time.Time) time.Time

Function that strips hours minutes and seconds from given time.Time. Returns pointer to time.Time object representing only date.

func GetToday

func GetToday() time.Time

This function returns time.Time object representing current date.

func GetTomorrow

func GetTomorrow() time.Time

This function returns time.Time object representing tomorrow date.

Types

type PrettyTable

type PrettyTable struct {
	Minwidth int
	Tabwidth int
	Padding  int
	Padchar  byte
	// contains filtered or unexported fields
}

func NewPrettyTable

func NewPrettyTable() *PrettyTable

func (*PrettyTable) AddRow

func (pt *PrettyTable) AddRow(row []string)

func (*PrettyTable) String

func (pt *PrettyTable) String() (string, error)

Jump to

Keyboard shortcuts

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