chore: rename package name

This commit is contained in:
2024-12-09 12:27:50 +01:00
parent e4c994405a
commit 9162ec03c1
27 changed files with 30 additions and 29 deletions

View File

@@ -21,7 +21,7 @@ import (
"fmt" "fmt"
"os" "os"
pkg "github.com/jkaninda/goma-gateway/internal" "github.com/jkaninda/goma-gateway/internal"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@@ -34,7 +34,7 @@ var CheckConfigCmd = &cobra.Command{
fmt.Println("no config file specified") fmt.Println("no config file specified")
os.Exit(1) os.Exit(1)
} }
err := pkg.CheckConfig(configFile) err := internal.CheckConfig(configFile)
if err != nil { if err != nil {
fmt.Printf(" Error checking config file: %s\n", err) fmt.Printf(" Error checking config file: %s\n", err)
os.Exit(1) os.Exit(1)

View File

@@ -17,9 +17,9 @@ limitations under the License.
*/ */
import ( import (
"fmt" "fmt"
"github.com/jkaninda/goma-gateway/internal"
"os" "os"
pkg "github.com/jkaninda/goma-gateway/internal"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@@ -41,7 +41,7 @@ var InitConfigCmd = &cobra.Command{
os.Exit(1) os.Exit(1)
} }
} }
err := pkg.InitConfig(configFile) err := internal.InitConfig(configFile)
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
os.Exit(1) os.Exit(1)

View File

@@ -33,10 +33,10 @@ var ServerCmd = &cobra.Command{
intro() intro()
configFile, _ := cmd.Flags().GetString("config") configFile, _ := cmd.Flags().GetString("config")
if configFile == "" { if configFile == "" {
configFile = pkg.GetConfigPaths() configFile = internal.GetConfigPaths()
} }
ctx := context.Background() ctx := context.Background()
g := pkg.GatewayServer{} g := internal.GatewayServer{}
gs, err := g.Config(configFile, ctx) gs, err := g.Config(configFile, ctx)
if err != nil { if err != nil {
fmt.Printf("Could not load configuration: %v\n", err) fmt.Printf("Could not load configuration: %v\n", err)

1
go.sum
View File

@@ -28,6 +28,7 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jedib0t/go-pretty/v6 v6.6.3 h1:nGqgS0tgIO1Hto47HSaaK4ac/I/Bu7usmdD3qvs0WvM= github.com/jedib0t/go-pretty/v6 v6.6.3 h1:nGqgS0tgIO1Hto47HSaaK4ac/I/Bu7usmdD3qvs0WvM=
github.com/jedib0t/go-pretty/v6 v6.6.3/go.mod h1:zbn98qrYlh95FIhwwsbIip0LYpwSG8SUOScs+v9/t0E= github.com/jedib0t/go-pretty/v6 v6.6.3/go.mod h1:zbn98qrYlh95FIhwwsbIip0LYpwSG8SUOScs+v9/t0E=
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
import ( import (
"fmt" "fmt"

View File

@@ -1,4 +1,4 @@
package pkg package internal
/* /*
Copyright 2024 Jonas Kaninda Copyright 2024 Jonas Kaninda

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
type Cors struct { type Cors struct {
// Cors Allowed origins, // Cors Allowed origins,

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
import ( import (
"fmt" "fmt"

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
// Gateway contains Goma Proxy Gateway's configs // Gateway contains Goma Proxy Gateway's configs
type Gateway struct { type Gateway struct {

View File

@@ -1,4 +1,4 @@
package pkg package internal
/* /*
Copyright 2024 Jonas Kaninda Copyright 2024 Jonas Kaninda

View File

@@ -1,4 +1,4 @@
package pkg package internal
/* /*
Copyright 2024 Jonas Kaninda Copyright 2024 Jonas Kaninda

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
import ( import (
"context" "context"

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
import ( import (
"github.com/golang-jwt/jwt" "github.com/golang-jwt/jwt"

View File

@@ -1,4 +1,4 @@
package pkg package internal
import ( import (
"errors" "errors"

View File

@@ -1,4 +1,4 @@
package pkg package internal
/* /*
Copyright 2024 Jonas Kaninda Copyright 2024 Jonas Kaninda

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
// Middleware defined the route middlewares // Middleware defined the route middlewares
type Middleware struct { type Middleware struct {

View File

@@ -1,4 +1,4 @@
package pkg package internal
/* /*
Copyright 2024 Jonas Kaninda Copyright 2024 Jonas Kaninda

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
import ( import (
"github.com/jkaninda/goma-gateway/internal/middlewares" "github.com/jkaninda/goma-gateway/internal/middlewares"

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
import ( import (
"fmt" "fmt"

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
// Route defines gateway route // Route defines gateway route
type Route struct { type Route struct {

View File

@@ -1,4 +1,4 @@
package pkg package internal
/* /*
Copyright 2024 Jonas Kaninda Copyright 2024 Jonas Kaninda

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
import ( import (
"fmt" "fmt"

View File

@@ -1,4 +1,4 @@
package pkg package internal
/* /*
Copyright 2024 Jonas Kaninda Copyright 2024 Jonas Kaninda

View File

@@ -1,4 +1,4 @@
package pkg package internal
import ( import (
"context" "context"

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
import ( import (
"crypto/tls" "crypto/tls"

View File

@@ -15,7 +15,7 @@
* *
*/ */
package pkg package internal
import ( import (
"context" "context"

View File

@@ -1,4 +1,4 @@
package pkg package internal
const ConfigDir = "/etc/goma/" // Default configuration file const ConfigDir = "/etc/goma/" // Default configuration file
const ExtraDir = ConfigDir + "extra" const ExtraDir = ConfigDir + "extra"