Skip to content
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

Add local mode and nonlocal field tag #92

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

ivan4th
Copy link
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.
Copy link

codecov bot commented Jun 28, 2024

Codecov Report

Attention: 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 4 commits behind head on master.

Files 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.

@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