mocks

package
v0.0.0-...-f52bcce Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mocks the service user.Service for testing purpose

Package mocks the service base user.ServiceBase for testing purpose

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	*ServiceBase // DO NOT REMOVE this line. ServiceBase implements IServiceBase interface

}

type ServiceBase

type ServiceBase struct {
	Create_ func(ctx context.IDataMap, ety *user.UserEntity) (*user.UserEntity, error)
	Read_   func(ctx context.IDataMap, id string) (*user.UserEntity, error)
	Update_ func(ctx context.IDataMap, ety *user.UserEntity) (*user.UserEntity, error)
	Delete_ func(ctx context.IDataMap, id string) error
	Query_  func(q *tql.Query) (*tql.Result, error)
}

func (*ServiceBase) Create

func (s *ServiceBase) Create(ctx context.IDataMap, ety *user.UserEntity) (*user.UserEntity, error)

Create given a new entity this one is populated with ID and creation timestamp and finally saved into the repository

func (*ServiceBase) Delete

func (s *ServiceBase) Delete(ctx context.IDataMap, id string) error

Delete removes the entity given its id

func (*ServiceBase) Query

func (s *ServiceBase) Query(q *tql.Query) (*tql.Result, error)

Query executes the given query (TQL) and returns the query result

func (*ServiceBase) Read

func (s *ServiceBase) Read(ctx context.IDataMap, id string) (*user.UserEntity, error)

Read returns a pointer to UserEntity given its id

func (*ServiceBase) Update

func (s *ServiceBase) Update(ctx context.IDataMap, ety *user.UserEntity) (*user.UserEntity, error)

Update returns a pointer to UserEntity after update it

Jump to

Keyboard shortcuts

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