Skip to content

Instantly share code, notes, and snippets.

View mehmetcemyucel's full-sized avatar

Mehmet Cem Yücel mehmetcemyucel

View GitHub Profile
package config
import (
"github.com/spf13/viper"
"testing"
)
func TestReadConfig_whenEnvEmpty_thenReadLocalFile(t *testing.T) {
expectedValue := ":8080"
readFromLocalAppYml = func(v *viper.Viper) *viper.Viper {
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)
package repository
import (
"gorm.io/gorm"
"helloWorld/pkg/model/example/entity"
)
type IExampleRepository interface {
ActiveExamples(name string) ([]entity.Example, error)
}
package service
import (
"helloWorld/pkg/model/example/dto/request"
"helloWorld/pkg/model/example/entity"
"helloWorld/pkg/repository"
"testing"
)
var service IExampleService
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"
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"
package service
import (
"fmt"
"github.com/go-kit/kit/metrics"
"helloWorld/pkg/model/example/dto/request"
"helloWorld/pkg/model/example/entity"
"time"
)
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"
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"
package repository
import (
"gorm.io/gorm"
"helloWorld/pkg/model/example/entity"
)
type IExampleRepository interface {
ActiveExamples(name string) ([]entity.Example, error)
}