From e9e913818522e10f64d823c74644f9d70c9c8c25 Mon Sep 17 00:00:00 2001 From: free5gc-org Date: Thu, 3 Feb 2022 16:16:18 +0000 Subject: [PATCH] refactor packages and update go.mod --- .gitignore | 18 +- .golangci.yml | 17 +- CHANGELOG.md | 9 - LICENSE.txt => LICENSE | 0 cmd/main.go | 75 ++++ go.mod | 22 +- go.sum | 184 +++++---- {context => internal/context}/context.go | 4 +- {logger => internal/logger}/logger.go | 43 ++- .../plugin}/nsselection_query_parameter.go | 0 {plugin => internal/plugin}/patch_document.go | 0 .../sbi/consumer}/nf_management.go | 4 +- .../api_nf_instance_id_document.go | 14 +- .../api_subscription_id_document.go | 8 +- .../api_subscriptions_collection.go | 8 +- .../sbi/nssaiavailability}/routers.go | 4 +- .../api_network_slice_information_document.go | 8 +- .../sbi/nsselection}/routers.go | 4 +- .../network_slice_information_document.go | 16 +- .../sbi/producer}/nf_instance_id_document.go | 28 +- .../sbi/producer}/nssaiavailability_store.go | 8 +- .../nssaiavailability_subscription.go | 6 +- .../producer}/nsselection_for_pdu_session.go | 4 +- .../producer}/nsselection_for_registration.go | 6 +- .../sbi/producer}/subscription_id_document.go | 12 +- .../sbi/producer}/subscriptions_collection.go | 12 +- {util => internal/util}/util.go | 18 +- nssf.go | 55 --- {factory => pkg/factory}/config.go | 14 +- {factory => pkg/factory}/factory.go | 2 +- {service => pkg/service}/init.go | 170 ++++----- test/conf/test_nssf_config.yaml | 353 ------------------ test/param.go | 44 --- test/util.go | 20 - 34 files changed, 422 insertions(+), 768 deletions(-) delete mode 100644 CHANGELOG.md rename LICENSE.txt => LICENSE (100%) create mode 100644 cmd/main.go rename {context => internal/context}/context.go (97%) rename {logger => internal/logger}/logger.go (70%) rename {plugin => internal/plugin}/nsselection_query_parameter.go (100%) rename {plugin => internal/plugin}/patch_document.go (100%) rename {consumer => internal/sbi/consumer}/nf_management.go (96%) rename {nssaiavailability => internal/sbi/nssaiavailability}/api_nf_instance_id_document.go (90%) rename {nssaiavailability => internal/sbi/nssaiavailability}/api_subscription_id_document.go (86%) rename {nssaiavailability => internal/sbi/nssaiavailability}/api_subscriptions_collection.go (89%) rename {nssaiavailability => internal/sbi/nssaiavailability}/routers.go (96%) rename {nsselection => internal/sbi/nsselection}/api_network_slice_information_document.go (81%) rename {nsselection => internal/sbi/nsselection}/routers.go (94%) rename {producer => internal/sbi/producer}/network_slice_information_document.go (90%) rename {producer => internal/sbi/producer}/nf_instance_id_document.go (66%) rename {producer => internal/sbi/producer}/nssaiavailability_store.go (97%) rename {producer => internal/sbi/producer}/nssaiavailability_subscription.go (95%) rename {producer => internal/sbi/producer}/nsselection_for_pdu_session.go (98%) rename {producer => internal/sbi/producer}/nsselection_for_registration.go (99%) rename {producer => internal/sbi/producer}/subscription_id_document.go (64%) rename {producer => internal/sbi/producer}/subscriptions_collection.go (69%) rename {util => internal/util}/util.go (97%) delete mode 100644 nssf.go rename {factory => pkg/factory}/config.go (86%) rename {factory => pkg/factory}/factory.go (95%) rename {service => pkg/service}/init.go (50%) delete mode 100644 test/conf/test_nssf_config.yaml delete mode 100644 test/param.go delete mode 100644 test/util.go diff --git a/.gitignore b/.gitignore index 6729600..c294e4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,18 @@ +# Swap files +*.swp + # Toolchain -# Goland project folder +# Golang project folder .idea/ + # Visual Studio Code .vscode/ + +# Build +build/ +log/ +vendor/ + # emacs/vim GPATH GRTAGS @@ -10,10 +20,10 @@ GTAGS TAGS tags cscope.* -# mac + +# macOS .DS_Store -# debug +# Debug *.log *.pcap - diff --git a/.golangci.yml b/.golangci.yml index fbb3db5..3ae4931 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -29,12 +29,6 @@ run: # "/" will be replaced by current OS file path separator to properly work # on Windows. skip-files: - - "api_.*\\.go$" - - "model_.*\\.go$" - - "routers.go" - - "client.go" - - "configuration.go" - - "nas.go" # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": # If invoked with -mod=readonly, the go command is disallowed from the implicit # automatic updating of go.mod described above. Instead, it fails when any changes @@ -249,13 +243,14 @@ linters: # Additional - lll - godox - #- gomnd - #- goconst + # - gomnd + # - goconst # - gocognit # - maligned # - nestif # - gomodguard - nakedret + # - golint - gci - misspell - gofumpt @@ -266,9 +261,9 @@ linters: - dogsled - bodyclose - asciicheck - #- stylecheck - # - unparam - # - wsl + # - stylecheck + # - unparam + # - wsl #disable-all: false fast: true diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index f465a20..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# Change Log ---- -2020-03-xx-xx ---- -- Implemented enchacements: - -- Fixed bugs: - -- Closed issues: diff --git a/LICENSE.txt b/LICENSE similarity index 100% rename from LICENSE.txt rename to LICENSE diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 0000000..c3872fc --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,75 @@ +package main + +import ( + "fmt" + "os" + "path/filepath" + "runtime/debug" + + "github.com/urfave/cli" + + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/internal/util" + "github.com/free5gc/nssf/pkg/service" + "github.com/free5gc/util/version" +) + +var NSSF = &service.NSSF{} + +func main() { + defer func() { + if p := recover(); p != nil { + // Print stack for panic to log. Fatalf() will let program exit. + logger.AppLog.Fatalf("panic: %v\n%s", p, string(debug.Stack())) + } + }() + + app := cli.NewApp() + app.Name = "nssf" + app.Usage = "5G Network Slice Selection Function (NSSF)" + app.Action = action + app.Flags = NSSF.GetCliCmd() + if err := app.Run(os.Args); err != nil { + logger.AppLog.Errorf("NSSF Run Error: %v\n", err) + } +} + +func action(c *cli.Context) error { + if err := initLogFile(c.String("log"), c.String("log5gc")); err != nil { + logger.AppLog.Errorf("%+v", err) + return err + } + + if err := NSSF.Initialize(c); err != nil { + logger.CfgLog.Errorf("%+v", err) + return fmt.Errorf("Failed to initialize !!") + } + + logger.AppLog.Infoln(c.App.Name) + logger.AppLog.Infoln("NSSF version: ", version.GetVersion()) + + NSSF.Start() + + return nil +} + +func initLogFile(logNfPath, log5gcPath string) error { + NSSF.KeyLogPath = util.NssfDefaultKeyLogPath + + if err := logger.LogFileHook(logNfPath, log5gcPath); err != nil { + return err + } + + if logNfPath != "" { + nfDir, _ := filepath.Split(logNfPath) + tmpDir := filepath.Join(nfDir, "key") + if err := os.MkdirAll(tmpDir, 0775); err != nil { + logger.InitLog.Errorf("Make directory %s failed: %+v", tmpDir, err) + return err + } + _, name := filepath.Split(util.NssfDefaultKeyLogPath) + NSSF.KeyLogPath = filepath.Join(tmpDir, name) + } + + return nil +} diff --git a/go.mod b/go.mod index 5fb3f2f..e855554 100644 --- a/go.mod +++ b/go.mod @@ -3,21 +3,13 @@ module github.com/free5gc/nssf go 1.14 require ( - github.com/antonfisher/nested-logrus-formatter v1.3.0 - github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect - github.com/evanphx/json-patch v4.9.0+incompatible - github.com/free5gc/http2_util v1.0.0 - github.com/free5gc/http_wrapper v1.0.0 - github.com/free5gc/logger_conf v1.0.0 - github.com/free5gc/logger_util v1.0.0 - github.com/free5gc/openapi v1.0.0 - github.com/free5gc/path_util v1.0.0 - github.com/free5gc/version v1.0.0 - github.com/gin-gonic/gin v1.6.3 - github.com/google/uuid v1.1.2 - github.com/leodido/go-urn v1.2.1 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/sirupsen/logrus v1.7.0 + github.com/antonfisher/nested-logrus-formatter v1.3.1 + github.com/evanphx/json-patch v0.5.2 + github.com/free5gc/openapi v1.0.4 + github.com/free5gc/util v1.0.1 + github.com/gin-gonic/gin v1.7.3 + github.com/google/uuid v1.3.0 + github.com/sirupsen/logrus v1.8.1 github.com/urfave/cli v1.22.5 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index f3e85a9..ae993f0 100644 --- a/go.sum +++ b/go.sum @@ -35,46 +35,35 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antonfisher/nested-logrus-formatter v1.3.0 h1:8zixYquU1Odk+vzAaAQPAdRh1ZjmUXNQ1T+dUBvlhVo= -github.com/antonfisher/nested-logrus-formatter v1.3.0/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA= +github.com/antonfisher/nested-logrus-formatter v1.3.1 h1:NFJIr+pzwv5QLHTPyKz9UMEoHck02Q9L0FP13b/xSbQ= +github.com/antonfisher/nested-logrus-formatter v1.3.1/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/free5gc/http2_util v1.0.0 h1:0laMypHUNizAE5zsLoeJQq0R4XrfbvsLCW4NHCPpc44= -github.com/free5gc/http2_util v1.0.0/go.mod h1:GN2BCD8IINjtnAKYGwe+dEeTBRFEv4lQnZblFIIhbdE= -github.com/free5gc/http_wrapper v1.0.0 h1:NdnDHkItXxUzoxggiQsnR9SObBdi6KmwcN+QUJs4CoQ= -github.com/free5gc/http_wrapper v1.0.0/go.mod h1:vVArDqfCo7fvmYGi9WRPj4yurSu86GxRh3iQ70aq+OE= -github.com/free5gc/logger_conf v1.0.0 h1:cMqqB8L4HjE57tP36mBmiVUPIcHv8Ayr12jKfeiwqZU= -github.com/free5gc/logger_conf v1.0.0/go.mod h1:DHecLXVV1qA5Z+lSoUvZdZ6tCtZidTNmtx99jsCfgLE= -github.com/free5gc/logger_util v1.0.0 h1:hLTCTnKlEqJURrBwooNFQLavWPdJzS0o9KGIYUNKdJI= -github.com/free5gc/logger_util v1.0.0/go.mod h1:TK/bAJbm/l2TMNmbsKn83+xUmDNqts69IEir/nCa8w0= -github.com/free5gc/openapi v1.0.0 h1:DaGVt05b1pSDBOailKAlLj6hAk6vunN0Nhzvl/xcWCY= -github.com/free5gc/openapi v1.0.0/go.mod h1:7OzxoWBj6KQgznMW2ZiUtZdCGY+t89v4wtgKLhluKgU= -github.com/free5gc/path_util v1.0.0 h1:vJPGTymaWtavz6fJ/7k6WKEYv5BQLAq/O04RP54sab0= -github.com/free5gc/path_util v1.0.0/go.mod h1:OpmcebEKrMPnH7Jg5lZ8y9ZWJNAjQ4l9FGWXUv58Mo0= -github.com/free5gc/version v1.0.0 h1:Kn4uOhyHT1IAgerBgWRHag4xLMDXrRsqubLeMv5Nb/w= -github.com/free5gc/version v1.0.0/go.mod h1:wOTwzjk7sqeysX1b/Z4x+pWBHFuZOPtQj3h+IJXSpmQ= +github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8P3k= +github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= +github.com/free5gc/openapi v1.0.4 h1:bC6oqXy8Z+3e532xLMFmrTHvdyv4sNGDPezQSslw5gQ= +github.com/free5gc/openapi v1.0.4/go.mod h1:KRCnnp0GeK0Bl4gnrX79cQAidKXNENf8VRdG0y9R0Fc= +github.com/free5gc/util v1.0.1 h1:A8bynjzZXkYMLOq9FN5J4Yg5mdjXhYoXc/FFFwSLPss= +github.com/free5gc/util v1.0.1/go.mod h1:VsA8FaZAxZW6eKzF/VXN2kuctl19Tj+NYH7ZxkZ+YCA= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.7.3 h1:aMBzLJ/GMEYmv1UWs2FFTcPISLrQH2mRgL9Glz8xows= +github.com/gin-gonic/gin v1.7.3/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -84,10 +73,35 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -102,7 +116,6 @@ github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= @@ -112,9 +125,9 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -123,8 +136,9 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -136,87 +150,111 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= -github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.1 h1:dz+JxTe7GZQdErTo7SREc1jQj/hFP1k7jyIAwODoW+k= -github.com/ugorji/go v1.2.1/go.mod h1:cSVypSfTLm2o9fKxXvQgn3rMmkPXovcWor6Qn5tbFmI= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.1 h1:/TRfW3XKkvWvmAYyCUaQlhoCDGjcvNR8xVVA/l5p/jQ= -github.com/ugorji/go/codec v1.2.1/go.mod h1:s/WxCRi46t8rA+fowL40EnmD7ec0XhR7ZypxeBNdzsM= github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.mongodb.org/mongo-driver v1.7.1/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 h1:sYNJzB4J8toYPQTM6pAkcmBRgw9SnQKP9oXCHfgy604= -golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -259,7 +297,6 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191021144547-ec77196f6094/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -274,29 +311,35 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 h1:lwlPPsmjDKK0J6eG6xDWd5XPehI0R024zxjDnw3esPA= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 h1:Lm4OryKCca1vehdsWogr9N4t7NfZxLbJoc/H0w4K4S4= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5 h1:Ati8dO7+U7mxpkPSxBZQEvzHVUYB/MqCklCN8ig5w/o= +golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -305,7 +348,6 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -320,17 +362,17 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f h1:QdHQnPce6K4XQewki9WNbG5KOROuDzqO3NaYjI1cXJ0= -golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -340,9 +382,14 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -400,9 +447,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -455,14 +501,12 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/h2non/gentleman.v1 v1.0.4/go.mod h1:JYuHVdFzS4MKOXe0o+chKJ4hCe6tqKKw9XH9YP6WFrg= -gopkg.in/h2non/gock.v1 v1.0.16 h1:F11k+OafeuFENsjei5t2vMTSTs9L62AdyTe4E1cgdG8= -gopkg.in/h2non/gock.v1 v1.0.16/go.mod h1:XVuDAssexPLwgxCLMvDTWNU5eqklsydR6I5phZ9oPB8= +gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= +gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/context/context.go b/internal/context/context.go similarity index 97% rename from context/context.go rename to internal/context/context.go index 9f5f040..1936b3f 100644 --- a/context/context.go +++ b/internal/context/context.go @@ -15,8 +15,8 @@ import ( "github.com/google/uuid" - "github.com/free5gc/nssf/factory" - "github.com/free5gc/nssf/logger" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/pkg/factory" "github.com/free5gc/openapi/models" ) diff --git a/logger/logger.go b/internal/logger/logger.go similarity index 70% rename from logger/logger.go rename to internal/logger/logger.go index a641bd5..8653bef 100644 --- a/logger/logger.go +++ b/internal/logger/logger.go @@ -7,8 +7,7 @@ import ( formatter "github.com/antonfisher/nested-logrus-formatter" "github.com/sirupsen/logrus" - "github.com/free5gc/logger_conf" - "github.com/free5gc/logger_util" + logger_util "github.com/free5gc/util/logger" ) var ( @@ -38,16 +37,6 @@ func init() { FieldsOrder: []string{"component", "category"}, } - free5gcLogHook, err := logger_util.NewFileHook(logger_conf.Free5gcLogFile, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0o666) - if err == nil { - log.Hooks.Add(free5gcLogHook) - } - - selfLogHook, err := logger_util.NewFileHook(logger_conf.NfLogDir+"nssf.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0o666) - if err == nil { - log.Hooks.Add(selfLogHook) - } - AppLog = log.WithFields(logrus.Fields{"component": "NSSF", "category": "App"}) ContextLog = log.WithFields(logrus.Fields{"component": "NSSF", "category": "CTX"}) FactoryLog = log.WithFields(logrus.Fields{"component": "NSSF", "category": "Factory"}) @@ -61,10 +50,36 @@ func init() { GinLog = log.WithFields(logrus.Fields{"component": "NSSF", "category": "GIN"}) } +func LogFileHook(logNfPath string, log5gcPath string) error { + if fullPath, err := logger_util.CreateFree5gcLogFile(log5gcPath); err == nil { + if fullPath != "" { + free5gcLogHook, hookErr := logger_util.NewFileHook(fullPath, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0o666) + if hookErr != nil { + return hookErr + } + log.Hooks.Add(free5gcLogHook) + } + } else { + return err + } + + if fullPath, err := logger_util.CreateNfLogFile(logNfPath, "nssf.log"); err == nil { + selfLogHook, hookErr := logger_util.NewFileHook(fullPath, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0o666) + if hookErr != nil { + return hookErr + } + log.Hooks.Add(selfLogHook) + } else { + return err + } + + return nil +} + func SetLogLevel(level logrus.Level) { log.SetLevel(level) } -func SetReportCaller(set bool) { - log.SetReportCaller(set) +func SetReportCaller(enable bool) { + log.SetReportCaller(enable) } diff --git a/plugin/nsselection_query_parameter.go b/internal/plugin/nsselection_query_parameter.go similarity index 100% rename from plugin/nsselection_query_parameter.go rename to internal/plugin/nsselection_query_parameter.go diff --git a/plugin/patch_document.go b/internal/plugin/patch_document.go similarity index 100% rename from plugin/patch_document.go rename to internal/plugin/patch_document.go diff --git a/consumer/nf_management.go b/internal/sbi/consumer/nf_management.go similarity index 96% rename from consumer/nf_management.go rename to internal/sbi/consumer/nf_management.go index 26c9e6c..9f01f9a 100644 --- a/consumer/nf_management.go +++ b/internal/sbi/consumer/nf_management.go @@ -13,8 +13,8 @@ import ( "strings" "time" - nssf_context "github.com/free5gc/nssf/context" - "github.com/free5gc/nssf/logger" + nssf_context "github.com/free5gc/nssf/internal/context" + "github.com/free5gc/nssf/internal/logger" "github.com/free5gc/openapi" "github.com/free5gc/openapi/Nnrf_NFManagement" "github.com/free5gc/openapi/models" diff --git a/nssaiavailability/api_nf_instance_id_document.go b/internal/sbi/nssaiavailability/api_nf_instance_id_document.go similarity index 90% rename from nssaiavailability/api_nf_instance_id_document.go rename to internal/sbi/nssaiavailability/api_nf_instance_id_document.go index e1ab5fd..daf6213 100644 --- a/nssaiavailability/api_nf_instance_id_document.go +++ b/internal/sbi/nssaiavailability/api_nf_instance_id_document.go @@ -14,16 +14,16 @@ import ( "github.com/gin-gonic/gin" - "github.com/free5gc/http_wrapper" - "github.com/free5gc/nssf/logger" - "github.com/free5gc/nssf/plugin" - "github.com/free5gc/nssf/producer" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/internal/plugin" + "github.com/free5gc/nssf/internal/sbi/producer" "github.com/free5gc/openapi" "github.com/free5gc/openapi/models" + "github.com/free5gc/util/httpwrapper" ) func HTTPNSSAIAvailabilityDelete(c *gin.Context) { - req := http_wrapper.NewRequest(c.Request, nil) + req := httpwrapper.NewRequest(c.Request, nil) req.Params["nfId"] = c.Params.ByName("nfId") rsp := producer.HandleNSSAIAvailabilityDelete(req) @@ -71,7 +71,7 @@ func HTTPNSSAIAvailabilityPatch(c *gin.Context) { return } - req := http_wrapper.NewRequest(c.Request, nssaiAvailabilityUpdateInfo) + req := httpwrapper.NewRequest(c.Request, nssaiAvailabilityUpdateInfo) req.Params["nfId"] = c.Params.ByName("nfId") rsp := producer.HandleNSSAIAvailabilityPatch(req) @@ -119,7 +119,7 @@ func HTTPNSSAIAvailabilityPut(c *gin.Context) { return } - req := http_wrapper.NewRequest(c.Request, nssaiAvailabilityInfo) + req := httpwrapper.NewRequest(c.Request, nssaiAvailabilityInfo) req.Params["nfId"] = c.Params.ByName("nfId") rsp := producer.HandleNSSAIAvailabilityPut(req) diff --git a/nssaiavailability/api_subscription_id_document.go b/internal/sbi/nssaiavailability/api_subscription_id_document.go similarity index 86% rename from nssaiavailability/api_subscription_id_document.go rename to internal/sbi/nssaiavailability/api_subscription_id_document.go index b9be5d0..0ca5bea 100644 --- a/nssaiavailability/api_subscription_id_document.go +++ b/internal/sbi/nssaiavailability/api_subscription_id_document.go @@ -14,11 +14,11 @@ import ( "github.com/gin-gonic/gin" - "github.com/free5gc/http_wrapper" - "github.com/free5gc/nssf/logger" - "github.com/free5gc/nssf/producer" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/internal/sbi/producer" "github.com/free5gc/openapi" "github.com/free5gc/openapi/models" + "github.com/free5gc/util/httpwrapper" ) func HTTPNSSAIAvailabilityUnsubscribe(c *gin.Context) { @@ -30,7 +30,7 @@ func HTTPNSSAIAvailabilityUnsubscribe(c *gin.Context) { return } - req := http_wrapper.NewRequest(c.Request, nil) + req := httpwrapper.NewRequest(c.Request, nil) req.Params["subscriptionId"] = c.Params.ByName("subscriptionId") rsp := producer.HandleNSSAIAvailabilityUnsubscribe(req) diff --git a/nssaiavailability/api_subscriptions_collection.go b/internal/sbi/nssaiavailability/api_subscriptions_collection.go similarity index 89% rename from nssaiavailability/api_subscriptions_collection.go rename to internal/sbi/nssaiavailability/api_subscriptions_collection.go index 0049ad0..86499ac 100644 --- a/nssaiavailability/api_subscriptions_collection.go +++ b/internal/sbi/nssaiavailability/api_subscriptions_collection.go @@ -14,11 +14,11 @@ import ( "github.com/gin-gonic/gin" - "github.com/free5gc/http_wrapper" - "github.com/free5gc/nssf/logger" - "github.com/free5gc/nssf/producer" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/internal/sbi/producer" "github.com/free5gc/openapi" . "github.com/free5gc/openapi/models" + "github.com/free5gc/util/httpwrapper" ) func HTTPNSSAIAvailabilityPost(c *gin.Context) { @@ -50,7 +50,7 @@ func HTTPNSSAIAvailabilityPost(c *gin.Context) { return } - req := http_wrapper.NewRequest(c.Request, createData) + req := httpwrapper.NewRequest(c.Request, createData) rsp := producer.HandleNSSAIAvailabilityPost(req) diff --git a/nssaiavailability/routers.go b/internal/sbi/nssaiavailability/routers.go similarity index 96% rename from nssaiavailability/routers.go rename to internal/sbi/nssaiavailability/routers.go index ea55c82..d39d136 100644 --- a/nssaiavailability/routers.go +++ b/internal/sbi/nssaiavailability/routers.go @@ -15,8 +15,8 @@ import ( "github.com/gin-gonic/gin" - "github.com/free5gc/logger_util" - "github.com/free5gc/nssf/logger" + "github.com/free5gc/nssf/internal/logger" + logger_util "github.com/free5gc/util/logger" ) // Route is the information for every URI. diff --git a/nsselection/api_network_slice_information_document.go b/internal/sbi/nsselection/api_network_slice_information_document.go similarity index 81% rename from nsselection/api_network_slice_information_document.go rename to internal/sbi/nsselection/api_network_slice_information_document.go index 07927b7..5078b43 100644 --- a/nsselection/api_network_slice_information_document.go +++ b/internal/sbi/nsselection/api_network_slice_information_document.go @@ -14,15 +14,15 @@ import ( "github.com/gin-gonic/gin" - "github.com/free5gc/http_wrapper" - "github.com/free5gc/nssf/logger" - "github.com/free5gc/nssf/producer" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/internal/sbi/producer" "github.com/free5gc/openapi" "github.com/free5gc/openapi/models" + "github.com/free5gc/util/httpwrapper" ) func HTTPNetworkSliceInformationDocument(c *gin.Context) { - req := http_wrapper.NewRequest(c.Request, nil) + req := httpwrapper.NewRequest(c.Request, nil) rsp := producer.HandleNSSelectionGet(req) diff --git a/nsselection/routers.go b/internal/sbi/nsselection/routers.go similarity index 94% rename from nsselection/routers.go rename to internal/sbi/nsselection/routers.go index 800d9ee..514dd27 100644 --- a/nsselection/routers.go +++ b/internal/sbi/nsselection/routers.go @@ -15,8 +15,8 @@ import ( "github.com/gin-gonic/gin" - "github.com/free5gc/logger_util" - "github.com/free5gc/nssf/logger" + "github.com/free5gc/nssf/internal/logger" + logger_util "github.com/free5gc/util/logger" ) // Route is the information for every URI. diff --git a/producer/network_slice_information_document.go b/internal/sbi/producer/network_slice_information_document.go similarity index 90% rename from producer/network_slice_information_document.go rename to internal/sbi/producer/network_slice_information_document.go index 08b3697..25085e0 100644 --- a/producer/network_slice_information_document.go +++ b/internal/sbi/producer/network_slice_information_document.go @@ -16,11 +16,11 @@ import ( "net/url" "strings" - "github.com/free5gc/http_wrapper" - "github.com/free5gc/nssf/logger" - "github.com/free5gc/nssf/plugin" - "github.com/free5gc/nssf/util" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/internal/plugin" + "github.com/free5gc/nssf/internal/util" "github.com/free5gc/openapi/models" + "github.com/free5gc/util/httpwrapper" ) // Parse NSSelectionGet query parameter @@ -90,7 +90,7 @@ func checkNfServiceConsumer(nfType models.NfType) error { } // NSSelectionGet - Retrieve the Network Slice Selection Information -func HandleNSSelectionGet(request *http_wrapper.Request) *http_wrapper.Response { +func HandleNSSelectionGet(request *httpwrapper.Request) *httpwrapper.Response { logger.Nsselection.Infof("Handle NSSelectionGet") query := request.Query @@ -98,15 +98,15 @@ func HandleNSSelectionGet(request *http_wrapper.Request) *http_wrapper.Response response, problemDetails := NSSelectionGetProcedure(query) if response != nil { - return http_wrapper.NewResponse(http.StatusOK, nil, response) + return httpwrapper.NewResponse(http.StatusOK, nil, response) } else if problemDetails != nil { - return http_wrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) + return httpwrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) } problemDetails = &models.ProblemDetails{ Status: http.StatusForbidden, Cause: "UNSPECIFIED", } - return http_wrapper.NewResponse(http.StatusForbidden, nil, problemDetails) + return httpwrapper.NewResponse(http.StatusForbidden, nil, problemDetails) } func NSSelectionGetProcedure(query url.Values) (*models.AuthorizedNetworkSliceInfo, *models.ProblemDetails) { diff --git a/producer/nf_instance_id_document.go b/internal/sbi/producer/nf_instance_id_document.go similarity index 66% rename from producer/nf_instance_id_document.go rename to internal/sbi/producer/nf_instance_id_document.go index a2ca480..787650a 100644 --- a/producer/nf_instance_id_document.go +++ b/internal/sbi/producer/nf_instance_id_document.go @@ -12,15 +12,15 @@ package producer import ( "net/http" - "github.com/free5gc/http_wrapper" - "github.com/free5gc/nssf/logger" - "github.com/free5gc/nssf/plugin" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/internal/plugin" "github.com/free5gc/openapi/models" + "github.com/free5gc/util/httpwrapper" ) // HandleNSSAIAvailabilityDelete - Deletes an already existing S-NSSAIs per TA // provided by the NF service consumer (e.g AMF) -func HandleNSSAIAvailabilityDelete(request *http_wrapper.Request) *http_wrapper.Response { +func HandleNSSAIAvailabilityDelete(request *httpwrapper.Request) *httpwrapper.Response { logger.Nssaiavailability.Infof("Handle NSSAIAvailabilityDelete") nfID := request.Params["nfId"] @@ -28,14 +28,14 @@ func HandleNSSAIAvailabilityDelete(request *http_wrapper.Request) *http_wrapper. problemDetails := NSSAIAvailabilityDeleteProcedure(nfID) if problemDetails != nil { - return http_wrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) + return httpwrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) } - return http_wrapper.NewResponse(http.StatusNoContent, nil, nil) + return httpwrapper.NewResponse(http.StatusNoContent, nil, nil) } // HandleNSSAIAvailabilityPatch - Updates an already existing S-NSSAIs per TA // provided by the NF service consumer (e.g AMF) -func HandleNSSAIAvailabilityPatch(request *http_wrapper.Request) *http_wrapper.Response { +func HandleNSSAIAvailabilityPatch(request *httpwrapper.Request) *httpwrapper.Response { logger.Nssaiavailability.Infof("Handle NSSAIAvailabilityPatch") nssaiAvailabilityUpdateInfo := request.Body.(plugin.PatchDocument) @@ -49,20 +49,20 @@ func HandleNSSAIAvailabilityPatch(request *http_wrapper.Request) *http_wrapper.R response, problemDetails := NSSAIAvailabilityPatchProcedure(nssaiAvailabilityUpdateInfo, nfID) if response != nil { - return http_wrapper.NewResponse(http.StatusOK, nil, response) + return httpwrapper.NewResponse(http.StatusOK, nil, response) } else if problemDetails != nil { - return http_wrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) + return httpwrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) } problemDetails = &models.ProblemDetails{ Status: http.StatusForbidden, Cause: "UNSPECIFIED", } - return http_wrapper.NewResponse(http.StatusForbidden, nil, problemDetails) + return httpwrapper.NewResponse(http.StatusForbidden, nil, problemDetails) } // HandleNSSAIAvailabilityPut - Updates/replaces the NSSF // with the S-NSSAIs the NF service consumer (e.g AMF) supports per TA -func HandleNSSAIAvailabilityPut(request *http_wrapper.Request) *http_wrapper.Response { +func HandleNSSAIAvailabilityPut(request *httpwrapper.Request) *httpwrapper.Response { logger.Nssaiavailability.Infof("Handle NSSAIAvailabilityPut") nssaiAvailabilityInfo := request.Body.(models.NssaiAvailabilityInfo) @@ -71,13 +71,13 @@ func HandleNSSAIAvailabilityPut(request *http_wrapper.Request) *http_wrapper.Res response, problemDetails := NSSAIAvailabilityPutProcedure(nssaiAvailabilityInfo, nfID) if response != nil { - return http_wrapper.NewResponse(http.StatusOK, nil, response) + return httpwrapper.NewResponse(http.StatusOK, nil, response) } else if problemDetails != nil { - return http_wrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) + return httpwrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) } problemDetails = &models.ProblemDetails{ Status: http.StatusForbidden, Cause: "UNSPECIFIED", } - return http_wrapper.NewResponse(http.StatusForbidden, nil, problemDetails) + return httpwrapper.NewResponse(http.StatusForbidden, nil, problemDetails) } diff --git a/producer/nssaiavailability_store.go b/internal/sbi/producer/nssaiavailability_store.go similarity index 97% rename from producer/nssaiavailability_store.go rename to internal/sbi/producer/nssaiavailability_store.go index 5784d11..3d9354a 100644 --- a/producer/nssaiavailability_store.go +++ b/internal/sbi/producer/nssaiavailability_store.go @@ -15,10 +15,10 @@ import ( jsonpatch "github.com/evanphx/json-patch" - "github.com/free5gc/nssf/factory" - "github.com/free5gc/nssf/logger" - "github.com/free5gc/nssf/plugin" - "github.com/free5gc/nssf/util" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/internal/plugin" + "github.com/free5gc/nssf/internal/util" + "github.com/free5gc/nssf/pkg/factory" "github.com/free5gc/openapi/models" ) diff --git a/producer/nssaiavailability_subscription.go b/internal/sbi/producer/nssaiavailability_subscription.go similarity index 95% rename from producer/nssaiavailability_subscription.go rename to internal/sbi/producer/nssaiavailability_subscription.go index 744eb95..47329a2 100644 --- a/producer/nssaiavailability_subscription.go +++ b/internal/sbi/producer/nssaiavailability_subscription.go @@ -13,9 +13,9 @@ import ( "strconv" "time" - "github.com/free5gc/nssf/factory" - "github.com/free5gc/nssf/logger" - "github.com/free5gc/nssf/util" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/internal/util" + "github.com/free5gc/nssf/pkg/factory" "github.com/free5gc/openapi/models" ) diff --git a/producer/nsselection_for_pdu_session.go b/internal/sbi/producer/nsselection_for_pdu_session.go similarity index 98% rename from producer/nsselection_for_pdu_session.go rename to internal/sbi/producer/nsselection_for_pdu_session.go index 49a34db..045a655 100644 --- a/producer/nsselection_for_pdu_session.go +++ b/internal/sbi/producer/nsselection_for_pdu_session.go @@ -11,8 +11,8 @@ import ( "math/rand" "net/http" - "github.com/free5gc/nssf/plugin" - "github.com/free5gc/nssf/util" + "github.com/free5gc/nssf/internal/plugin" + "github.com/free5gc/nssf/internal/util" "github.com/free5gc/openapi/models" ) diff --git a/producer/nsselection_for_registration.go b/internal/sbi/producer/nsselection_for_registration.go similarity index 99% rename from producer/nsselection_for_registration.go rename to internal/sbi/producer/nsselection_for_registration.go index dd80730..3c5c5b6 100644 --- a/producer/nsselection_for_registration.go +++ b/internal/sbi/producer/nsselection_for_registration.go @@ -9,9 +9,9 @@ package producer import ( "net/http" - "github.com/free5gc/nssf/logger" - "github.com/free5gc/nssf/plugin" - "github.com/free5gc/nssf/util" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/internal/plugin" + "github.com/free5gc/nssf/internal/util" "github.com/free5gc/openapi/models" ) diff --git a/producer/subscription_id_document.go b/internal/sbi/producer/subscription_id_document.go similarity index 64% rename from producer/subscription_id_document.go rename to internal/sbi/producer/subscription_id_document.go index e130608..c245d55 100644 --- a/producer/subscription_id_document.go +++ b/internal/sbi/producer/subscription_id_document.go @@ -12,13 +12,13 @@ package producer import ( "net/http" - "github.com/free5gc/http_wrapper" - "github.com/free5gc/nssf/logger" + "github.com/free5gc/nssf/internal/logger" "github.com/free5gc/openapi/models" + "github.com/free5gc/util/httpwrapper" ) // HandleNSSAIAvailabilityUnsubscribe - Deletes an already existing NSSAI availability notification subscription -func HandleNSSAIAvailabilityUnsubscribe(request *http_wrapper.Request) *http_wrapper.Response { +func HandleNSSAIAvailabilityUnsubscribe(request *httpwrapper.Request) *httpwrapper.Response { logger.Nssaiavailability.Infof("Handle NSSAIAvailabilityUnsubscribe") subscriptionID := request.Params["subscriptionId"] @@ -26,13 +26,13 @@ func HandleNSSAIAvailabilityUnsubscribe(request *http_wrapper.Request) *http_wra problemDetails := NSSAIAvailabilityUnsubscribeProcedure(subscriptionID) if problemDetails == nil { - return http_wrapper.NewResponse(http.StatusNoContent, nil, nil) + return httpwrapper.NewResponse(http.StatusNoContent, nil, nil) } else if problemDetails != nil { - return http_wrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) + return httpwrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) } problemDetails = &models.ProblemDetails{ Status: http.StatusForbidden, Cause: "UNSPECIFIED", } - return http_wrapper.NewResponse(http.StatusForbidden, nil, problemDetails) + return httpwrapper.NewResponse(http.StatusForbidden, nil, problemDetails) } diff --git a/producer/subscriptions_collection.go b/internal/sbi/producer/subscriptions_collection.go similarity index 69% rename from producer/subscriptions_collection.go rename to internal/sbi/producer/subscriptions_collection.go index 29df295..5cdc574 100644 --- a/producer/subscriptions_collection.go +++ b/internal/sbi/producer/subscriptions_collection.go @@ -12,13 +12,13 @@ package producer import ( "net/http" - "github.com/free5gc/http_wrapper" - "github.com/free5gc/nssf/logger" + "github.com/free5gc/nssf/internal/logger" "github.com/free5gc/openapi/models" + "github.com/free5gc/util/httpwrapper" ) // HandleNSSAIAvailabilityPost - Creates subscriptions for notification about updates to NSSAI availability information -func HandleNSSAIAvailabilityPost(request *http_wrapper.Request) *http_wrapper.Response { +func HandleNSSAIAvailabilityPost(request *httpwrapper.Request) *httpwrapper.Response { logger.Nssaiavailability.Infof("Handle NSSAIAvailabilityPost") createData := request.Body.(models.NssfEventSubscriptionCreateData) @@ -29,13 +29,13 @@ func HandleNSSAIAvailabilityPost(request *http_wrapper.Request) *http_wrapper.Re if response != nil { // TODO: Based on TS 29.531 5.3.2.3.1, add location header - return http_wrapper.NewResponse(http.StatusCreated, nil, response) + return httpwrapper.NewResponse(http.StatusCreated, nil, response) } else if problemDetails != nil { - return http_wrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) + return httpwrapper.NewResponse(int(problemDetails.Status), nil, problemDetails) } problemDetails = &models.ProblemDetails{ Status: http.StatusForbidden, Cause: "UNSPECIFIED", } - return http_wrapper.NewResponse(http.StatusForbidden, nil, problemDetails) + return httpwrapper.NewResponse(http.StatusForbidden, nil, problemDetails) } diff --git a/util/util.go b/internal/util/util.go similarity index 97% rename from util/util.go rename to internal/util/util.go index c0782ba..290d518 100644 --- a/util/util.go +++ b/internal/util/util.go @@ -9,10 +9,9 @@ import ( "fmt" "reflect" - "github.com/free5gc/nssf/factory" - "github.com/free5gc/nssf/logger" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/pkg/factory" "github.com/free5gc/openapi/models" - "github.com/free5gc/path_util" ) // Title in Problem Details for NSSF HTTP APIs @@ -24,14 +23,13 @@ const ( ) // Path of HTTP2 key and log file -var ( - NSSF_LOG_PATH = path_util.Free5gcPath("free5gc/nssfsslkey.log") - NSSF_PEM_PATH = path_util.Free5gcPath("free5gc/support/TLS/nssf.pem") - NSSF_KEY_PATH = path_util.Free5gcPath("free5gc/support/TLS/nssf.key") -) - // Default configuration file -var DEFAULT_CONFIG string = "free5gc/config/nssfcfg.yaml" +const ( + NssfDefaultKeyLogPath = "./log/nssfsslkey.log" + NssfDefaultPemPath = "./config/TLS/nssf.pem" + NssfDefaultKeyPath = "./config/TLS/nssf.key" + NssfDefaultConfigPath = "./config/nssfcfg.yaml" +) // Check if a slice contains an element func Contain(target interface{}, slice interface{}) bool { diff --git a/nssf.go b/nssf.go deleted file mode 100644 index 46a7f77..0000000 --- a/nssf.go +++ /dev/null @@ -1,55 +0,0 @@ -/* - * NSSF - * - * Network Slice Selection Function - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package main - -import ( - "fmt" - "os" - - "github.com/sirupsen/logrus" - "github.com/urfave/cli" - - "github.com/free5gc/nssf/logger" - "github.com/free5gc/nssf/service" - "github.com/free5gc/version" -) - -var NSSF = &service.NSSF{} - -var appLog *logrus.Entry - -func init() { - appLog = logger.AppLog -} - -func main() { - app := cli.NewApp() - app.Name = "nssf" - fmt.Print(app.Name, "\n") - appLog.Infoln("NSSF version: ", version.GetVersion()) - app.Usage = "-free5gccfg common configuration file -nssfcfg nssf configuration file" - app.Action = action - app.Flags = NSSF.GetCliCmd() - - if err := app.Run(os.Args); err != nil { - appLog.Errorf("NSSF Run Error: %v", err) - } -} - -func action(c *cli.Context) error { - if err := NSSF.Initialize(c); err != nil { - logger.CfgLog.Errorf("%+v", err) - return fmt.Errorf("Failed to initialize !!") - } - - NSSF.Start() - - return nil -} diff --git a/factory/config.go b/pkg/factory/config.go similarity index 86% rename from factory/config.go rename to pkg/factory/config.go index 3901097..f31fa65 100644 --- a/factory/config.go +++ b/pkg/factory/config.go @@ -5,12 +5,12 @@ package factory import ( - "github.com/free5gc/logger_util" "github.com/free5gc/openapi/models" + logger_util "github.com/free5gc/util/logger" ) const ( - NSSF_EXPECTED_CONFIG_VERSION = "1.0.0" + NSSF_EXPECTED_CONFIG_VERSION = "1.0.1" ) type Config struct { @@ -48,10 +48,16 @@ type Configuration struct { type Sbi struct { Scheme models.UriScheme `yaml:"scheme"` // Currently only support IPv4 and thus `Ipv4Addr` field shall not be empty - RegisterIPv4 string `yaml:"registerIPv4,omitempty"` // IP that is registered at NRF. + RegisterIPv4 string `yaml:"registerIPv4,omitempty" valid:"host,required"` // IP that is registered at NRF. // IPv6Addr string `yaml:"ipv6Addr,omitempty"` - BindingIPv4 string `yaml:"bindingIPv4,omitempty"` // IP used to run the server in the node. + BindingIPv4 string `yaml:"bindingIPv4,omitempty" valid:"host,required"` // IP used to run the server in the node. Port int `yaml:"port"` + Tls *Tls `yaml:"tls,omitempty" valid:"optional"` +} + +type Tls struct { + Pem string `yaml:"pem,omitempty" valid:"type(string),minstringlength(1),required"` + Key string `yaml:"key,omitempty" valid:"type(string),minstringlength(1),required"` } type AmfConfig struct { diff --git a/factory/factory.go b/pkg/factory/factory.go similarity index 95% rename from factory/factory.go rename to pkg/factory/factory.go index 8867159..afbcfa5 100644 --- a/factory/factory.go +++ b/pkg/factory/factory.go @@ -11,7 +11,7 @@ import ( "gopkg.in/yaml.v2" - "github.com/free5gc/nssf/logger" + "github.com/free5gc/nssf/internal/logger" ) var ( diff --git a/service/init.go b/pkg/service/init.go similarity index 50% rename from service/init.go rename to pkg/service/init.go index 601727a..bdf374c 100644 --- a/service/init.go +++ b/pkg/service/init.go @@ -10,76 +10,71 @@ import ( "os" "os/exec" "os/signal" + "runtime/debug" "sync" "syscall" "github.com/sirupsen/logrus" "github.com/urfave/cli" - "github.com/free5gc/http2_util" - "github.com/free5gc/logger_util" - "github.com/free5gc/nssf/consumer" - "github.com/free5gc/nssf/context" - "github.com/free5gc/nssf/factory" - "github.com/free5gc/nssf/logger" - "github.com/free5gc/nssf/nssaiavailability" - "github.com/free5gc/nssf/nsselection" - "github.com/free5gc/nssf/util" - openApiLogger "github.com/free5gc/openapi/logger" - "github.com/free5gc/path_util" - pathUtilLogger "github.com/free5gc/path_util/logger" + "github.com/free5gc/nssf/internal/context" + "github.com/free5gc/nssf/internal/logger" + "github.com/free5gc/nssf/internal/sbi/consumer" + "github.com/free5gc/nssf/internal/sbi/nssaiavailability" + "github.com/free5gc/nssf/internal/sbi/nsselection" + "github.com/free5gc/nssf/internal/util" + "github.com/free5gc/nssf/pkg/factory" + "github.com/free5gc/util/httpwrapper" + logger_util "github.com/free5gc/util/logger" ) -type NSSF struct{} +type NSSF struct { + KeyLogPath string +} type ( - // Config information. - Config struct { - nssfcfg string + // Commands information. + Commands struct { + config string } ) -var config Config +var commands Commands -var nssfCLi = []cli.Flag{ +var cliCmd = []cli.Flag{ cli.StringFlag{ - Name: "free5gccfg", - Usage: "common config file", + Name: "config, c", + Usage: "Load configuration from `FILE`", }, cli.StringFlag{ - Name: "nssfcfg", - Usage: "config file", + Name: "log, l", + Usage: "Output NF log to `FILE`", + }, + cli.StringFlag{ + Name: "log5gc, lc", + Usage: "Output free5gc log to `FILE`", }, -} - -var initLog *logrus.Entry - -func init() { - initLog = logger.InitLog } func (*NSSF) GetCliCmd() (flags []cli.Flag) { - return nssfCLi + return cliCmd } func (nssf *NSSF) Initialize(c *cli.Context) error { - config = Config{ - nssfcfg: c.String("nssfcfg"), + commands = Commands{ + config: c.String("config"), } - if config.nssfcfg != "" { - if err := factory.InitConfigFactory(config.nssfcfg); err != nil { + if commands.config != "" { + if err := factory.InitConfigFactory(commands.config); err != nil { return err } } else { - DefaultNssfConfigPath := path_util.Free5gcPath("free5gc/config/nssfcfg.yaml") - if err := factory.InitConfigFactory(DefaultNssfConfigPath); err != nil { + if err := factory.InitConfigFactory(util.NssfDefaultConfigPath); err != nil { return err } } - context.InitNssfContext() - nssf.setLogLevel() if err := factory.CheckConfigVersion(); err != nil { @@ -91,58 +86,26 @@ func (nssf *NSSF) Initialize(c *cli.Context) error { func (nssf *NSSF) setLogLevel() { if factory.NssfConfig.Logger == nil { - initLog.Warnln("NSSF config without log level setting!!!") + logger.InitLog.Warnln("NSSF config without log level setting!!!") return } if factory.NssfConfig.Logger.NSSF != nil { if factory.NssfConfig.Logger.NSSF.DebugLevel != "" { if level, err := logrus.ParseLevel(factory.NssfConfig.Logger.NSSF.DebugLevel); err != nil { - initLog.Warnf("NSSF Log level [%s] is invalid, set to [info] level", + logger.InitLog.Warnf("NSSF Log level [%s] is invalid, set to [info] level", factory.NssfConfig.Logger.NSSF.DebugLevel) logger.SetLogLevel(logrus.InfoLevel) } else { - initLog.Infof("NSSF Log level is set to [%s] level", level) + logger.InitLog.Infof("NSSF Log level is set to [%s] level", level) logger.SetLogLevel(level) } } else { - initLog.Infoln("NSSF Log level not set. Default set to [info] level") + logger.InitLog.Infoln("NSSF Log level not set. Default set to [info] level") logger.SetLogLevel(logrus.InfoLevel) } logger.SetReportCaller(factory.NssfConfig.Logger.NSSF.ReportCaller) } - - if factory.NssfConfig.Logger.PathUtil != nil { - if factory.NssfConfig.Logger.PathUtil.DebugLevel != "" { - if level, err := logrus.ParseLevel(factory.NssfConfig.Logger.PathUtil.DebugLevel); err != nil { - pathUtilLogger.PathLog.Warnf("PathUtil Log level [%s] is invalid, set to [info] level", - factory.NssfConfig.Logger.PathUtil.DebugLevel) - pathUtilLogger.SetLogLevel(logrus.InfoLevel) - } else { - pathUtilLogger.SetLogLevel(level) - } - } else { - pathUtilLogger.PathLog.Warnln("PathUtil Log level not set. Default set to [info] level") - pathUtilLogger.SetLogLevel(logrus.InfoLevel) - } - pathUtilLogger.SetReportCaller(factory.NssfConfig.Logger.PathUtil.ReportCaller) - } - - if factory.NssfConfig.Logger.OpenApi != nil { - if factory.NssfConfig.Logger.OpenApi.DebugLevel != "" { - if level, err := logrus.ParseLevel(factory.NssfConfig.Logger.OpenApi.DebugLevel); err != nil { - openApiLogger.OpenApiLog.Warnf("OpenAPI Log level [%s] is invalid, set to [info] level", - factory.NssfConfig.Logger.OpenApi.DebugLevel) - openApiLogger.SetLogLevel(logrus.InfoLevel) - } else { - openApiLogger.SetLogLevel(level) - } - } else { - openApiLogger.OpenApiLog.Warnln("OpenAPI Log level not set. Default set to [info] level") - openApiLogger.SetLogLevel(logrus.InfoLevel) - } - openApiLogger.SetReportCaller(factory.NssfConfig.Logger.OpenApi.ReportCaller) - } } func (nssf *NSSF) FilterCli(c *cli.Context) (args []string) { @@ -159,70 +122,93 @@ func (nssf *NSSF) FilterCli(c *cli.Context) (args []string) { } func (nssf *NSSF) Start() { - initLog.Infoln("Server started") + logger.InitLog.Infoln("Server started") router := logger_util.NewGinWithLogrus(logger.GinLog) nssaiavailability.AddService(router) nsselection.AddService(router) + pemPath := util.NssfDefaultPemPath + keyPath := util.NssfDefaultKeyPath + sbi := factory.NssfConfig.Configuration.Sbi + if sbi.Tls != nil { + pemPath = sbi.Tls.Pem + keyPath = sbi.Tls.Key + } + self := context.NSSF_Self() + context.InitNssfContext() addr := fmt.Sprintf("%s:%d", self.BindingIPv4, self.SBIPort) // Register to NRF profile, err := consumer.BuildNFProfile(self) if err != nil { - initLog.Error("Failed to build NSSF profile") + logger.InitLog.Error("Failed to build NSSF profile") } _, self.NfId, err = consumer.SendRegisterNFInstance(self.NrfUri, self.NfId, profile) if err != nil { - initLog.Errorf("Failed to register NSSF to NRF: %s", err.Error()) + logger.InitLog.Errorf("Failed to register NSSF to NRF: %s", err.Error()) } signalChannel := make(chan os.Signal, 1) signal.Notify(signalChannel, os.Interrupt, syscall.SIGTERM) go func() { + defer func() { + if p := recover(); p != nil { + // Print stack for panic to log. Fatalf() will let program exit. + logger.InitLog.Fatalf("panic: %v\n%s", p, string(debug.Stack())) + } + }() + <-signalChannel nssf.Terminate() os.Exit(0) }() - server, err := http2_util.NewServer(addr, util.NSSF_LOG_PATH, router) + server, err := httpwrapper.NewHttp2Server(addr, nssf.KeyLogPath, router) if server == nil { - initLog.Errorf("Initialize HTTP server failed: %+v", err) + logger.InitLog.Errorf("Initialize HTTP server failed: %+v", err) return } if err != nil { - initLog.Warnf("Initialize HTTP server: +%v", err) + logger.InitLog.Warnf("Initialize HTTP server: +%v", err) } serverScheme := factory.NssfConfig.Configuration.Sbi.Scheme if serverScheme == "http" { err = server.ListenAndServe() } else if serverScheme == "https" { - err = server.ListenAndServeTLS(util.NSSF_PEM_PATH, util.NSSF_KEY_PATH) + err = server.ListenAndServeTLS(pemPath, keyPath) } if err != nil { - initLog.Fatalf("HTTP server setup failed: %+v", err) + logger.InitLog.Fatalf("HTTP server setup failed: %+v", err) } } func (nssf *NSSF) Exec(c *cli.Context) error { - initLog.Traceln("args:", c.String("nssfcfg")) + logger.InitLog.Traceln("args:", c.String("nssfcfg")) args := nssf.FilterCli(c) - initLog.Traceln("filter: ", args) + logger.InitLog.Traceln("filter: ", args) command := exec.Command("./nssf", args...) stdout, err := command.StdoutPipe() if err != nil { - initLog.Fatalln(err) + logger.InitLog.Fatalln(err) } wg := sync.WaitGroup{} wg.Add(3) go func() { + defer func() { + if p := recover(); p != nil { + // Print stack for panic to log. Fatalf() will let program exit. + logger.InitLog.Fatalf("panic: %v\n%s", p, string(debug.Stack())) + } + }() + in := bufio.NewScanner(stdout) for in.Scan() { fmt.Println(in.Text()) @@ -232,9 +218,16 @@ func (nssf *NSSF) Exec(c *cli.Context) error { stderr, err := command.StderrPipe() if err != nil { - initLog.Fatalln(err) + logger.InitLog.Fatalln(err) } go func() { + defer func() { + if p := recover(); p != nil { + // Print stack for panic to log. Fatalf() will let program exit. + logger.InitLog.Fatalf("panic: %v\n%s", p, string(debug.Stack())) + } + }() + in := bufio.NewScanner(stderr) for in.Scan() { fmt.Println(in.Text()) @@ -243,6 +236,13 @@ func (nssf *NSSF) Exec(c *cli.Context) error { }() go func() { + defer func() { + if p := recover(); p != nil { + // Print stack for panic to log. Fatalf() will let program exit. + logger.InitLog.Fatalf("panic: %v\n%s", p, string(debug.Stack())) + } + }() + if err = command.Start(); err != nil { fmt.Printf("NSSF Start error: %v", err) } diff --git a/test/conf/test_nssf_config.yaml b/test/conf/test_nssf_config.yaml deleted file mode 100644 index 8aacbc5..0000000 --- a/test/conf/test_nssf_config.yaml +++ /dev/null @@ -1,353 +0,0 @@ -info: - version: 1.0.0 - description: NSSF initial local test configuration - -configuration: - nssfName: NSSF - sbi: - scheme: https - ipv4Addr: 127.0.0.1 - port: 29531 - serviceNameList: - - nnssf_nsselection - - nnssf_nssaiavailability - nrfUri: https://localhost:29510 - supportedPlmnList: - - mcc: 466 - mnc: 92 - supportedNssaiInPlmnList: - - plmnId: - mcc: 466 - mnc: 92 - supportedSnssaiList: - - sst: 1 - sd: 1 - - sst: 1 - sd: 2 - - sst: 1 - sd: 3 - - sst: 2 - sd: 1 - - sst: 2 - sd: 2 - nsiList: - - snssai: - sst: 1 - nsiInformationList: - - nrfId: http://free5gc-nrf-10.nctu.me:29510/nnrf-nfm/v1/nf-instances - nsiId: 10 - - snssai: - sst: 1 - sd: 1 - nsiInformationList: - - nrfId: http://free5gc-nrf-11.nctu.me:29510/nnrf-nfm/v1/nf-instances - nsiId: 11 - - snssai: - sst: 1 - sd: 2 - nsiInformationList: - - nrfId: http://free5gc-nrf-12-1.nctu.me:29510/nnrf-nfm/v1/nf-instances - nsiId: 12 - - nrfId: http://free5gc-nrf-12-2.nctu.me:29510/nnrf-nfm/v1/nf-instances - nsiId: 12 - - snssai: - sst: 1 - sd: 3 - nsiInformationList: - - nrfId: http://free5gc-nrf-13.nctu.me:29510/nnrf-nfm/v1/nf-instances - nsiId: 13 - - snssai: - sst: 2 - nsiInformationList: - - nrfId: http://free5gc-nrf-20.nctu.me:29510/nnrf-nfm/v1/nf-instances - nsiId: 20 - - snssai: - sst: 2 - sd: 1 - nsiInformationList: - - nrfId: http://free5gc-nrf-21.nctu.me:29510/nnrf-nfm/v1/nf-instances - nsiId: 21 - amfSetList: - - amfSetId: 1 - amfList: - - ffa2e8d7-3275-49c7-8631-6af1df1d9d26 - - 0e8831c3-6286-4689-ab27-1e2161e15cb1 - - a1fba9ba-2e39-4e22-9c74-f749da571d0d - nrfAmfSet: http://free5gc-nrf.nctu.me:8081/nnrf-nfm/v1/nf-instances - supportedNssaiAvailabilityData: - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33456 - supportedSnssaiList: - - sst: 1 - sd: 1 - - sst: 1 - sd: 2 - - sst: 2 - sd: 1 - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33457 - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 1 - - sst: 1 - sd: 2 - - amfSetId: 2 - nrfAmfSet: http://free5gc-nrf.nctu.me:8084/nnrf-nfm/v1/nf-instances - supportedNssaiAvailabilityData: - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33456 - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 1 - - sst: 1 - sd: 3 - - sst: 2 - sd: 1 - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33458 - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 1 - - sst: 2 - amfList: - - nfId: 469de254-2fe5-4ca0-8381-af3f500af77c - supportedNssaiAvailabilityData: - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33456 - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 2 - - sst: 2 - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33457 - supportedSnssaiList: - - sst: 1 - sd: 1 - - sst: 1 - sd: 2 - - nfId: fbe604a8-27b2-417e-bd7c-8a7be2691f8d - supportedNssaiAvailabilityData: - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33458 - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 1 - - sst: 1 - sd: 3 - - sst: 2 - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33459 - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 1 - - sst: 2 - - sst: 2 - sd: 1 - - nfId: b9e6e2cb-5ce8-4cb6-9173-a266dd9a2f0c - supportedNssaiAvailabilityData: - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33456 - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 1 - - sst: 1 - sd: 2 - - sst: 2 - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33458 - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 1 - - sst: 2 - - sst: 2 - sd: 1 - taList: - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33456 - accessType: 3GPP_ACCESS - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 1 - - sst: 1 - sd: 2 - - sst: 2 - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33457 - accessType: 3GPP_ACCESS - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 1 - - sst: 1 - sd: 2 - - sst: 2 - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33458 - accessType: 3GPP_ACCESS - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 1 - - sst: 1 - sd: 3 - - sst: 2 - restrictedSnssaiList: - - homePlmnId: - mcc: 310 - mnc: 560 - sNssaiList: - - sst: 1 - sd: 3 - - tai: - plmnId: - mcc: 466 - mnc: 92 - tac: 33459 - accessType: 3GPP_ACCESS - supportedSnssaiList: - - sst: 1 - - sst: 1 - sd: 1 - - sst: 2 - - sst: 2 - sd: 1 - restrictedSnssaiList: - - homePlmnId: - mcc: 310 - mnc: 560 - sNssaiList: - - sst: 2 - sd: 1 - mappingListFromPlmn: - - operatorName: NTT Docomo - homePlmnId: - mcc: 440 - mnc: 10 - mappingOfSnssai: - - servingSnssai: - sst: 1 - sd: 1 - homeSnssai: - sst: 1 - sd: 1 - - servingSnssai: - sst: 1 - sd: 2 - homeSnssai: - sst: 1 - sd: 3 - - servingSnssai: - sst: 1 - sd: 3 - homeSnssai: - sst: 1 - sd: 4 - - servingSnssai: - sst: 2 - sd: 1 - homeSnssai: - sst: 2 - sd: 2 - - operatorName: AT&T Mobility - homePlmnId: - mcc: 310 - mnc: 560 - mappingOfSnssai: - - servingSnssai: - sst: 1 - sd: 1 - homeSnssai: - sst: 1 - sd: 2 - - servingSnssai: - sst: 1 - sd: 2 - homeSnssai: - sst: 1 - sd: 3 -subscriptions: - - subscriptionId: "1" - subscriptionData: - nfNssaiAvailabilityUri: "http://free5gc-amf1.nctu.me:29518/namf-nssaiavailability/v1/nssai-availability/notify" - taiList: - - plmnId: - mcc: "466" - mnc: "92" - tac: "33456" - - plmnId: - mcc: "466" - mnc: "92" - tac: "33457" - event: "SNSSAI_STATUS_CHANGE_REPORT" - - subscriptionId: "3" - subscriptionData: - nfNssaiAvailabilityUri: "http://free5gc-amf3.nctu.me:29518/namf-nssaiavailability/v1/nssai-availability/notify" - taiList: - - plmnId: - mcc: "466" - mnc: "92" - tac: "33457" - - plmnId: - mcc: "466" - mnc: "92" - tac: "33458" - event: "SNSSAI_STATUS_CHANGE_REPORT" - expiry: "2020-06-24T16:35:31+08:00" - - subscriptionId: "4" - subscriptionData: - nfNssaiAvailabilityUri: "http://free5gc-amf4.nctu.me:29518/namf-nssaiavailability/v1/nssai-availability/notify" - taiList: - - plmnId: - mcc: "466" - mnc: "92" - tac: "33459" - event: "SNSSAI_STATUS_CHANGE_REPORT" - expiry: "2020-06-25T16:35:31+08:00" diff --git a/test/param.go b/test/param.go deleted file mode 100644 index c3c29fb..0000000 --- a/test/param.go +++ /dev/null @@ -1,44 +0,0 @@ -/* - * NSSF Testing Utility - */ - -package test - -import ( - "flag" - - . "github.com/free5gc/nssf/plugin" - "github.com/free5gc/path_util" -) - -var ( - ConfigFileFromArgs string - DefaultConfigFile string = path_util.Free5gcPath("github.com/free5gc/nssf/test/conf/test_nssf_config.yaml") -) - -type TestingUtil struct { - ConfigFile string -} - -type TestingNsselection struct { - ConfigFile string - - GenerateNonRoamingQueryParameter func() NsselectionQueryParameter - - GenerateRoamingQueryParameter func() NsselectionQueryParameter -} - -type TestingNssaiavailability struct { - ConfigFile string - - NfId string - - SubscriptionId string - - NfNssaiAvailabilityUri string -} - -func init() { - flag.StringVar(&ConfigFileFromArgs, "config-file", DefaultConfigFile, "Configuration file") - flag.Parse() -} diff --git a/test/util.go b/test/util.go deleted file mode 100644 index 860b69f..0000000 --- a/test/util.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * NSSF Testing Utility - */ - -package test - -import ( - "reflect" - - . "github.com/free5gc/openapi/models" -) - -func CheckAuthorizedNetworkSliceInfo(target AuthorizedNetworkSliceInfo, expectList []AuthorizedNetworkSliceInfo) bool { - for _, expectElement := range expectList { - if reflect.DeepEqual(target, expectElement) { - return true - } - } - return false -}