v0.3.0 (2018-08-12)
- Added:
pay.NewEchoMiddleware(...)
- A middleware factory function for Echo (issue #2) - Added: Bolt DB client (issue #3)
- Struct
pay.BoltClient
- Implements theStorageClient
interface - Factory function
NewBoltClient(...)
- Struct
pay.BoltOptions
- Options for theBoltClient
- Var
pay.DefaultBoltOptions
- aBoltOptions
object with default values
- Struct
- Added:
pay.LNclient
- An abstraction of a client that connects to a Lightning Network node implementation (like lnd, c-lightning and eclair) - Added:
ln.LNDclient
- Implements thepay.LNclient
interface (issue #4)- Factory function
ln.NewLNDclient(...)
- Factory function
- Improved: Increased middleware performance by reusing the gRPC connection to the lnd backend (issue #4)
- With the same setup (local Gin web service,
pay.GoMap
as storage client, remote lnd, same hardware) it took about 100ms per request before, and takes about 25ms per request now. Measured from the arrival of the initial request until the sending of the response with the Lightning invoice (as logged by Gin).
- With the same setup (local Gin web service,
- Fixed: Success log message mentioned "HandlerFunc" in all middlewares despite it not always being a HandlerFunc
- Fixed: A wrong HTTP status code was used in responses when an internal error occurred (
400 Bad Request
instead of500 Internal Server Error
)
Breaking changes
Package pay
:
- Changed: Renamed
pay.InvoiceOptions.Amount
topay.InvoiceOptions.Price
to avoid misunderstandings
Package ln
(none of these changes should affect anyone, because this package is meant to be used only internally):
- Removed:
ln.NewLightningClient(...)
- Not required anymore after adding the much more usableln.NewLNDclient(...)
. - Changed:
ln.GenerateInvoice(...)
from being a function to being a method ofln.LNDclient
and removed all lnd connection-related parameters which are part of theLNDclient
. (issue #4) - Changed
ln.CheckInvoice(...)
from being a function to being a method ofln.LNDclient
and removed all lnd connection-related parameters which are part of theLNDclient
. (issue #4)