feat: Make CapabilitySet public - #111
Merged
Merged
Conversation
nemith
force-pushed
the
brb/push-wvtwrkwqypsq
branch
2 times, most recently
from
January 2, 2026 23:09
fe7a68d to
89d5b3e
Compare
There was a problem hiding this comment.
Pull request overview
This PR makes the CapabilitySet type public to provide a more ergonomic API for working with NETCONF capabilities. Instead of returning raw []string slices, the session now returns *CapabilitySet which provides useful methods like Has() for capability checking.
- Exports
CapabilitySettype with read-only methods (Has(),Len(),All()) - Renames API methods from
ClientCapabilities()/ServerCapabilities()toClientCaps()/ServerCaps()and changes return type to*CapabilitySet - Adds constants
CapNetConfig10andCapNetConfig11for common base capabilities
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| capability.go | Exports CapabilitySet type, adds Len() method, converts All() to return iterator, and adds capability constants |
| session.go | Updates method signatures to return *CapabilitySet, renames methods to shorter names, uses slices.Collect for iterator conversion |
| inttest/ssh_test.go | Updates test to use new ServerCaps() method and Len() instead of checking slice length |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nemith
force-pushed
the
brb/push-wvtwrkwqypsq
branch
from
January 2, 2026 23:10
89d5b3e to
ed4e19f
Compare
nemith
force-pushed
the
brb/push-wvtwrkwqypsq
branch
from
January 2, 2026 23:12
ed4e19f to
f6be1af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CapabilitySet was a unexported before with the public api being a
[]string. This exports it and has the session return theCapabilitySetinstead of[]stringexposing theHas()method .Right now this is a completely frozen/readonly interface which feels right.