Skip to content

feat(pinning): expose name-partial helper and match strategies - #104

Merged
pcfreak30 merged 1 commit into
developfrom
feat/pinning-name-partial-helper
Aug 15, 2026
Merged

feat(pinning): expose name-partial helper and match strategies#104
pcfreak30 merged 1 commit into
developfrom
feat/pinning-name-partial-helper

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented Aug 15, 2026

Copy link
Copy Markdown
Member

Follow-up to #102 (WithFilterMatch, shipped in v0.1.80). The TextMatchingStrategy type lives in the internal ippinning package, so a consumer cannot send a server-side substring name search (match=partial) through the public SDK surface without naming an internal type.

Adds:

  • Re-exported TextMatchingStrategy type and its four spec values (MatchExact, MatchIExact, MatchPartial, MatchIPartial).
  • WithFilterNamePartial(name) - composes name + match=partial in a single ListOption for the spec's contains-style substring name search.

Tests guard the helper and the re-exported consts. This unblocks pinner-cli's pins_list server-side substring search.


Summary

This pull request enhances the pinning API by exposing the name-match strategies from the underlying IPFS Pinning Services API and adds a convenient helper for performing substring (partial) name searches.

Key Changes

1. Re-exported Text Matching Strategies (pinning.go)

The TextMatchingStrategy type is now publicly re-exported, along with four named constants that mirror the IPFS Pinning Services API:

  • MatchExact (exact match)
  • MatchIExact (case-insensitive exact match)
  • MatchPartial (substring/contains match)
  • MatchIPartial (case-insensitive substring match)

This removes the need for callers to reference the underlying package directly when specifying name-match strategies.

2. New WithFilterNamePartial Helper (pinning.go)

Added a convenience function that combines WithFilterName() and WithFilterMatch(partial) into a single ListOption. This simplifies the API for callers who want to perform a server-side substring (contains-style) name search, as they no longer need to specify the match strategy type separately.

3. Test Coverage (pinning_test.go)

Added two new tests:

  • TestWithFilterNamePartial: Verifies that the new helper correctly sets both the name and the partial match strategy.
  • TestReExportedMatchStrategies: Confirms that the re-exported strategy constants correctly map to the underlying IPFS Pinning Services API values.

Impact

These changes provide a more ergonomic and intuitive API surface for developers performing pin list filtering by name, especially for partial/substring matching scenarios, while maintaining full compatibility with the underlying IPFS Pinning Services API specification.

ListPins gained WithFilterMatch (shipped in v0.1.80), but the TextMatchingStrategy
type stays internal to ippinning, so a caller cannot express match=partial
substring search through the public SDK surface without naming an internal type.

Re-export the strategy type and its four spec values (exact/iexact/partial/
ipartial), and add WithFilterNamePartial(name) which composes a name filter with
match=partial in a single ListOption - the IPFS Pinning Services API's
contains-style substring match. Tests guard both the helper and the re-exported
consts.
@kody-ai

kody-ai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@github-actions

Copy link
Copy Markdown

Code Coverage Report

Total Coverage: 11.3%

Generated from commit: a770bc0
Repository: LumeWeb/ipfs-sdk

@pcfreak30
pcfreak30 merged commit 3323b83 into develop Aug 15, 2026
4 checks passed
@pcfreak30
pcfreak30 deleted the feat/pinning-name-partial-helper branch August 20, 2026 17:15
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