This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package config | |
| import ( | |
| "github.com/spf13/viper" | |
| "testing" | |
| ) | |
| func TestReadConfig_whenEnvEmpty_thenReadLocalFile(t *testing.T) { | |
| expectedValue := ":8080" | |
| readFromLocalAppYml = func(v *viper.Viper) *viper.Viper { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package config | |
| import ( | |
| "fmt" | |
| "github.com/spf13/viper" | |
| ) | |
| var readFromLocalAppYml = func(v *viper.Viper) *viper.Viper { | |
| fmt.Println("Reading application yml configuration") | |
| v.SetConfigName(defaultConfigFileName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package repository | |
| import ( | |
| "gorm.io/gorm" | |
| "helloWorld/pkg/model/example/entity" | |
| ) | |
| type IExampleRepository interface { | |
| ActiveExamples(name string) ([]entity.Example, error) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package service | |
| import ( | |
| "helloWorld/pkg/model/example/dto/request" | |
| "helloWorld/pkg/model/example/entity" | |
| "helloWorld/pkg/repository" | |
| "testing" | |
| ) | |
| var service IExampleService |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package router | |
| import ( | |
| "context" | |
| "github.com/labstack/echo/v4" | |
| "github.com/labstack/echo/v4/middleware" | |
| _ "github.com/labstack/gommon/log" | |
| "github.com/prometheus/client_golang/prometheus/promhttp" | |
| echoSwagger "github.com/swaggo/echo-swagger" | |
| "github.com/valyala/fasthttp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package api | |
| import ( | |
| xconv "github.com/howcrazy/xconv" | |
| "github.com/labstack/echo/v4" | |
| "github.com/valyala/fasthttp" | |
| "go.uber.org/zap" | |
| "helloWorld/pkg/model/example/dto/request" | |
| "helloWorld/pkg/model/example/dto/response" | |
| "helloWorld/pkg/model/example/entity" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package service | |
| import ( | |
| "fmt" | |
| "github.com/go-kit/kit/metrics" | |
| "helloWorld/pkg/model/example/dto/request" | |
| "helloWorld/pkg/model/example/entity" | |
| "time" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package service | |
| import ( | |
| "github.com/go-kit/kit/log" | |
| kitprometheus "github.com/go-kit/kit/metrics/prometheus" | |
| stdprometheus "github.com/prometheus/client_golang/prometheus" | |
| "go.uber.org/zap" | |
| "helloWorld/pkg/model/example/dto/request" | |
| "helloWorld/pkg/model/example/entity" | |
| "helloWorld/pkg/repository" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package router | |
| import ( | |
| "context" | |
| "github.com/labstack/echo/v4" | |
| "github.com/labstack/echo/v4/middleware" | |
| _ "github.com/labstack/gommon/log" | |
| "github.com/prometheus/client_golang/prometheus/promhttp" | |
| echoSwagger "github.com/swaggo/echo-swagger" | |
| "github.com/valyala/fasthttp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package repository | |
| import ( | |
| "gorm.io/gorm" | |
| "helloWorld/pkg/model/example/entity" | |
| ) | |
| type IExampleRepository interface { | |
| ActiveExamples(name string) ([]entity.Example, error) | |
| } |