Skip to content

Commit

Permalink
chore(structure): done project structure refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
breadrock1 committed May 30, 2024
1 parent df04b05 commit 03b643d
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion cmd/resizer/resizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"image-resize-service/cmd"
"image-resize-service/internal/pkg/app"
"image-resize-service/internal/app"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/spf13/cobra"
"image-resize-service/internal/pkg/config"
"image-resize-service/internal/config"
)

var rootCmd = &cobra.Command{
Expand Down
10 changes: 5 additions & 5 deletions internal/pkg/app/app.go → internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"os/signal"
"syscall"

"image-resize-service/internal/app/cache"
"image-resize-service/internal/app/resizer"
"image-resize-service/internal/app/server"
"image-resize-service/internal/app/storage"
"image-resize-service/internal/pkg/config"
"image-resize-service/internal/cache"
"image-resize-service/internal/config"
"image-resize-service/internal/resizer"
"image-resize-service/internal/server"
"image-resize-service/internal/storage"
)

type App struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/cache/cache.go → internal/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"

"github.com/hashicorp/golang-lru/v2/expirable"
"image-resize-service/internal/pkg/config"
"image-resize-service/internal/config"
)

type Memcache struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/cache/public.go → internal/cache/public.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cache

import (
"image-resize-service/internal/pkg/config"
"image-resize-service/internal/config"
)

type Cache interface {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package resizer

import "image-resize-service/internal/pkg/config"
import (
"image-resize-service/internal/config"
)

type Resizer interface {
ResizeService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"image"

"github.com/disintegration/imaging"
"image-resize-service/internal/pkg/config"
"image-resize-service/internal/config"
)

type Service struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions internal/app/server/server.go → internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (

"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"image-resize-service/internal/app/cache"
"image-resize-service/internal/app/resizer"
"image-resize-service/internal/app/storage"
"image-resize-service/internal/pkg/config"
"image-resize-service/internal/cache"
"image-resize-service/internal/config"
"image-resize-service/internal/resizer"
"image-resize-service/internal/storage"
)

// @title Swagger Example API
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package storage
import (
"net/http"

"image-resize-service/internal/pkg/config"
"image-resize-service/internal/config"
)

type Storage interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/google/uuid"
"image-resize-service/internal/pkg/config"
"image-resize-service/internal/config"
)

type Service struct {
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"time"

"github.com/stretchr/testify/require"
"image-resize-service/internal/app/cache"
"image-resize-service/internal/app/resizer"
"image-resize-service/internal/app/server"
"image-resize-service/internal/app/storage"
"image-resize-service/internal/pkg/config"
"image-resize-service/internal/cache"
"image-resize-service/internal/config"
"image-resize-service/internal/resizer"
"image-resize-service/internal/server"
"image-resize-service/internal/storage"
"image-resize-service/tests/integration/service"
)

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/cacher/cacher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"time"

"github.com/magiconair/properties/assert"
"image-resize-service/internal/app/cache"
"image-resize-service/internal/pkg/config"
"image-resize-service/internal/cache"
"image-resize-service/internal/config"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/resizer/resizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"image-resize-service/internal/app/resizer"
"image-resize-service/internal/pkg/config"
"image-resize-service/internal/config"
"image-resize-service/internal/resizer"
)

func TestResizer(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/storage/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"image-resize-service/internal/app/storage"
"image-resize-service/internal/pkg/config"
"image-resize-service/internal/config"
"image-resize-service/internal/storage"
)

const (
Expand Down

0 comments on commit 03b643d

Please sign in to comment.