Documentation ¶
Overview ¶
Package service is a generated GoMock package.
Index ¶
- Variables
- type Middleware
- type MockUserService
- func (m *MockUserService) Create(ctx context.Context, user *model.RequestedUser) (string, error)
- func (m *MockUserService) Delete(ctx context.Context, id string) error
- func (m *MockUserService) EXPECT() *MockUserServiceMockRecorder
- func (m *MockUserService) FindByID(ctx context.Context, id string) (*model.User, error)
- type MockUserServiceMockRecorder
- type UserCreatedEvent
- type UserDeletedEvent
- type UserService
- type ValidationError
- type ValidationErrors
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmailInUse = errors.New("user with requested email address already exists") ErrUserNotFound = errors.New("user not found") )
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware func(UserService) UserService
Middleware describes a service middleware
func EventingMiddleware ¶
func EventingMiddleware(js nats.JetStream) Middleware
func InstrumentingMiddleware ¶
func InstrumentingMiddleware() Middleware
func LoggingMiddleware ¶
func LoggingMiddleware(logger zerolog.Logger) Middleware
LoggingMiddleware takes a logger as dependency and returns a service middleware
type MockUserService ¶
type MockUserService struct {
// contains filtered or unexported fields
}
MockUserService is a mock of UserService interface.
func NewMockUserService ¶
func NewMockUserService(ctrl *gomock.Controller) *MockUserService
NewMockUserService creates a new mock instance.
func (*MockUserService) Create ¶
func (m *MockUserService) Create(ctx context.Context, user *model.RequestedUser) (string, error)
Create mocks base method.
func (*MockUserService) Delete ¶
func (m *MockUserService) Delete(ctx context.Context, id string) error
Delete mocks base method.
func (*MockUserService) EXPECT ¶
func (m *MockUserService) EXPECT() *MockUserServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockUserServiceMockRecorder ¶
type MockUserServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockUserServiceMockRecorder is the mock recorder for MockUserService.
func (*MockUserServiceMockRecorder) Create ¶
func (mr *MockUserServiceMockRecorder) Create(ctx, user interface{}) *gomock.Call
Create indicates an expected call of Create.
func (*MockUserServiceMockRecorder) Delete ¶
func (mr *MockUserServiceMockRecorder) Delete(ctx, id interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockUserServiceMockRecorder) FindByID ¶
func (mr *MockUserServiceMockRecorder) FindByID(ctx, id interface{}) *gomock.Call
FindByID indicates an expected call of FindByID.
type UserCreatedEvent ¶
type UserDeletedEvent ¶
type UserDeletedEvent struct {
ID string `json:"id"`
}
type UserService ¶
type UserService interface { Create(ctx context.Context, user *model.RequestedUser) (string, error) Delete(ctx context.Context, id string) error FindByID(ctx context.Context, id string) (*model.User, error) }
func NewService ¶
func NewService( store store.UserStore, logger zerolog.Logger, js nats.JetStream, ) UserService
type ValidationError ¶
type ValidationError struct {
Name, Reason string
}
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error satisfies error interface
type ValidationErrors ¶
type ValidationErrors struct {
Errors []ValidationError
}
func (*ValidationErrors) Append ¶
func (errors *ValidationErrors) Append(e ValidationError) ValidationErrors
func (*ValidationErrors) Error ¶
func (errors *ValidationErrors) Error() string
Error satisfies error interface