-
Notifications
You must be signed in to change notification settings - Fork 0
Update YaTgStorage API, also add SessionStorage implementation
#8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
YaTgStorage API, also add SessionStorage implementationYaTgStorage API, also add SessionStorage implementation
YaCodesDevelopment
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid CGO and native libs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the YaTgStorage API to improve its design and adds a new SessionStorage implementation with encryption capabilities. The main changes focus on removing entity-specific state from the Storage constructor and making the API more flexible by requiring entity IDs to be passed with each operation.
- Removed
entityIDandhandlerparameters fromNewStorageconstructor, making the API more flexible - Updated all storage methods to accept
entityIDas a parameter instead of using instance-level state - Added comprehensive
SessionStorageimplementation with AES encryption and multiple repository backends (GORM, in-memory)
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| yatgstorage/yatgstorage.go | Updates Storage API to accept entityID per operation, removes instance-level entity state, improves thread safety |
| yatgstorage/yatgstorage_test.go | Updates test cases to match new API signature and adds entityID parameters |
| yatgstorage/session_storage.go | Adds new SessionStorage implementation with AES encryption and repository pattern |
| yatgstorage/session_storage_test.go | Comprehensive test suite for SessionStorage functionality |
| yatgclient/yatgclient.go | Updates client code to pass required parameters to new Storage API |
| go.mod | Adds dependencies for GORM and SQLite support |
Comments suppressed due to low confidence (2)
go.mod:55
- The golang.org/x/exp version '0.0.0-20250620022241-b7579e27df2b' appears to be from a future date (June 2025) which may not exist. Consider using a valid existing version or removing this specific version constraint.
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
yatgstorage/session_storage_test.go:18
- The test uses a hardcoded string 'stolyarovtop' as encrypted auth key, but doesn't test with various data types or edge cases like empty data, very large data, or binary data that might contain null bytes.
encryptedAuthKey = "stolyarovtop"
| "github.com/YaCodeDev/GoYaCodeDevUtils/yaerrors" | ||
| "github.com/gotd/td/telegram" | ||
| "gorm.io/gorm" | ||
| "gorm.io/gorm/clause" |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
No description provided.