Documentation
¶
Index ¶
- Variables
- func BytesConvert(input string, decimal bool) (string, error)
- func BytesToHuman(bytes int64, decimal bool) string
- func CSVToJSON(input []byte, delimiter rune) ([]byte, error)
- func ChmodExplain(input string) (string, error)
- func ChmodToNumeric(symbolic string) (string, error)
- func ChmodToSymbolic(numeric string) (string, error)
- func ConvertBase(input string, fromBase, toBase int) (string, error)
- func ConvertDateTime(input string, fromFmt, toFmt, tz string) (string, error)
- func CronExplain(expr string) (string, error)
- func CronNext(expr string, n int, from time.Time) ([]time.Time, error)
- func DurationConvert(input string, to string) (string, error)
- func HumanToBytes(input string) (int64, error)
- func JSONToCSV(input []byte, delimiter rune) ([]byte, error)
- func JSONToYAML(input []byte) ([]byte, error)
- func ToTable(input []byte, style string, inputFormat string, delimiter rune) (string, error)
- func YAMLToJSON(input []byte, indent int) ([]byte, error)
- type TableStyle
Constants ¶
This section is empty.
Variables ¶
View Source
var BoxStyle = TableStyle{
TopLeft: "┌", TopRight: "┐", BottomLeft: "└", BottomRight: "┘",
Horizontal: "─", Vertical: "│",
LeftT: "├", RightT: "┤", TopT: "┬", BottomT: "┴", Cross: "┼",
}
View Source
var SimpleStyle = TableStyle{
TopLeft: "+", TopRight: "+", BottomLeft: "+", BottomRight: "+",
Horizontal: "-", Vertical: "|",
LeftT: "+", RightT: "+", TopT: "+", BottomT: "+", Cross: "+",
}
Functions ¶
func BytesConvert ¶
BytesConvert auto-detects direction. If input is a plain number, converts to human. If input has units, converts to bytes.
func BytesToHuman ¶
BytesToHuman converts a byte count to a human-readable string.
func ChmodExplain ¶
ChmodExplain auto-detects the input format and returns a detailed explanation.
func ChmodToNumeric ¶
ChmodToNumeric converts symbolic permission like "rwxr-xr-x" to numeric like "755".
func ChmodToSymbolic ¶
ChmodToSymbolic converts numeric permission like "755" or "4755" to symbolic like "rwxr-xr-x".
func ConvertDateTime ¶
func CronExplain ¶
func DurationConvert ¶
DurationConvert converts between seconds and human-readable duration formats. The `to` parameter can be "human", "seconds", "minutes", "hours", or "" (auto).
func HumanToBytes ¶
HumanToBytes converts a human-readable size string to bytes.
func JSONToYAML ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.