application

package
v0.0.0-...-76fafce Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	RegisterCustomer(ctx context.Context, register RegisterCustomer) error
	AuthorizeCustomer(ctx context.Context, authorize AuthorizeCustomer) error
	GetCustomer(ctx context.Context, get GetCustomer) (*domain.Customer, error)
	EnableCustomer(ctx context.Context, enable EnableCustomer) error
	DisableCustomer(ctx context.Context, disable DisableCustomer) error
}

func NewInstrumentedApp

func NewInstrumentedApp(app App, customersRegistered prometheus.Counter) App

type Application

type Application struct {
	// contains filtered or unexported fields
}

func New

func New(customers domain.CustomerRepository, domainPublisher ddd.EventPublisher[ddd.AggregateEvent]) *Application

func (Application) AuthorizeCustomer

func (a Application) AuthorizeCustomer(ctx context.Context, authorize AuthorizeCustomer) error

func (Application) DisableCustomer

func (a Application) DisableCustomer(ctx context.Context, disable DisableCustomer) error

func (Application) EnableCustomer

func (a Application) EnableCustomer(ctx context.Context, enable EnableCustomer) error

func (Application) GetCustomer

func (a Application) GetCustomer(ctx context.Context, get GetCustomer) (*domain.Customer, error)

func (Application) RegisterCustomer

func (a Application) RegisterCustomer(ctx context.Context, register RegisterCustomer) error

type AuthorizeCustomer

type AuthorizeCustomer struct {
	ID string
}

type DisableCustomer

type DisableCustomer struct {
	ID string
}

type EnableCustomer

type EnableCustomer struct {
	ID string
}

type GetCustomer

type GetCustomer struct {
	ID string
}

type MockApp

type MockApp struct {
	mock.Mock
}

MockApp is an autogenerated mock type for the App type

func NewMockApp

func NewMockApp(t mockConstructorTestingTNewMockApp) *MockApp

NewMockApp creates a new instance of MockApp. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockApp) AuthorizeCustomer

func (_m *MockApp) AuthorizeCustomer(ctx context.Context, authorize AuthorizeCustomer) error

AuthorizeCustomer provides a mock function with given fields: ctx, authorize

func (*MockApp) DisableCustomer

func (_m *MockApp) DisableCustomer(ctx context.Context, disable DisableCustomer) error

DisableCustomer provides a mock function with given fields: ctx, disable

func (*MockApp) EnableCustomer

func (_m *MockApp) EnableCustomer(ctx context.Context, enable EnableCustomer) error

EnableCustomer provides a mock function with given fields: ctx, enable

func (*MockApp) GetCustomer

func (_m *MockApp) GetCustomer(ctx context.Context, get GetCustomer) (*domain.Customer, error)

GetCustomer provides a mock function with given fields: ctx, get

func (*MockApp) RegisterCustomer

func (_m *MockApp) RegisterCustomer(ctx context.Context, register RegisterCustomer) error

RegisterCustomer provides a mock function with given fields: ctx, register

type RegisterCustomer

type RegisterCustomer struct {
	ID        string
	Name      string
	SmsNumber string
}

Jump to

Keyboard shortcuts

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