server

package
v0.0.0-...-a71e659 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2020 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Providers wire providers for the server package

Functions

func GetVersion

func GetVersion() http.HandlerFunc

GetVersion returns version

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

type InternalRouter interface {
	chi.Router
}

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) Close

func (s *Server) Close()

Close finalizes any open resources

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe will listen for requests

type VendoPunktoRouter

type VendoPunktoRouter interface {
	chi.Router
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL