Documentation ¶
Overview ¶
Package adminservice holds the business logic and data structures associated with the admin domain.
Index ¶
- type AtomicOperation
- type AtomicRepository
- type Config
- type Interface
- type MockAtomicOperation
- type MockAtomicRepository
- type MockInterface
- func (_m *MockInterface) GetAdmin(ctx context.Context, u *ent.Admin) error
- func (_m *MockInterface) ModifyProfile(ctx context.Context, u *ent.Admin) error
- func (_m *MockInterface) Signin(ctx context.Context, u *ent.Admin) error
- func (_m *MockInterface) Signup(ctx context.Context, u *ent.Admin) error
- type MockRepository
- func (_m *MockRepository) CreateAdmin(ctx context.Context, u *ent.Admin) error
- func (_m *MockRepository) FindAdminByID(ctx context.Context, uid uuid.UUID) (*ent.Admin, error)
- func (_m *MockRepository) FindAdminByLogin(ctx context.Context, login string) (*ent.Admin, error)
- func (_m *MockRepository) UpdateAdmin(ctx context.Context, u *ent.Admin) error
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicOperation ¶
type AtomicOperation func(context.Context, Repository) error
AtomicOperation is the format waited by AtomicRepository.
type AtomicRepository ¶
type AtomicRepository interface {
Execute(context.Context, AtomicOperation) error
}
AtomicRepository will execute the repository with Transaction.
type Config ¶
type Config struct { AdminRepository AtomicRepository Tracer trace.Tracer Logger *otelzap.Logger }
Config will hold repository and used utils that will be injected into this Service layer on service initialization.
type Interface ¶
type Interface interface { Signin(ctx context.Context, u *ent.Admin) error Signup(ctx context.Context, u *ent.Admin) error ModifyProfile(ctx context.Context, u *ent.Admin) error GetAdmin(ctx context.Context, u *ent.Admin) error }
Interface specifies the business operations of the service.
type MockAtomicOperation ¶
MockAtomicOperation is an autogenerated mock type for the AtomicOperation type
func NewMockAtomicOperation ¶
func NewMockAtomicOperation(t mockConstructorTestingTNewMockAtomicOperation) *MockAtomicOperation
NewMockAtomicOperation creates a new instance of MockAtomicOperation. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockAtomicOperation) Execute ¶
func (_m *MockAtomicOperation) Execute(_a0 context.Context, _a1 Repository) error
Execute provides a mock function with given fields: _a0, _a1
type MockAtomicRepository ¶
MockAtomicRepository is an autogenerated mock type for the AtomicRepository type
func NewMockAtomicRepository ¶
func NewMockAtomicRepository(t mockConstructorTestingTNewMockAtomicRepository) *MockAtomicRepository
NewMockAtomicRepository creates a new instance of MockAtomicRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockAtomicRepository) Execute ¶
func (_m *MockAtomicRepository) Execute(_a0 context.Context, _a1 AtomicOperation) error
Execute provides a mock function with given fields: _a0, _a1
type MockInterface ¶
MockInterface is an autogenerated mock type for the Interface type
func NewMockInterface ¶
func NewMockInterface(t mockConstructorTestingTNewMockInterface) *MockInterface
NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockInterface) ModifyProfile ¶
ModifyProfile provides a mock function with given fields: ctx, u
type MockRepository ¶
MockRepository is an autogenerated mock type for the Repository type
func NewMockRepository ¶
func NewMockRepository(t mockConstructorTestingTNewMockRepository) *MockRepository
NewMockRepository creates a new instance of MockRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockRepository) CreateAdmin ¶
CreateAdmin provides a mock function with given fields: ctx, u
func (*MockRepository) FindAdminByID ¶
FindAdminByID provides a mock function with given fields: ctx, uid
func (*MockRepository) FindAdminByLogin ¶
FindAdminByLogin provides a mock function with given fields: ctx, login
func (*MockRepository) UpdateAdmin ¶
UpdateAdmin provides a mock function with given fields: ctx, u
type Repository ¶
type Repository interface { CreateAdmin(ctx context.Context, u *ent.Admin) error UpdateAdmin(ctx context.Context, u *ent.Admin) error FindAdminByID(ctx context.Context, uid uuid.UUID) (*ent.Admin, error) FindAdminByLogin(ctx context.Context, login string) (*ent.Admin, error) }
Repository contain all the function available in the defined domain.