forked from raystack/compass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
2,818 additions
and
1,550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package job | ||
|
||
import ( | ||
"context" | ||
"time" | ||
) | ||
|
||
type Repository interface { | ||
GetSyncJobsByService(ctx context.Context, serviceName string) ([]JobsQueue, error) | ||
} | ||
|
||
type JobsQueue struct { | ||
ID string `db:"id"` | ||
Type string `db:"type"` | ||
LastError string `db:"last_error"` | ||
AttemptsDo int32 `db:"attempts_do"` | ||
Payload []byte `db:"payload"` | ||
RunAt time.Time `db:"run_at"` | ||
CreatedAt time.Time `db:"created_at"` | ||
UpdatedAt time.Time `db:"updated_at"` | ||
LastAttempt time.Time `db:"last_attempt"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package job | ||
|
||
import "context" | ||
|
||
func NewService(jobRepository Repository) *Service { | ||
return &Service{ | ||
jobRepository: jobRepository, | ||
} | ||
} | ||
|
||
type Service struct { | ||
jobRepository Repository | ||
} | ||
|
||
// GetSyncJobsByService handles business process to get tags by its asset id | ||
func (s *Service) GetSyncJobsByService(ctx context.Context, serviceName string) ([]JobsQueue, error) { | ||
return s.jobRepository.GetSyncJobsByService(ctx, serviceName) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.