restructured api to api/http, api/grpc, pkg http

This commit is contained in:
JayKaku
2024-02-24 23:44:12 +05:30
parent dc830d02a6
commit c305843105
37 changed files with 37 additions and 37 deletions
+4 -4
View File
@@ -13,8 +13,8 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"github.com/stefanprodan/podinfo/pkg/api"
"github.com/stefanprodan/podinfo/pkg/grpc"
"github.com/stefanprodan/podinfo/pkg/api/grpc"
"github.com/stefanprodan/podinfo/pkg/api/http"
"github.com/stefanprodan/podinfo/pkg/signals"
"github.com/stefanprodan/podinfo/pkg/version"
go_grpc "google.golang.org/grpc"
@@ -142,7 +142,7 @@ func main() {
}
// load HTTP server config
var srvCfg api.Config
var srvCfg http.Config
if err := viper.Unmarshal(&srvCfg); err != nil {
logger.Panic("config unmarshal failed", zap.Error(err))
}
@@ -155,7 +155,7 @@ func main() {
)
// start HTTP server
srv, _ := api.NewServer(&srvCfg, logger)
srv, _ := http.NewServer(&srvCfg, logger)
httpServer, httpsServer, healthy, ready := srv.ListenAndServe()
// graceful shutdown
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"fmt"
@@ -1,4 +1,4 @@
package api
package http
import (
"math/rand"
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
@@ -1,4 +1,4 @@
package api
package http
import "net/http"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"math/rand"
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"bytes"
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
@@ -1,4 +1,4 @@
package api
package http
import (
"fmt"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"bytes"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"html/template"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
@@ -1,4 +1,4 @@
package api
package http
import (
"bufio"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"time"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
+2 -2
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"context"
@@ -14,7 +14,7 @@ import (
"github.com/gomodule/redigo/redis"
"github.com/gorilla/mux"
"github.com/prometheus/client_golang/prometheus/promhttp"
_ "github.com/stefanprodan/podinfo/pkg/api/docs"
_ "github.com/stefanprodan/podinfo/pkg/api/http/docs"
"github.com/stefanprodan/podinfo/pkg/fscache"
httpSwagger "github.com/swaggo/http-swagger"
"github.com/swaggo/swag"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"crypto/sha1"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"fmt"
@@ -1,4 +1,4 @@
package api
package http
import (
"encoding/json"
+1 -1
View File
@@ -1,4 +1,4 @@
package api
package http
import (
"context"
@@ -1,4 +1,4 @@
package api
package http
import (
"net/http"
@@ -1,4 +1,4 @@
package api
package http
import (
"fmt"