Skip to content

Add local mode and nonlocal field tag#92

Draft
ivan4th wants to merge 1 commit intomasterfrom
feature/local
Draft

Add local mode and nonlocal field tag#92
ivan4th wants to merge 1 commit intomasterfrom
feature/local

Conversation

@ivan4th
Copy link
Copy Markdown
Contributor

@ivan4th ivan4th commented Jun 28, 2024

Some of the fields may only be needed for over-the-network transfer,
but can be skipped when encoding the object locally. For instance, if
the object is stored in a blob field in the database, but some parts
of it also are stored in other columns in the same row, we can save
some space by omitting these fields in the blobs.

This is achieved by adding nonlocal field tag, WithEncodeLocal()
encoder option and WithDecodeLocal() decoder option. The encoder and
the decoder skip fields with nonlocal tag when they're in the local
mode.

Some of the fields may only be needed for over-the-network transfer,
but can be skipped when encoding the object locally. For instance, if
the object is stored in a blob field in the database, but some parts
of it also are stored in other columns in the same row, we can save
some space by omitting these fields in the blobs.

This is achieved by adding `nonlocal` field tag, `WithEncodeLocal()`
encoder option and `WithDecodeLocal()` decoder option. The encoder and
the decoder skip fields with `nonlocal` tag when they're in the local
mode.
@codecov
Copy link
Copy Markdown

codecov bot commented Jun 28, 2024

Codecov Report

❌ Patch coverage is 38.46154% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.8%. Comparing base (4956740) to head (9f809b7).
⚠️ Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
generate.go 22.2% 12 Missing and 2 partials ⚠️
decoder.go 0.0% 7 Missing ⚠️
tag.go 72.7% 4 Missing and 2 partials ⚠️
encoder.go 0.0% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master     #92     +/-   ##
========================================
+ Coverage    50.0%   50.8%   +0.7%     
========================================
  Files           6       6             
  Lines         891     929     +38     
========================================
+ Hits          446     472     +26     
- Misses        376     385      +9     
- Partials       69      72      +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ivan4th ivan4th marked this pull request as draft June 28, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant