Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrConnectionFailed = NewE("connection_failed") ErrTaskAlreadyExistButNotDone = NewE("already_exist_but_not_done") ErrTaskAlreadyExistAndDone = NewE("already_exist_and_done") )
Different errors
Functions ¶
func CreateTaskInitedByUser ¶
Pretends to be service logic function that invokes repository db function SaveTaskToDb...().
0 - calls SaveTaskToDbMockConnectionError 1 - calls SaveTaskToDbMockExistButNotDone 2 - calls SaveTaskToDbMockExistAndDone 3 - calls SaveTaskToDbMockSuccess
All errors occured it annotates with information that this task is inited by userID
func SaveTaskToDbMockConnectionError ¶
It mocks case when one tries to save task to db, but connection error occurs.
It returns specific error with stacktrace and with logger inside, which contains relevant fields.
func SaveTaskToDbMockExistAndDone ¶
It mocks case when one tries to save task to db, but it already exists. Then it asks if task is already done and it occurs it is done.
It returns specific error with stacktrace and with logger inside, which contains relevant fields.
func SaveTaskToDbMockExistButNotDone ¶
It mocks case when one tries to save task to db, but it already exists. Then it asks if task is already done and it occurs it is not.
It returns specific error with stacktrace and with logger inside, which contains relevant fields.
func SaveTaskToDbMockSuccess ¶
func SaveTaskToDbMockSuccess() error
It mocks case of successful saving task.
Types ¶
This section is empty.