goduetapiclient - Port of DuetAPICient to Go



  • First Release of goduetapiclient

    As some of you may be aware I am a huge fan of Go as a programming language. Now it took me a whole lot longer (to start with) to actually port the client from C#.NET to Go but now a first implementation is ready. It is not yet finished but since I wanted to get out my ObjectSkipper I will make this available already.

    It can be found at https://github.com/wilriker/goduetapiclient.

    Working

    • CommandConnection
    • InterceptConnection
    • SubscribeConnection

    Not working

    • The Machine Model is simply a map[string]interface{} instead of a real object. Implemented now.
    • No documentation of the source yet

    Differences

    Since Go does work a bit different compared to C#.NET some things are not 100% identical, i.e. there is no implicit type conversion available in Go so there are As<Type>() conversion functions.

    Contributions

    I am always very happy about any kind of contribution, be it comments, suggestions, Pull Requests or whatsoever here or over at GitHub.



  • Release v1.2.0

    Matching to the release of DuetSoftwareFramework 1.2.x.x I have updated my client library for Go. This ports all changes and new features introduced in DSF 1.2.x.x over to my client.

    Also source documentation has been added. This should make development easier.

    As usual it can be found at GitHub Releases page.



  • Release 1.2.1

    This minor release addresses some bugs, cleans up inconsistencies in the code and prepares for fields added to the MachineModel in DuetSoftwareFramework 1.2.3.1

    Bug fixes

    • When BaseResponse did not contain a CodeResult instance there was an error due to trying to convert nil to a different type
    • Value-type conversion functions AsFloat64() and similar did fail if the underlying type was not exactly the same type instead of trying to convert compatible other numeric types
    • NewCode() did not initialize BaseCommand
    • Code.ShortString() could have resulted in a nil dereference

    Enhancements

    • Added HasParameter() and IsMajorNumber() convenience methods to Code
    • Added methods to clone Code and CodeParameter instances
    • New Debug field in all connection types to output sent and received data
    • Remove unused SourceConnection field from all commands but Code
    • Changed BaseConnection.ReceiveJson() to return []byte and added BaseConnection.ReceiveJSONString() that returns a string

Log in to reply