Skip to content

Commit

Permalink
init.
Browse files Browse the repository at this point in the history
  • Loading branch information
kehiy committed Jan 4, 2025
1 parent 5c0c02b commit 6f39d4f
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 40 deletions.
6 changes: 3 additions & 3 deletions cmd/commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"os/signal"
"syscall"

"github.com/dezh-tech/go-gin-boilerplate/cmd/daemon"
"github.com/dezh-tech/go-gin-boilerplate/config"
"github.com/dezh-tech/go-gin-boilerplate/pkg/logger"
"github.com/dezh-tech/go-echo-boilerplate/cmd/daemon"
"github.com/dezh-tech/go-echo-boilerplate/config"
"github.com/dezh-tech/go-echo-boilerplate/pkg/logger"
)

func HandleRun(args []string) {
Expand Down
18 changes: 9 additions & 9 deletions cmd/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package daemon
import (
"time"

"github.com/dezh-tech/go-gin-boilerplate/config"
"github.com/dezh-tech/go-gin-boilerplate/delivery/grpc"
"github.com/dezh-tech/go-gin-boilerplate/delivery/http"
"github.com/dezh-tech/go-gin-boilerplate/infrastructure/database"
grpcclient "github.com/dezh-tech/go-gin-boilerplate/infrastructure/grpc_client"
"github.com/dezh-tech/go-gin-boilerplate/infrastructure/redis"
"github.com/dezh-tech/go-gin-boilerplate/pkg/logger"
userrepo "github.com/dezh-tech/go-gin-boilerplate/repository/user"
usersrv "github.com/dezh-tech/go-gin-boilerplate/service/user"
"github.com/dezh-tech/go-echo-boilerplate/config"
"github.com/dezh-tech/go-echo-boilerplate/delivery/grpc"
"github.com/dezh-tech/go-echo-boilerplate/delivery/http"
"github.com/dezh-tech/go-echo-boilerplate/infrastructure/database"
grpcclient "github.com/dezh-tech/go-echo-boilerplate/infrastructure/grpc_client"
"github.com/dezh-tech/go-echo-boilerplate/infrastructure/redis"
"github.com/dezh-tech/go-echo-boilerplate/pkg/logger"
userrepo "github.com/dezh-tech/go-echo-boilerplate/repository/user"
usersrv "github.com/dezh-tech/go-echo-boilerplate/service/user"
)

type Daemon struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"os"

"github.com/dezh-tech/go-gin-boilerplate"
"github.com/dezh-tech/go-gin-boilerplate/cmd/commands"
"github.com/dezh-tech/go-echo-boilerplate"
"github.com/dezh-tech/go-echo-boilerplate/cmd/commands"
)

func main() {
Expand Down
12 changes: 6 additions & 6 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package config
import (
"os"

"github.com/dezh-tech/go-gin-boilerplate/delivery/grpc"
"github.com/dezh-tech/go-gin-boilerplate/delivery/http"
"github.com/dezh-tech/go-gin-boilerplate/infrastructure/database"
grpcclient "github.com/dezh-tech/go-gin-boilerplate/infrastructure/grpc_client"
"github.com/dezh-tech/go-gin-boilerplate/infrastructure/redis"
"github.com/dezh-tech/go-gin-boilerplate/pkg/logger"
"github.com/dezh-tech/go-echo-boilerplate/delivery/grpc"
"github.com/dezh-tech/go-echo-boilerplate/delivery/http"
"github.com/dezh-tech/go-echo-boilerplate/infrastructure/database"
grpcclient "github.com/dezh-tech/go-echo-boilerplate/infrastructure/grpc_client"
"github.com/dezh-tech/go-echo-boilerplate/infrastructure/redis"
"github.com/dezh-tech/go-echo-boilerplate/pkg/logger"
"github.com/joho/godotenv"
"gopkg.in/yaml.v3"
)
Expand Down
4 changes: 2 additions & 2 deletions delivery/grpc/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"time"

"github.com/dezh-tech/go-gin-boilerplate"
pb "github.com/dezh-tech/go-gin-boilerplate/delivery/grpc/gen"
"github.com/dezh-tech/go-echo-boilerplate"
pb "github.com/dezh-tech/go-echo-boilerplate/delivery/grpc/gen"
)

