Documentation ¶
Index ¶
Constants ¶
const ( TerminalDefault = 0 Highlight = 1 Underline = 4 Flash = 5 )
Colored display control
const ( Black = 30 Red = 31 Green = 32 Yellow = 33 Blue = 34 Purple = 35 Cyan = 36 Write = 37 NoneBackground = 0 )
Colored control
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create an empty simple table. When duplicate values in columns, table creation fails. It will return a table pointer and an error. Error: - If the length of columns is not greater than 0, an *exception.ColumnsLengthError error is returned. - If columns contain duplicate values, an error is returned. - Otherwise, the value of error is nil.
func CreateByStruct ¶
CreateByStruct creates an empty table from struct. You can rename a field using struct tag: gotable It will return a table pointer and an error. Error: - If the length of columns is not greater than 0, an *exception.ColumnsLengthError error is returned. - If columns contain duplicate values, an error is returned. - Otherwise, the value of error is nil.
func CreateSafeTable ¶
CreateSafeTable function used to create an empty safe table. When duplicate values in columns, table creation fails. It will return a table pointer and an error. Error: - If the length of columns is not greater than 0, an *exception.ColumnsLengthError error is returned. - If columns contain duplicate values, an error is returned. - Otherwise, the value of error is nil.
func Read ¶
Read from file to create a *table instance. Currently, support csv and json file. It will return a table pointer and an error. Error:
- If path is not a file, or does not exist, an *exception.FileDoNotExistError is returned.
- If path is a JSON file, the contents of the file are not eligible table contents, an *exception.NotGotableJSONFormatError is returned.
- If path is a CSV file, and the contents of the file are empty, an *exception.ColumnsLengthError is returned.
- If there are duplicate columns in the parse result, an error is returned.
- Otherwise the value if error is nil.
Types ¶
This section is empty.