service

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package service is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
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

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUserService) FindByID

func (m *MockUserService) FindByID(ctx context.Context, id string) (*model.User, error)

FindByID mocks base method.

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 UserCreatedEvent struct {
	ID  string `json:"id"`
	Pwd string `json:"pwd"`
}

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 (*ValidationErrors) Error

func (errors *ValidationErrors) Error() string

Error satisfies error interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL