Documentation ¶
Index ¶
- Constants
- func BoxIt(str []string, width int) string
- func ByteToString(input []byte, length int) string
- func ProgramElapsedTime() float64
- func Round(num float64) int
- func SetPrecision(num float64, precision int) float64
- func TimeoutChan(t time.Duration) chan bool
- type JSONConfig
- type LogString
- func (l *LogString) AddF(format string, args ...interface{})
- func (l *LogString) AddS(s string)
- func (l *LogString) AddSR(s string)
- func (l *LogString) Box(w int) string
- func (l *LogString) BoxC(w int) string
- func (l *LogString) Color(s, color string) string
- func (l *LogString) ColorBool(v bool, strue, sfalse, ctrue, cfalse string) string
- type UnixTimestampType
Constants ¶
const (
HttpClientTimeout = time.Duration(5 * time.Second)
)
Variables ¶
This section is empty.
Functions ¶
func ByteToString ¶
ByteToString converts a byte array to a string.
func ProgramElapsedTime ¶
func ProgramElapsedTime() float64
ProgramElapsedTime returns the time elapsed since the program started.
func SetPrecision ¶
SetPrecision effectively rounds a floating point number to the specified precision.
func TimeoutChan ¶
TimeoutChan returns a "chan bool" that will receive a "true" value after the specifed dur`ation t.
Types ¶
type JSONConfig ¶
type JSONConfig struct {
// contains filtered or unexported fields
}
JSONConfig provides functionality to read a JSON config file into the parent struct.
func (*JSONConfig) Read ¶
func (r *JSONConfig) Read(parent interface{}, filePath string) error
Read loads the config file into the parent struct.
type LogString ¶
type LogString struct {
// contains filtered or unexported fields
}
LogString is used to "box" object representations.
func NewLogString ¶
func NewLogString() *LogString
NewLogString creates a new LogString, and initializes color printing.
func (*LogString) Box ¶
Box draws a box around the LogString with the specified line width, with a leading line return.
func (*LogString) BoxC ¶
BoxC draws a box around the LogString with the specified line width, without a leading line return.
type UnixTimestampType ¶
type UnixTimestampType int64
UnixTimestampType reqresents a Unix timestamp.
func (*UnixTimestampType) SetCurrentTime ¶
func (r *UnixTimestampType) SetCurrentTime()
SetCurrentTime sets the UnixTimestampType variable to the current time.
func (UnixTimestampType) String ¶
func (r UnixTimestampType) String() string
String returns a string represenation of a UnixTimestampType custom type.