Skip to content

Commit

Permalink
go generateに対応させた
Browse files Browse the repository at this point in the history
  • Loading branch information
eiei114 committed Oct 24, 2023
1 parent ed93fcd commit 7409497
Show file tree
Hide file tree
Showing 8 changed files with 450 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/application/middleware/auth_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package middleware

import "github.com/uptrace/bunrouter"

//go:generate mockgen -source=auth_interface.go -destination=../../mocks/auth_mocks.go -package=mocks
type MiddlewareInterface interface {
AuthenticateMiddleware() func(bunrouter.HandlerFunc) bunrouter.HandlerFunc
CorsMiddleware() func(bunrouter.HandlerFunc) bunrouter.HandlerFunc
Expand Down
1 change: 1 addition & 0 deletions app/application/service/user_service_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"example.com/domain"
)

//go:generate mockgen -source=user_service_interface.go -destination=../../mocks/user_service_mock.go -package=mocks
type UserServiceInterface interface {
Add(ctx context.Context, name string) (string, error)
UpdateUser(ctx context.Context, user domain.User) error
Expand Down
1 change: 1 addition & 0 deletions app/domain/repository/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"example.com/domain"
)

//go:generate mockgen -source=user.go -destination=../../mocks/user_mock.go -package=mocks
type UserRepository interface {
AddUser(ctx context.Context, id, authToken, name string) error
UpdateUser(ctx context.Context, user domain.User) error
Expand Down
1 change: 1 addition & 0 deletions app/interface/handler/handler_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package _interface

import "github.com/uptrace/bunrouter"

//go:generate mockgen -source=handler_interface.go -destination=../../mocks/handler_mock.go -package=mocks
type UserHandlerInterface interface {
UserCreateHandle() bunrouter.HandlerFunc
UserGetHandle() bunrouter.HandlerFunc
Expand Down
81 changes: 81 additions & 0 deletions app/mocks/auth_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

109 changes: 109 additions & 0 deletions app/mocks/handler_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

127 changes: 127 additions & 0 deletions app/mocks/user_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7409497

Please sign in to comment.