Skip to content

Converted code to a library & Improved command feedback

Pre-release
Pre-release

Choose a tag to compare

@samuelgrant samuelgrant released this 16 Jun 06:43
· 23 commits to master since this release

This release may break your code. If you were using an earlier version check your return types.

The wiki has not been updated to reflect the changes in this release

This release aims to achieve three goals:

  • Convert the code from a stand-alone go project to a library.

    • Removed main.go and func main()
    • Renamed the package of all files from main to ts3
  • Improve logging

    • Standardise the log format and colour
    • Disable logging by default
    • Provide a function to enable/disable logging LoggingEnabled(true)
    • Ensure that we log when an error occurs with a basic message to indicate the cause of the issue
  • Standardise the response from functions within the lib

    • The Exec() function now returns three params *QueryResponse, body, error
    • Most functions will now check for errors and query failures after executing a statment for example
res, body, error := client.Exec("serverlist")
if err != nil || !res.IsSucess { 
   // runtime error or query error occured
  // log the issue
 // return res, err
}
  • Made sure that the query response is returned to the function calling it where possible
  • Used pointers for return types so that nil can be returned