Skip to content

Instantly share code, notes, and snippets.

View mehmetcemyucel's full-sized avatar

Mehmet Cem Yücel mehmetcemyucel

View GitHub Profile
package entity
import "gorm.io/gorm"
type Example struct {
gorm.Model
Name string
}
package postgre
import (
"fmt"
"go.uber.org/zap"
"gorm.io/driver/postgres"
"gorm.io/gorm"
"gorm.io/gorm/schema"
"helloWorld/pkg/config/config"
)
package migrate
import (
"github.com/golang-migrate/migrate/v4"
_ "github.com/golang-migrate/migrate/v4/database/postgres"
_ "github.com/golang-migrate/migrate/v4/source/file"
"go.uber.org/zap"
"helloWorld/pkg/config/config"
)
version: '3.2'
networks:
kafka-cluster:
driver: bridge
services:
postgres:
image: postgres:12-alpine
environment:
package logging
import (
"bytes"
"github.com/Shopify/sarama"
"go.uber.org/zap"
"log"
"net/url"
"strconv"
"strings"
version: '3.2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
volumes:
- type: bind
source: ../config/elasticsearch.yml
target: /usr/share/elasticsearch/config/elasticsearch.yml
read_only: true
- type: volume
package logging
import (
"fmt"
"go.uber.org/zap"
"helloWorld/pkg/config/config"
"net/url"
"os"
)
package config
import (
"fmt"
"github.com/spf13/viper"
"helloWorld/pkg/util"
)
const (
defaultConfigPath = "config"
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 config
import (
"bytes"
"encoding/base64"
"fmt"
"github.com/spf13/viper"
"github.com/valyala/fasthttp"
"os"
)