Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Providers = wire.NewSet( NewServer, NewRouter, NewInternalRouter, NewInvoiceHandler, NewCurrencyHandler, NewConfigHandler, NewPluginHandler, )
Providers wire providers for the server package
Functions ¶
Types ¶
type ConfigHandler ¶
type ConfigHandler struct {
// contains filtered or unexported fields
}
ConfigHandler for configurations
func NewConfigHandler ¶
func NewConfigHandler( runtime *conf.Runtime, globalLogger hclog.Logger, manager conf.Manager) (*ConfigHandler, error)
NewConfigHandler creates the config handler
func (*ConfigHandler) InternalRoutes ¶
func (handler *ConfigHandler) InternalRoutes() chi.Router
InternalRoutes creates a router for the internal API
type CurrencyHandler ¶
type CurrencyHandler struct {
// contains filtered or unexported fields
}
CurrencyHandler for currencies
func NewCurrencyHandler ¶
func NewCurrencyHandler(manager vendopunkto.PluginManager, currencyRepo vendopunkto.CurrencyRepository, runtime *conf.Runtime, globalLogger hclog.Logger) (*CurrencyHandler, error)
NewCurrencyHandler creates the currency handler
func (*CurrencyHandler) InternalRoutes ¶
func (handler *CurrencyHandler) InternalRoutes() chi.Router
InternalRoutes creates a router for the internal API
type InternalRouter ¶
InternalRouter is the router for the internal api
func NewInternalRouter ¶
func NewInternalRouter( invoice *InvoiceHandler, currencies *CurrencyHandler, config *ConfigHandler, plugin *PluginHandler, globalLogger hclog.Logger, txBuilder store.TransactionBuilder, startupConf conf.Startup, ) (*InternalRouter, error)
NewInternalRouter creates the router
type InvoiceHandler ¶
type InvoiceHandler struct {
// contains filtered or unexported fields
}
InvoiceHandler exposes APIs for interacting with invoices
func NewInvoiceHandler ¶
func NewInvoiceHandler( manager vendopunkto.InvoiceManager, globalLogger hclog.Logger, pluginMgr vendopunkto.PluginManager, topic vendopunkto.InvoiceTopic) *InvoiceHandler
NewInvoiceHandler the handler for invoices
func (*InvoiceHandler) InternalRoutes ¶
func (handler *InvoiceHandler) InternalRoutes() chi.Router
InternalRoutes are the internal routes, added to the internal API
func (*InvoiceHandler) Routes ¶
func (handler *InvoiceHandler) Routes() chi.Router
Routes are the public routes, added to the public API
type PluginHandler ¶
type PluginHandler struct {
// contains filtered or unexported fields
}
PluginHandler for plugins
func NewPluginHandler ¶
func NewPluginHandler(plugins vendopunkto.PluginManager, globalLogger hclog.Logger) (*PluginHandler, error)
NewPluginHandler creates the plugin handler
func (*PluginHandler) InternalRoutes ¶
func (handler *PluginHandler) InternalRoutes() chi.Router
InternalRoutes creates a router for the internal API
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the API web server
func NewServer ¶
func NewServer( router *VendoPunktoRouter, internalRouter *InternalRouter, db *pg.DB, txBuilder store.TransactionBuilder, globalLogger hclog.Logger, pluginManager vendopunkto.PluginManager, walletPoller *pluginwallet.WalletPoller, invoiceTopic vendopunkto.InvoiceTopic, startupConf conf.Startup) (*Server, error)
NewServer creates the server
func (*Server) ListenAndServe ¶
ListenAndServe will listen for requests
type VendoPunktoRouter ¶
VendoPunktoRouter is the public routerplugin
func NewRouter ¶
func NewRouter( invoices *InvoiceHandler, globalLogger hclog.Logger, txBuilder store.TransactionBuilder, startupConf conf.Startup, ) (*VendoPunktoRouter, error)
NewRouter Creates the chi Router and configures global paths