Skip to content

Technical Debt Tracking Issue #20

Description

@dylanirlbeck

The technical debt of the go-enf library will be tracked in this issue. Additional tasks should be added when needed.

Code cleanup

  • Add testing boilerplate (lots of redundant code with setting up test cases)
  • Generalize response struct (parametrize the type of the struct in the data property)
  • Standardize printf formatters (in some places we use %v for strings instead of %s, %+v in test cases, etc.) --- look into go-spew for pretty printing of structs.
  • Keep same tabs/spaces for json string literals in test files
  • Consider changing the Domains property of the Client to Domain

Testing

  • Improve test coverage. (Current coverage at ~ 58%)
  • Integration Tests(?)
  • Find out more composable way to perform unit testing
  • Remove the RequestBody field from the TestParams struct --- it's not needed.

Documentation

  • Add documentation to this library at docs.xaptum.com
  • Have comments on all exported methods/structs

New features

  • Make authenticating/creating a new client simpler (compared to other clients like the Stripe API, go-enf is a tad complex)
  • We should probably give users of go-enf access to the entire response object --- I believe some structs only have a subset of the fields.
  • Think about changing the response body of all the methods to exactly model the HTTP response. Other APIs (like Scale) do this, and it ensures the documentation is more accurate for the Go library. I.e.
    type Response struct {
       Data []interface{} `json:"data"`
       Page map[string]interface{} `json:"page"`
    }
  • Re-order the argument list in the get, post etc. helper functions to model this flow: Path, Request, Response.
  • Look at having the methods model the same structure as the API docs. For example, we should have Network.GetDomain instead of Domains.GetDomain, since the API docs list the GetDomain method under the Network subsection.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions