cobol

package module
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: GPL-3.0 Imports: 13 Imported by: 16

README

// Copyright 2025 WIT.COM Inc Licensed GPL 3.0

// ah yes, COBOL. what an ancient throwback. for those that know // then you know exactly what is in this file. For those that don't, here it is:

// All this does is output human readable text formatted to be viewable on // a console with a fixed with font. AKA: a typerwriter. Which is exactly // what COBOL did in the 1970's (60s? notsure). And the 80s.

// Perl, before GO, was great for this kinda thing. GO with // protobuffers is even better

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Broken error = errors.New("something is broken")
View Source
var IsBlank error = errors.New("var was blank")
View Source
var IsNil error = errors.New("was sent nil")
View Source
var NewFeature error = errors.New("feature is new and did not work")
View Source
var NoBytes error = errors.New("could not find bytes")
View Source
var NoDuration error = errors.New("could not find a duration")
View Source
var NoTime error = errors.New("could not find a time")
View Source
var TERMSIZE int = 80
View Source
var Unimplemented error = errors.New("not yet implemented")
View Source
var WIDTH int = 120

Functions

func Bytes added in v0.0.18

func Bytes(anInt any) string

returns a human readable string of the bytes

func BytesCheck added in v0.0.18

func BytesCheck(anInt any) (string, error)

returns a human readable string of the bytes also returns the error if there was one

func DumbTable added in v0.0.26

func DumbTable(data string) string

func DumbTable3 added in v0.0.26

func DumbTable3(lines []string)

func Duration added in v0.0.20

func Duration(howLongWasThis any) string

func DurationCheck added in v0.0.20

func DurationCheck(maybeTime any) (time.Duration, error)

func FormatDuration added in v0.0.18

func FormatDuration(d time.Duration) string

this math isn't perfect but I don't care right now use time.

func FormatTime added in v0.0.19

func FormatTime(t time.Time) string

there is only one way to display the time as text this is that way. Don't like it? Don't use COBOL

func FormatTimeLocal added in v0.0.21

func FormatTimeLocal(t time.Time) string

func GetBytes added in v0.0.18

func GetBytes(anInt any) (int, error)

returns an int. will try to convert strings

func GetDuration added in v0.0.20

func GetDuration(tookForever any) (time.Duration, error)

func GetSince added in v0.0.18

func GetSince(maybeTime any) (*time.Duration, error)

func GetTime added in v0.0.18

func GetTime(mightBeTimeMightNotBeTime any) (*time.Time, error)

func HumanFormatBytes added in v0.0.18

func HumanFormatBytes(b int) string

This isn't for the marketing department so this isn't going to use 'MiB' and 'GiB'

func Int added in v0.0.28

func Int(maybeInt any) int

just give back an int

func PrintTable added in v0.0.6

func PrintTable(pb *guipb.Table)

func PrintTableDebug added in v0.0.33

func PrintTableDebug(pb *guipb.Table)

func PrintTableLimit added in v0.0.25

func PrintTableLimit(pb *guipb.Table, limit int, debug bool)

limits the number of out lines

func SimpleTable added in v0.0.30

func SimpleTable(data [][]string) string

func SimpleTableSizes added in v0.0.30

func SimpleTableSizes(data [][]string, sizes []int) string

func SimpleTableSizesDebug added in v0.0.30

func SimpleTableSizesDebug(data [][]string, sizes []int) string

func Since added in v0.0.18

func Since(aLongTimeAgo any) string

returns a human readable duration

func SinceCheck added in v0.0.18

func SinceCheck(mightBeRecently any) (string, error)

returns a human readable duration also returns errors

func StandardTableRow added in v0.0.7

func StandardTableRow(sizes []int, args []string) (string, string)

returns the line and the Sprintf fmt string

func StandardTableRowDebug added in v0.0.9

func StandardTableRowDebug(sizes []int, args []string) (string, string)

func StandardTableSize10

func StandardTableSize10(sizes []int, args []string) string

func TerminalChomp added in v0.0.3

func TerminalChomp(cut string) string

like the perl Chomp but with the terminal width

func Time added in v0.0.18

func Time(someTimeAgoOrLaterNotsure any) string

you will be happier if you just use this everywhere This is always 28 chars wide. It's what cobol would want.

func TimeCheck added in v0.0.19

func TimeCheck(maybeTime any) (string, *time.Time, error)

func TimeLocal added in v0.0.21

func TimeLocal(someTimeAgoOrLaterNotsure any) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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