Use request.CTX instead of *request.Context (#24877)
* Use request.CTX instead of *request.Context * Fix tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
37dc35c1a1
Коммит
c7461751f2
@@ -4945,7 +4945,7 @@ func (s *OpenTracingLayerJobStore) Delete(id string) (string, error) {
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) Get(c request.CTX, id string) (*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.Get")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -4963,7 +4963,7 @@ func (s *OpenTracingLayerJobStore) Get(c *request.Context, id string) (*model.Jo
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) GetAllByStatus(c *request.Context, status string) ([]*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) GetAllByStatus(c request.CTX, status string) ([]*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.GetAllByStatus")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -4981,7 +4981,7 @@ func (s *OpenTracingLayerJobStore) GetAllByStatus(c *request.Context, status str
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) GetAllByType(c *request.Context, jobType string) ([]*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) GetAllByType(c request.CTX, jobType string) ([]*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.GetAllByType")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -4999,7 +4999,7 @@ func (s *OpenTracingLayerJobStore) GetAllByType(c *request.Context, jobType stri
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.GetAllByTypeAndStatus")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -5017,7 +5017,7 @@ func (s *OpenTracingLayerJobStore) GetAllByTypeAndStatus(c *request.Context, job
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.GetAllByTypePage")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -5035,7 +5035,7 @@ func (s *OpenTracingLayerJobStore) GetAllByTypePage(c *request.Context, jobType
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *OpenTracingLayerJobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.GetAllByTypesPage")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8299,7 +8299,7 @@ func (s *OpenTracingLayerSessionStore) Get(c request.CTX, sessionIDOrToken strin
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerSessionStore) GetSessions(c *request.Context, userID string) ([]*model.Session, error) {
|
||||
func (s *OpenTracingLayerSessionStore) GetSessions(c request.CTX, userID string) ([]*model.Session, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "SessionStore.GetSessions")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
|
||||
@@ -5584,7 +5584,7 @@ func (s *RetryLayerJobStore) Delete(id string) (string, error) {
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) Get(c request.CTX, id string) (*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -5605,7 +5605,7 @@ func (s *RetryLayerJobStore) Get(c *request.Context, id string) (*model.Job, err
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) GetAllByStatus(c *request.Context, status string) ([]*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) GetAllByStatus(c request.CTX, status string) ([]*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -5626,7 +5626,7 @@ func (s *RetryLayerJobStore) GetAllByStatus(c *request.Context, status string) (
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) GetAllByType(c *request.Context, jobType string) ([]*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) GetAllByType(c request.CTX, jobType string) ([]*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -5647,7 +5647,7 @@ func (s *RetryLayerJobStore) GetAllByType(c *request.Context, jobType string) ([
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -5668,7 +5668,7 @@ func (s *RetryLayerJobStore) GetAllByTypeAndStatus(c *request.Context, jobType s
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -5689,7 +5689,7 @@ func (s *RetryLayerJobStore) GetAllByTypePage(c *request.Context, jobType string
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerJobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *RetryLayerJobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
@@ -9451,7 +9451,7 @@ func (s *RetryLayerSessionStore) Get(c request.CTX, sessionIDOrToken string) (*m
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerSessionStore) GetSessions(c *request.Context, userID string) ([]*model.Session, error) {
|
||||
func (s *RetryLayerSessionStore) GetSessions(c request.CTX, userID string) ([]*model.Session, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
|
||||
@@ -317,7 +317,7 @@ func createScheme(ss store.Store) *model.Scheme {
|
||||
return s
|
||||
}
|
||||
|
||||
func createSession(c *request.Context, ss store.Store, userId string) *model.Session {
|
||||
func createSession(c request.CTX, ss store.Store, userId string) *model.Session {
|
||||
m := model.Session{}
|
||||
m.UserId = userId
|
||||
s, _ := ss.Session().Save(c, &m)
|
||||
|
||||
@@ -202,7 +202,7 @@ func (jss SqlJobStore) UpdateStatusOptimistically(id string, currentStatus strin
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
func (jss SqlJobStore) Get(c request.CTX, id string) (*model.Job, error) {
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
From("Jobs").
|
||||
@@ -222,7 +222,7 @@ func (jss SqlJobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
return &status, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (jss SqlJobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
From("Jobs").
|
||||
@@ -242,7 +242,7 @@ func (jss SqlJobStore) GetAllByTypesPage(c *request.Context, jobTypes []string,
|
||||
return jobs, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) GetAllByType(c *request.Context, jobType string) ([]*model.Job, error) {
|
||||
func (jss SqlJobStore) GetAllByType(c request.CTX, jobType string) ([]*model.Job, error) {
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
From("Jobs").
|
||||
@@ -260,7 +260,7 @@ func (jss SqlJobStore) GetAllByType(c *request.Context, jobType string) ([]*mode
|
||||
return statuses, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error) {
|
||||
func (jss SqlJobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error) {
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
From("Jobs").
|
||||
@@ -278,7 +278,7 @@ func (jss SqlJobStore) GetAllByTypeAndStatus(c *request.Context, jobType string,
|
||||
return jobs, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (jss SqlJobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
From("Jobs").
|
||||
@@ -298,7 +298,7 @@ func (jss SqlJobStore) GetAllByTypePage(c *request.Context, jobType string, offs
|
||||
return statuses, nil
|
||||
}
|
||||
|
||||
func (jss SqlJobStore) GetAllByStatus(c *request.Context, status string) ([]*model.Job, error) {
|
||||
func (jss SqlJobStore) GetAllByStatus(c request.CTX, status string) ([]*model.Job, error) {
|
||||
statuses := []*model.Job{}
|
||||
query, args, err := jss.getQueryBuilder().
|
||||
Select("*").
|
||||
|
||||
@@ -100,7 +100,7 @@ func (me SqlSessionStore) Get(c request.CTX, sessionIdOrToken string) (*model.Se
|
||||
return session, nil
|
||||
}
|
||||
|
||||
func (me SqlSessionStore) GetSessions(c *request.Context, userId string) ([]*model.Session, error) {
|
||||
func (me SqlSessionStore) GetSessions(c request.CTX, userId string) ([]*model.Session, error) {
|
||||
sessions := []*model.Session{}
|
||||
|
||||
if err := me.GetReplicaX().Select(&sessions, "SELECT * FROM Sessions WHERE UserId = ? ORDER BY LastActivityAt DESC", userId); err != nil {
|
||||
|
||||
@@ -488,7 +488,7 @@ type BotStore interface {
|
||||
type SessionStore interface {
|
||||
Get(c request.CTX, sessionIDOrToken string) (*model.Session, error)
|
||||
Save(c request.CTX, session *model.Session) (*model.Session, error)
|
||||
GetSessions(c *request.Context, userID string) ([]*model.Session, error)
|
||||
GetSessions(c request.CTX, userID string) ([]*model.Session, error)
|
||||
GetSessionsWithActiveDeviceIds(userID string) ([]*model.Session, error)
|
||||
GetSessionsExpired(thresholdMillis int64, mobileOnly bool, unnotifiedOnly bool) ([]*model.Session, error)
|
||||
UpdateExpiredNotify(sessionid string, notified bool) error
|
||||
@@ -736,12 +736,12 @@ type JobStore interface {
|
||||
UpdateOptimistically(job *model.Job, currentStatus string) (bool, error)
|
||||
UpdateStatus(id string, status string) (*model.Job, error)
|
||||
UpdateStatusOptimistically(id string, currentStatus string, newStatus string) (bool, error)
|
||||
Get(c *request.Context, id string) (*model.Job, error)
|
||||
GetAllByType(c *request.Context, jobType string) ([]*model.Job, error)
|
||||
GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error)
|
||||
GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error)
|
||||
GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error)
|
||||
GetAllByStatus(c *request.Context, status string) ([]*model.Job, error)
|
||||
Get(c request.CTX, id string) (*model.Job, error)
|
||||
GetAllByType(c request.CTX, jobType string) ([]*model.Job, error)
|
||||
GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error)
|
||||
GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error)
|
||||
GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error)
|
||||
GetAllByStatus(c request.CTX, status string) ([]*model.Job, error)
|
||||
GetNewestJobByStatusAndType(status string, jobType string) (*model.Job, error)
|
||||
GetNewestJobByStatusesAndType(statuses []string, jobType string) (*model.Job, error)
|
||||
GetCountByStatusAndType(status string, jobType string) (int64, error)
|
||||
|
||||
@@ -54,15 +54,15 @@ func (_m *JobStore) Delete(id string) (string, error) {
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: c, id
|
||||
func (_m *JobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
func (_m *JobStore) Get(c request.CTX, id string) (*model.Job, error) {
|
||||
ret := _m.Called(c, id)
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) (*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.Job, error)); ok {
|
||||
return rf(c, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) *model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.Job); ok {
|
||||
r0 = rf(c, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -70,7 +70,7 @@ func (_m *JobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(c, id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -80,15 +80,15 @@ func (_m *JobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
}
|
||||
|
||||
// GetAllByStatus provides a mock function with given fields: c, status
|
||||
func (_m *JobStore) GetAllByStatus(c *request.Context, status string) ([]*model.Job, error) {
|
||||
func (_m *JobStore) GetAllByStatus(c request.CTX, status string) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, status)
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) ([]*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.Job, error)); ok {
|
||||
return rf(c, status)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) []*model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.Job); ok {
|
||||
r0 = rf(c, status)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -96,7 +96,7 @@ func (_m *JobStore) GetAllByStatus(c *request.Context, status string) ([]*model.
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(c, status)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -106,15 +106,15 @@ func (_m *JobStore) GetAllByStatus(c *request.Context, status string) ([]*model.
|
||||
}
|
||||
|
||||
// GetAllByType provides a mock function with given fields: c, jobType
|
||||
func (_m *JobStore) GetAllByType(c *request.Context, jobType string) ([]*model.Job, error) {
|
||||
func (_m *JobStore) GetAllByType(c request.CTX, jobType string) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobType)
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) ([]*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.Job, error)); ok {
|
||||
return rf(c, jobType)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) []*model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.Job); ok {
|
||||
r0 = rf(c, jobType)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -122,7 +122,7 @@ func (_m *JobStore) GetAllByType(c *request.Context, jobType string) ([]*model.J
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(c, jobType)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -132,15 +132,15 @@ func (_m *JobStore) GetAllByType(c *request.Context, jobType string) ([]*model.J
|
||||
}
|
||||
|
||||
// GetAllByTypeAndStatus provides a mock function with given fields: c, jobType, status
|
||||
func (_m *JobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error) {
|
||||
func (_m *JobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobType, status)
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) ([]*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) ([]*model.Job, error)); ok {
|
||||
return rf(c, jobType, status)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) []*model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) []*model.Job); ok {
|
||||
r0 = rf(c, jobType, status)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -148,7 +148,7 @@ func (_m *JobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, st
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string) error); ok {
|
||||
r1 = rf(c, jobType, status)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -158,15 +158,15 @@ func (_m *JobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, st
|
||||
}
|
||||
|
||||
// GetAllByTypePage provides a mock function with given fields: c, jobType, offset, limit
|
||||
func (_m *JobStore) GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (_m *JobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobType, offset, limit)
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, int, int) ([]*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, int, int) ([]*model.Job, error)); ok {
|
||||
return rf(c, jobType, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, int, int) []*model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, int, int) []*model.Job); ok {
|
||||
r0 = rf(c, jobType, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -174,7 +174,7 @@ func (_m *JobStore) GetAllByTypePage(c *request.Context, jobType string, offset
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string, int, int) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, int, int) error); ok {
|
||||
r1 = rf(c, jobType, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -184,15 +184,15 @@ func (_m *JobStore) GetAllByTypePage(c *request.Context, jobType string, offset
|
||||
}
|
||||
|
||||
// GetAllByTypesPage provides a mock function with given fields: c, jobTypes, offset, limit
|
||||
func (_m *JobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (_m *JobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobTypes, offset, limit)
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, []string, int, int) ([]*model.Job, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, int, int) ([]*model.Job, error)); ok {
|
||||
return rf(c, jobTypes, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, []string, int, int) []*model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, int, int) []*model.Job); ok {
|
||||
r0 = rf(c, jobTypes, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -200,7 +200,7 @@ func (_m *JobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, off
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, []string, int, int) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, []string, int, int) error); ok {
|
||||
r1 = rf(c, jobTypes, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
|
||||
@@ -80,15 +80,15 @@ func (_m *SessionStore) Get(c request.CTX, sessionIDOrToken string) (*model.Sess
|
||||
}
|
||||
|
||||
// GetSessions provides a mock function with given fields: c, userID
|
||||
func (_m *SessionStore) GetSessions(c *request.Context, userID string) ([]*model.Session, error) {
|
||||
func (_m *SessionStore) GetSessions(c request.CTX, userID string) ([]*model.Session, error) {
|
||||
ret := _m.Called(c, userID)
|
||||
|
||||
var r0 []*model.Session
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) ([]*model.Session, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.Session, error)); ok {
|
||||
return rf(c, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) []*model.Session); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.Session); ok {
|
||||
r0 = rf(c, userID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -96,7 +96,7 @@ func (_m *SessionStore) GetSessions(c *request.Context, userID string) ([]*model
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(c, userID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
|
||||
@@ -4497,7 +4497,7 @@ func (s *TimerLayerJobStore) Delete(id string) (string, error) {
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) Get(c *request.Context, id string) (*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) Get(c request.CTX, id string) (*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.Get(c, id)
|
||||
@@ -4513,7 +4513,7 @@ func (s *TimerLayerJobStore) Get(c *request.Context, id string) (*model.Job, err
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) GetAllByStatus(c *request.Context, status string) ([]*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) GetAllByStatus(c request.CTX, status string) ([]*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.GetAllByStatus(c, status)
|
||||
@@ -4529,7 +4529,7 @@ func (s *TimerLayerJobStore) GetAllByStatus(c *request.Context, status string) (
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) GetAllByType(c *request.Context, jobType string) ([]*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) GetAllByType(c request.CTX, jobType string) ([]*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.GetAllByType(c, jobType)
|
||||
@@ -4545,7 +4545,7 @@ func (s *TimerLayerJobStore) GetAllByType(c *request.Context, jobType string) ([
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) GetAllByTypeAndStatus(c *request.Context, jobType string, status string) ([]*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status string) ([]*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.GetAllByTypeAndStatus(c, jobType, status)
|
||||
@@ -4561,7 +4561,7 @@ func (s *TimerLayerJobStore) GetAllByTypeAndStatus(c *request.Context, jobType s
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) GetAllByTypePage(c *request.Context, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.GetAllByTypePage(c, jobType, offset, limit)
|
||||
@@ -4577,7 +4577,7 @@ func (s *TimerLayerJobStore) GetAllByTypePage(c *request.Context, jobType string
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerJobStore) GetAllByTypesPage(c *request.Context, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
func (s *TimerLayerJobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.JobStore.GetAllByTypesPage(c, jobTypes, offset, limit)
|
||||
@@ -7487,7 +7487,7 @@ func (s *TimerLayerSessionStore) Get(c request.CTX, sessionIDOrToken string) (*m
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *TimerLayerSessionStore) GetSessions(c *request.Context, userID string) ([]*model.Session, error) {
|
||||
func (s *TimerLayerSessionStore) GetSessions(c request.CTX, userID string) ([]*model.Session, error) {
|
||||
start := time.Now()
|
||||
|
||||
result, err := s.SessionStore.GetSessions(c, userID)
|
||||
|
||||
Ссылка в новой задаче
Block a user