2
0
mirror of https://github.com/edouardparis/lntop synced 2024-11-13 13:10:34 +00:00
lntop/app/app.go
2021-09-02 18:11:11 +02:00

32 lines
535 B
Go

package app
import (
"github.com/edouardparis/lntop/config"
"github.com/edouardparis/lntop/logging"
"github.com/edouardparis/lntop/network"
)
type App struct {
Config *config.Config
Logger logging.Logger
Network *network.Network
}
func New(cfg *config.Config) (*App, error) {
logger, err := logging.New(cfg.Logger)
if err != nil {
return nil, err
}
network, err := network.New(&cfg.Network, logger)
if err != nil {
return nil, err
}
return &App{
Config: cfg,
Logger: logger,
Network: network,
}, nil
}