SDK v3 #8

Merged
SoXX merged 77 commits from dev/issue-5 into main 2024-08-14 13:27:35 +00:00

77 Commits

Author SHA1 Message Date
975e084b16 feat(scope): added sorting
All checks were successful
Gitea Build Check / Build (push) Successful in 2m20s
Gitea Build Check / Build (pull_request) Successful in 2m18s
2024-08-14 15:21:29 +02:00
2eeae0e5c7 chore(readme): Update README example to include full DatabaseConfig initialization and use database.Connect function
All checks were successful
Gitea Build Check / Build (push) Successful in 2m15s
Gitea Build Check / Build (pull_request) Successful in 2m15s
2024-08-14 15:03:26 +02:00
44bedd20a1 feat(version): Update to version 3
All checks were successful
Gitea Build Check / Build (push) Successful in 2m18s
Gitea Build Check / Build (pull_request) Successful in 2m13s
Updated the module to version 3.

BREAKING CHANGE: This SDK version is not compatible with programs using the v2 implementation.
2024-08-14 14:58:06 +02:00
d10aa731bc feat(test): added scopes fixed issues
All checks were successful
Gitea Build Check / Build (push) Successful in 2m22s
Gitea Build Check / Build (pull_request) Successful in 2m17s
fully tested scopes. Also found bugs with the tests. Those are now fixed.
2024-08-14 14:53:08 +02:00
8f6ca691bf feat(test): added post, tags & fixed issues
All checks were successful
Gitea Build Check / Build (push) Successful in 2m0s
fully tested post & tags. Also found bugs with the tests. Those are now fixed.
2024-08-14 13:43:11 +02:00
7632daee84 feat(test): added post
fully tested post
2024-08-13 21:17:17 +02:00
00b8fe6b71 feat(test): added sources
All checks were successful
Gitea Build Check / Build (push) Successful in 1m33s
fully tested sources
2024-08-13 15:44:12 +02:00
5e9b4ff532 refactor(tracing): Refactor source ID logging and tracing 2024-08-13 15:43:45 +02:00
450e06eb25 refactor: Refactor Domain field to use SourceDomain type in Source struct 2024-08-13 15:43:03 +02:00
de28bdbb0b chore: Remove unused function 2024-08-13 15:41:55 +02:00
b7e3877b68 feat(test): Add GenerateRandomSources function for creating random sources 2024-08-13 15:41:36 +02:00
2bbfc79e43 feat(test): added tag
All checks were successful
Gitea Build Check / Build (push) Successful in 1m19s
fully tested tags
2024-08-13 15:08:35 +02:00
92ef2c5059 feat(error): more error handling
added missing checks
2024-08-13 15:08:10 +02:00
5cc5a22d28 feat(error): added additional constant
added missing log content for tag
2024-08-13 15:07:53 +02:00
6dc78db4a4 fix(test): user not created
All checks were successful
Gitea Build Check / Build (push) Successful in 1m11s
fix an issue where the user was not created
2024-08-13 14:48:31 +02:00
f0f216bdaa feat(test): added tagAlias
Some checks failed
Gitea Build Check / Build (push) Failing after 1m1s
fully tested tag groups
2024-08-13 14:44:50 +02:00
5562d75e3a feat(error): more error handling
added missing checks
2024-08-13 14:44:27 +02:00
a9ac2a34fb feat(error): added additional constant 2024-08-13 14:44:16 +02:00
3fcdb0e9ea feat(test): added tagGroups
fully tested tag groups
2024-08-13 14:26:33 +02:00
1cbdd1f4ed feat(error): added additional constant
added missing log content for tag
2024-08-13 14:26:12 +02:00
d6cbea3f58 feat(error): more error handling
added missing checks
2024-08-13 14:25:36 +02:00
146315f991 feat(testing): first tests
Some checks failed
Gitea Build Check / Build (push) Failing after 44s
added the first set of new tests
2024-08-13 14:02:15 +02:00
3fadaac69a fix: added documentation & fixed logging 2024-08-13 14:01:48 +02:00
71488dade9 feat(database): Enable error translation in GORM configuration for better error handling 2024-08-13 14:00:36 +02:00
9ad1df51cf fix(migration): Change scrape_time_interval from INT to TEXT in initial database migration script 2024-08-13 14:00:16 +02:00
176fdfb8b1 feat(test): Add unit tests for CreateUser, GetUserByID, and DeleteUser functions with setup and teardown 2024-08-13 12:55:20 +02:00
89ab1dca02 fix(testing): Add lib/pq import and update postgres container setup
new version of testing library changed functions
2024-08-13 12:55:06 +02:00
51b305a725 chore(dependencies): Add github.com/lib/pq v1.10.9 to project dependencies 2024-08-13 12:54:24 +02:00
1345fa9c9e refactor: Simplify migration logging by removing redundant config.Debug check 2024-08-13 12:54:02 +02:00
ad076f585b fix: Use Debugf for formatted debug message in migrateDatabase 2024-08-13 12:52:58 +02:00
75bbbb4408 chore(tests):
Some checks failed
Gitea Build Check / Build (push) Failing after 26s
refactored & fixed old test cases
2024-08-13 11:07:14 +02:00
cfc7e5362d chore: Add comments and improve JSON annotations for better data structuring and clarity across the codebase 2024-08-13 10:54:21 +02:00
b4e8152cb4 chore: removed dead code 2024-08-13 10:35:01 +02:00
78e17cf100 feat(scopes): Add pagination support with Paginate and AdvancedPagination functions
Some checks failed
Gitea Build Check / Build (push) Failing after 29s
- Introduce Paginate function for basic pagination
- Add AdvancedPagination for pagination, sorting, and counting
- Define Pagination struct to hold pagination data
- Set MaxPageSizeLimit and DefaultPageSize in models/constants
2024-08-13 10:29:47 +02:00
8668d504b9 feat(tests): Add tag generator utility functions for tests
Some checks failed
Gitea Build Check / Build (push) Failing after 30s
2024-08-12 15:54:36 +02:00
a4792f5d67 chore(dependencies): Update dependencies to latest versions 2024-08-12 15:54:16 +02:00
bd76f838ec refactor(tracing): fixed minor issues & added debug flag 2024-08-12 15:53:45 +02:00
5ffb558ab8 fix(tracing): wrong attribute type
Some checks failed
Gitea Build Check / Build (push) Failing after 30s
changed attribute types in to Int
2024-08-12 11:54:57 +02:00
0a8f84bb15 fix(tracing): wrong attribute type
changed attribute types in to Int
2024-08-12 11:54:53 +02:00
6583ae7d29 fix(tracing): wrong attribute type
changed attribute types in to Int
2024-08-12 11:54:50 +02:00
e38171e53d fix(tracing): wrong attribute type
changed attribute types in to Int
2024-08-12 11:53:48 +02:00
7cf51f9b90 fix(tracing): wrong attribute type
changed attribute types in to Int
2024-08-12 11:53:17 +02:00
9d9b354698 fix(tracing): wrong attribute type
changed attribute types in to Int
2024-08-12 11:52:53 +02:00
ae7bc131f7 refactor(tracing): tracing & logging
added the custom util functions to handel telemetry
2024-08-12 11:50:45 +02:00
135e09ea8e refactor(tracing): tracing & logging
added the custom util functions to handel telemetry
2024-08-12 11:46:53 +02:00
24d51a3751 refactor(tracing): tracing & logging
added the custom util functions to handel telemetry
2024-08-12 11:39:22 +02:00
d994ead6f6 refactor(tracing): tracing & logging
added the custom util functions to handel telemetry
2024-08-12 11:36:34 +02:00
4d262c8fff refactor(tracing): tracing & logging
added the custom util functions to handel telemetry
2024-08-12 11:32:53 +02:00
ffc3164cb7 refactor(tracing): tracing & logging
added the custom util functions to handel telemetry
2024-08-12 11:17:02 +02:00
9512cd10bc feat(tracing): Add utils for OpenTelemetry tracing and event logging 2024-08-12 11:15:34 +02:00
505bc3b522 feat(tracing): Refactor error handling to include trace status update 2024-08-12 11:15:21 +02:00
99ea2d37ab chore(refactor): removed dead code 2024-08-12 11:14:53 +02:00
3f92bdb325 feat(tracing): Add tracing, logging, and error handling to tagGroup database functions 2024-08-12 10:07:42 +02:00
098ecda869 chore(tracing): Rename "tag_count" to "tag_aliases_count" 2024-08-12 10:07:29 +02:00
ca1e1a1da5 feat(tracing): added tracing 2024-08-12 09:58:14 +02:00
6bec8e3373 chore(tracing): Update log field names for clarity 2024-08-12 09:57:31 +02:00
c17b78cc48 refactor(logging): Refactor error handling in CreateTag, CreateTagInBatch, and DeleteTag functions
Some checks failed
Gitea Build Check / Build (push) Failing after 29s
Improve error handling in the CreateTag, CreateTagInBatch, and DeleteTag functions by utilizing a new utility function. Simplify logging and error management, ensuring more consistent error responses throughout these operations.
2024-08-11 22:34:53 +02:00
4707ea3f00 feat(error): Add error handling utility function
Implement the HandleError function in the new error.go file to streamline error logging and tracing. Include necessary imports for context, logrus, and OpenTelemetry tracing.
2024-08-11 22:34:28 +02:00
bb64c08185 chore(dependencies): updated dependencies
Some checks failed
Gitea Build Check / Build (push) Failing after 30s
2024-08-11 22:17:40 +02:00
a368f59234 feat(telemetry): Implement OpenTelemetry tracing and logging in tag management functions 2024-08-11 22:17:24 +02:00
2d9db01d72 feat(telemetry): Implement telemetry setup in database client
Add OpenTelemetry integration to the database client by creating a `setupTelemetry` function. Initialize a tracer and configure logging with the otellogrus hook. Call this function during the connection process to enable tracing and logging for database operations.
2024-08-11 22:17:00 +02:00
e839e7ba2a feat(database): return gorm itself
Some checks failed
Gitea Build Check / Build (push) Failing after 28s
2024-08-11 00:26:20 +02:00
9fe2d0edc3 fix(database): make function more coherent with the rest
Some checks failed
Gitea Build Check / Build (push) Failing after 29s
2024-08-11 00:24:02 +02:00
46e6cdfa52 feat(database): added user 2024-08-11 00:23:47 +02:00
2b54f25eea feat(database): added all missing functions 2024-08-11 00:13:46 +02:00
1dc9b1fb7c feat(database): favorites
Some checks failed
Gitea Build Check / Build (push) Failing after 27s
- Added functionality
2024-08-09 22:47:02 +02:00
7720110a0a refactor: Update validation error messages for clarity and consistency 2024-08-09 22:45:25 +02:00
b6c037cb22 refactor: Refactor UserFavorites model to UserFavorite for clarity and consistency
- Rename `UserFavorites` struct to `UserFavorite`
- Update the `TableName` method to reflect the new struct name
2024-08-09 22:45:12 +02:00
3e13046706 fix(query): added conditions
added the condition for the id
2024-08-09 22:44:55 +02:00
85d7905e8a refactor: renamed variables
- Update model references from `UserFavorites` to `UserFavorite` in multiple files.
- Adjust database queries and struct definitions accordingly to maintain consistency.
2024-08-09 22:43:58 +02:00
f798869ef5 feat(database): implementation of functions
Some checks failed
Gitea Build Check / Build (push) Failing after 28s
- Added functionality
- Add connection checks to `CreateUserSource`, `UpdateUserSource`, `GetUserSourceByID`, and `DeleteUserSource` functions.
- Introduce validation for empty and improperly formatted IDs in `UpdateUserSource`, `GetUserSourceByID`, and `DeleteUserSource`.
- Handle duplicate key errors and record not found errors with appropriate custom error messages.
2024-08-09 22:16:03 +02:00
598ca747eb refactor(types): using correct types 2024-08-09 22:14:56 +02:00
b8e29de4fc refactor(error): error handling in database package
- Replace custom error types with string constants for common database errors.
- Simplify the Database struct to include a Reason field for error messages.
- Update Error method to format the error output using the Reason.
- Modify validation error constants for consistency and clarity.
2024-08-09 22:14:13 +02:00
fefc777888 feat(impl): Add database client and migration functionality
Implement connection to PostgreSQL database using GORM. Embed SQL migrations and handle migration execution with logging capabilities. Define configuration structure for database settings.
2024-08-09 21:39:22 +02:00
f940f22d67 chore(impl): removed old functions
removed all old implementation of the SDK

BREAKING-CHANGE: breaks database compatibility to older SDK versions
2024-08-09 21:38:35 +02:00
0e6a8fd61e feat(database): added additional columns
added more columns

BREAKING-CHANGE: breaks database compatibility to older SDK versions
2024-08-09 21:37:54 +02:00
e62280a416 feat(database): added additional columns
added more columns

BREAKING-CHANGE: breaks database compatibility to older SDK versions
2024-08-09 21:37:27 +02:00