type healthServer struct {
Expand Down
6 changes: 3 additions & 3 deletions delivery/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strconv"
"time"

pb "github.com/dezh-tech/go-gin-boilerplate/delivery/grpc/gen"
"github.com/dezh-tech/go-gin-boilerplate/infrastructure/database"
"github.com/dezh-tech/go-gin-boilerplate/infrastructure/redis"
pb "github.com/dezh-tech/go-echo-boilerplate/delivery/grpc/gen"
"github.com/dezh-tech/go-echo-boilerplate/infrastructure/database"
"github.com/dezh-tech/go-echo-boilerplate/infrastructure/redis"
"google.golang.org/grpc"
)

Expand Down
4 changes: 2 additions & 2 deletions delivery/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package http
import (
"fmt"

userh "github.com/dezh-tech/go-gin-boilerplate/delivery/http/user_handler"
users "github.com/dezh-tech/go-gin-boilerplate/service/user"
userh "github.com/dezh-tech/go-echo-boilerplate/delivery/http/user_handler"
users "github.com/dezh-tech/go-echo-boilerplate/service/user"
"github.com/labstack/echo/v4"
)

Expand Down
2 changes: 1 addition & 1 deletion delivery/http/user_handler/handler.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package userhandler

import "github.com/dezh-tech/go-gin-boilerplate/service/user"
import "github.com/dezh-tech/go-echo-boilerplate/service/user"

type Handler struct {
userSvc user.Service
Expand Down
2 changes: 1 addition & 1 deletion delivery/http/user_handler/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package userhandler
import (
"net/http"

"github.com/dezh-tech/go-gin-boilerplate/service/user"
"github.com/dezh-tech/go-echo-boilerplate/service/user"
"github.com/labstack/echo/v4"
)

Expand Down
2 changes: 1 addition & 1 deletion delivery/http/user_handler/router.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package userhandler

import (
"github.com/dezh-tech/go-gin-boilerplate/delivery/http/middleware"
"github.com/dezh-tech/go-echo-boilerplate/delivery/http/middleware"
"github.com/labstack/echo/v4"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/dezh-tech/go-gin-boilerplate
module github.com/dezh-tech/go-echo-boilerplate

go 1.23.3

Expand Down
2 changes: 1 addition & 1 deletion infrastructure/grpc_client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package grpcclient
import (
"context"

pb "github.com/dezh-tech/go-gin-boilerplate/infrastructure/grpc_client/gen"
pb "github.com/dezh-tech/go-echo-boilerplate/infrastructure/grpc_client/gen"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/logger/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ type Config struct {
MaxSize int `yaml:"max_size"`
MaxBackups int `yaml:"max_backups"`
Compress bool `yaml:"compress"`
}
}
5 changes: 1 addition & 4 deletions pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import (
"gopkg.in/natefinch/lumberjack.v2"
)

var (
globalInst *logger
)
var globalInst *logger

type logger struct {
writer io.Writer
Expand Down Expand Up @@ -50,7 +48,6 @@ func InitGlobalLogger(cfg *Config) {
zerolog.SetGlobalLevel(level)

log.Logger = zerolog.New(globalInst.writer).With().Timestamp().Logger()

}

func addFields(event *zerolog.Event, keyvals ...any) *zerolog.Event {
Expand Down
4 changes: 2 additions & 2 deletions repository/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package user
import (
"context"

"github.com/dezh-tech/go-gin-boilerplate/entity"
"github.com/dezh-tech/go-gin-boilerplate/infrastructure/database"
"github.com/dezh-tech/go-echo-boilerplate/entity"
"github.com/dezh-tech/go-echo-boilerplate/infrastructure/database"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
)
Expand Down
2 changes: 1 addition & 1 deletion service/user/service.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package user

import (
"github.com/dezh-tech/go-gin-boilerplate/entity"
"github.com/dezh-tech/go-echo-boilerplate/entity"
)

type Repository interface {
Expand Down

0 comments on commit 6f39d4f

Please sign in to comment.