mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-15 07:11:15 +00:00
API - CRUD for peers, interfaces and users (#340)
Public REST API implementation to handle peers, interfaces and users. It also includes some simple provisioning endpoints. The Swagger API documentation is available under /api/v1/doc.html
This commit is contained in:
@@ -22,9 +22,19 @@ type App struct {
|
||||
StatisticsCollector
|
||||
ConfigFileManager
|
||||
MailManager
|
||||
ApiV1Manager
|
||||
}
|
||||
|
||||
func New(cfg *config.Config, bus evbus.MessageBus, authenticator Authenticator, users UserManager, wireGuard WireGuardManager, stats StatisticsCollector, cfgFiles ConfigFileManager, mailer MailManager) (*App, error) {
|
||||
func New(
|
||||
cfg *config.Config,
|
||||
bus evbus.MessageBus,
|
||||
authenticator Authenticator,
|
||||
users UserManager,
|
||||
wireGuard WireGuardManager,
|
||||
stats StatisticsCollector,
|
||||
cfgFiles ConfigFileManager,
|
||||
mailer MailManager,
|
||||
) (*App, error) {
|
||||
|
||||
a := &App{
|
||||
Config: cfg,
|
||||
@@ -60,7 +70,7 @@ func New(cfg *config.Config, bus evbus.MessageBus, authenticator Authenticator,
|
||||
}
|
||||
|
||||
func (a *App) Startup(ctx context.Context) error {
|
||||
|
||||
|
||||
a.UserManager.StartBackgroundJobs(ctx)
|
||||
a.StatisticsCollector.StartBackgroundJobs(ctx)
|
||||
a.WireGuardManager.StartBackgroundJobs(ctx)
|
||||
|
Reference in New Issue
Block a user