interlockledger / go-interlockledger-rest-client Goto Github PK
View Code? Open in Web Editor NEWOur Go client to the InterlockLedger node REST API
License: BSD 3-Clause "New" or "Revised" License
Our Go client to the InterlockLedger node REST API
License: BSD 3-Clause "New" or "Revised" License
Add support for PFX files.
Enhance the documentation of the API for godoc. More examples and details about the API will help.
The code generated automatically generated by swagger is quite repetitive and can be optimized a lot by removing duplicated parts, such as:
if localVarHttpResponse.StatusCode == 200 {
var v DocumentsTransactionModel
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v map[string]Object
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
It would be nice to reduce the code size a lot by removing the code duplication. It will make the code easier to read and to maintain.
However, it is not a critical issue right now because the compiler should be removing those duplicated blocks in the compiled code anyway.
OpaqueService.Get()
is not returning the correct appId
. This happens because the current IL2 API is not returning it yet. As soon as the header name is defined, we will need to implement it as soon as possible.
Further optimize the auto generated code. There are a plenty of opportunities to remove unreachable code and reduce code duplication. The first optimization pass was just to reduce the code size.
Add a way to disable the server side certificate.
Add the ability to set the client certificates manually.
Update dependencies for v0.2.0.
Add new functions to make the certificate management more flexible.
Make the client.Configuration easier to use. In order to do that, we may add:
Implement the API for GET /opaque/{chain}/query
.
Remove all warnings from the code.
models.DecodeOptionalBytes()
panics when nil is passed to it.
Upgrade github.com/interlockledger/go-iltags to v0.2.2.
Implement the API for GET /opaque/{chain}@{serial}.
Implement the API for POST /opaque/{chain}
.
Fix the code generated by swagger tools as it is not working properly for some APIs and require some adjustments to be executed in the long run. Furthermore, some cryptographic operations required to use must be written by hand.
Remove the cast warning from APIClient.ToGenericSwaggerError()
. The warning is:
assigning the result of this type assertion to a variable (switch err := err.(type)) could eliminate type assertions in switch cases (S1034)
Implement the API GET /opaque/{chain}/asJson/query
. It is an easier to use replacement for GET /opaque/{chain}/query
(#8).
Add a specific error to identify optimistic lock issues.
The code generated by swagger does have internal documentation but it is more suitable for Javadoc or Doxygen than Godoc. Only the code manually written during the initial release is fully documented in the Godoc format.
Here is a bad example:
/*
DocumentsApiService Adds another document to a pending transaction of a MultiDocument
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param transactionId
* @param name
* @param contentType
* @param optional nil or *DocumentsApiDocumentsAddDocumentOpts - Optional Parameters:
* @param "Comment" (optional.String) -
* @param "Path" (optional.String) -
@return DocumentsTransactionModel
*/
We need to replace this documentation in the future to make the API more Go friendly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.