Skip to content

feat: Make CapabilitySet public - #111

Merged
nemith merged 1 commit into
mainfrom
brb/push-wvtwrkwqypsq
Jan 2, 2026
Merged

feat: Make CapabilitySet public#111
nemith merged 1 commit into
mainfrom
brb/push-wvtwrkwqypsq

Conversation

@nemith

@nemith nemith commented Jan 2, 2026

Copy link
Copy Markdown
Owner

CapabilitySet was a unexported before with the public api being a []string. This exports it and has the session return the CapabilitySet instead of []string exposing the Has() method .

Right now this is a completely frozen/readonly interface which feels right.

@nemith
nemith requested a review from Copilot January 2, 2026 23:06
@nemith
nemith force-pushed the brb/push-wvtwrkwqypsq branch 2 times, most recently from fe7a68d to 89d5b3e Compare January 2, 2026 23:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CapabilitySet type with read-only methods (Has(), Len(), All())
  • Renames API methods from ClientCapabilities()/ServerCapabilities() to ClientCaps()/ServerCaps() and changes return type to *CapabilitySet
  • Adds constants CapNetConfig10 and CapNetConfig11 for 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.

Comment thread session.go
Comment thread capability.go Outdated
@nemith
nemith force-pushed the brb/push-wvtwrkwqypsq branch from 89d5b3e to ed4e19f Compare January 2, 2026 23:10
@nemith
nemith force-pushed the brb/push-wvtwrkwqypsq branch from ed4e19f to f6be1af Compare January 2, 2026 23:12
@nemith
nemith merged commit bc87b35 into main Jan 2, 2026
6 checks passed
@nemith
nemith deleted the brb/push-wvtwrkwqypsq branch January 2, 2026 23: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.

2 participants