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

feat:(fieldmask) support black-list mode #192

Merged
merged 17 commits into from
Apr 26, 2024
Merged

feat:(fieldmask) support black-list mode #192

merged 17 commits into from
Apr 26, 2024

Conversation

AsterDY
Copy link
Contributor

@AsterDY AsterDY commented Apr 15, 2024

Description

Feature

  • add option Options.BlackListMode to decide if it is a black list when NewFieldMask()
  • add logics in FieldMask.InMask():
    • if the ID is not set (not in black list), return true
    • if the ID is set but the value has children ( Intermediate node in a black path), return true
    • if the ID is set but the value has no child ( terminating node in a black path), return false
  • add API FieldMask.GetPath() to search child of a fieldmask
  • add API FieldMask.ForEachChild() to iterate over all children of a fieldmask

Bugfix

  • fix: handle Enum kind not correctly when making fieldmask
  • fix: not pass sub-fieldmask when code generating for ReadFieldList

Motivation and Context

  • 业务需要支持黑名单模式
  • 业务需要知道特定 Thrift Path 下的包含的所有标记

Related Issue

@AsterDY AsterDY requested review from a team as code owners April 15, 2024 05:29
@AsterDY AsterDY merged commit 88d1e48 into main Apr 26, 2024
5 of 6 checks passed
@AsterDY AsterDY deleted the feat/fm_black branch April 26, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants