diff --git a/app/conf/appconfig.go b/app/conf/appconfig.go index 951173e..971c8f9 100644 --- a/app/conf/appconfig.go +++ b/app/conf/appconfig.go @@ -19,6 +19,7 @@ type AppConfig struct { Coins []Coins `json:"coins"` } +// Coins defines structure of supported coin data type Coins struct { DaemonVersion string `json:"daemonVersion"` CurrencyCode string `json:"currencyCode"` diff --git a/app/daemon/daemonapi/vars.go b/app/daemon/daemonapi/vars.go deleted file mode 100644 index 01c553a..0000000 --- a/app/daemon/daemonapi/vars.go +++ /dev/null @@ -1,8 +0,0 @@ -package daemonapi - -import "github.com/Encrypt-S/kauri-api/app/conf" - -// DaemonConfig holds pointer to DaemonConfig -// RPCUser string `json:"rpcUser"` -// RPCPassword string `json:"rpcPassword"` -var NavConfig *conf.DaemonConfig diff --git a/app/middleware/adapter.go b/app/middleware/adapter.go index 46df391..91b57b3 100644 --- a/app/middleware/adapter.go +++ b/app/middleware/adapter.go @@ -11,9 +11,12 @@ type Adapter func(http.Handler) http.Handler // and return a new (wrapped) http.Handler to use in its place // To make the adapters run in the order in which they are specified // you could reverse through them in the Adapt function - // in essence, this middleware allows us to run code before // and/or after our handler code in a HTTP request lifecycle + +// Adapt function iterates over all adapters +// calling them one by one (in reverse order) in a chained manner +// returning the result of the first adapter. func Adapt(h http.Handler, adapters ...Adapter) http.Handler { for _, adapter := range adapters { h = adapter(h)