From f5fee55905a5d414054bcf55aba7f362dee78898 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Thu, 17 Feb 2022 12:57:45 +0100 Subject: [PATCH] Mode from main --- services/entry/cmd/app/main.go | 2 ++ services/entry/pkg/api/api.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/services/entry/cmd/app/main.go b/services/entry/cmd/app/main.go index b5c639b..41f0ba5 100644 --- a/services/entry/cmd/app/main.go +++ b/services/entry/cmd/app/main.go @@ -6,10 +6,12 @@ import ( "serverctl/pkg/infrastructure/dependencies" ) +// Run main app, will bootstrap dependencies and run all external ports (http servers, queues, etc). func Run() { d := dependencies.New() d.Logger.Info("Starting serverctl") + // if development add seed data infrastructure.AddSeedData(d.Database, d.Logger) api. diff --git a/services/entry/pkg/api/api.go b/services/entry/pkg/api/api.go index 60b53a4..e26a8dd 100644 --- a/services/entry/pkg/api/api.go +++ b/services/entry/pkg/api/api.go @@ -12,6 +12,7 @@ import ( // Used for profiling import _ "net/http/pprof" +// ServerctlApi contains everything required for the api to run type ServerctlApi struct { logger *zap.Logger router *gin.Engine @@ -19,6 +20,7 @@ type ServerctlApi struct { dependencies *dependencies.Dependencies } +// NewServerctlApi Creates a new api struct func NewServerctlApi(dependencies *dependencies.Dependencies) *ServerctlApi { return &ServerctlApi{dependencies: dependencies} }