godsfapi [v3.1.1] - Official Go Client Library for DSF

  • Moderator

    godsfapi - Official Client

    This client has now been adopted as an official client and can from now on be found at

    Original post below

    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.


    • 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


    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.


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

  • Moderator

    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.

  • Moderator

    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

    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


    • 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

  • Moderator

    Release 1.2.4

    This is the final release of godsfapi v1 and is compatible with DSF up to version 1.2.4.

    Bug fixes

    • Converting CodeParameter instances with AsUint64() or AsUint64Slice() could fail if the underlying numeric type was a negative int64 value
    • When a connection to the socket was possible but no reading was possible (obscure permissions-problem) it would not return the error but nil instead
    • MachineModel structs were not correctly JSON-serialized to camelCase but PascalCase

  • Moderator

    Release 2.1.0

    This is a new major release of godsfapi that's compatible with Duet Software Framework 2.1.0 and later.

    Note that it is located at


    according to go module version conventions. If you want to upgrade you can use e.g. mod to assist you with import rewrites.

    This release has seen several major changes and thus is no longer compatible with DSF 1.2.4 and earlier.


    • package structure under machine has been brought more in line with C# client - this means except for MachineModel everything is in a new package now. Also most of the types from types package have now been moved to either some sub-package of machine or commands.
    • MachineModel and all related structs have been updated
    • All changes introduced with C# client have been ported over

  • Moderator

    Release 2.1.1

    This is a minor release with the following contents


    • Add LaserPwm to CurrentMove
    • Add Tools and TrackedObjects to Limits and make all *int to *int64
    • Derive IsExpression in NewSimpleCodeParameter


    • Code.Clone() was not cloning CodeParameter instances correctly
    • CodeParamterString() was not correct if CodeParameter.IsExpression is true

  • @wilriker Every time I see this thread, I wonder what the hell Gods' fapi is 🤔

  • Moderator

    @deckingman I stumble across that every once-in-a-while, too. 😂

  • Moderator

    Release 2.1.1

    Port changes from upstream

    • Increase ProtocolVersion
    • Add G53 to string output of commands that use it
    • Adjust types in object model
      • Add Skew to MoveCompensation
      • Make IoBits in RestorePoint nilable
      • Introduce SimpleFilamentMonitor


    • Add a new Code.HasFlag() method to check for flags being set

  • Moderator

    Release 3.1.0

    A new release that syncs all changes and the version number with DuetSoftwareFramework 3.1.0.

    As witht the upgrade to version 2.x this has now been moved to


    and you can use e.g. mod to help to migrate your code.

  • Moderator

    Relese 3.1.1

    This release adds

    • State BoardState to Boards
    • Time to State

    in the OM.

    It also increases ProtocolVersion to 8.

Log in to reply