refactor all service dependency injection
This commit is contained in:
@@ -2,9 +2,11 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
@@ -14,8 +16,16 @@ import (
|
||||
"bsm/full/all/internal/service"
|
||||
)
|
||||
|
||||
var ServiceKey = "default"
|
||||
|
||||
func main() {
|
||||
config.New()
|
||||
workspace := flag.String("workspace", ServiceKey, "workspace used to select etc/{workspace}_{runtime}.yaml")
|
||||
flag.Parse()
|
||||
if value := strings.TrimSpace(*workspace); value != "" {
|
||||
ServiceKey = value
|
||||
}
|
||||
|
||||
config.New(ServiceKey)
|
||||
impl.NewImpl()
|
||||
|
||||
srv := allserver.New()
|
||||
|
||||
Reference in New Issue
Block a user