Skip to content

Reserved keyword registry#333

Open
RiSKeD wants to merge 4 commits into
mainfrom
feat/reserved-keyword-registry
Open

Reserved keyword registry#333
RiSKeD wants to merge 4 commits into
mainfrom
feat/reserved-keyword-registry

Conversation

@RiSKeD

@RiSKeD RiSKeD commented May 13, 2026

Copy link
Copy Markdown
Contributor

resolves #84

@RiSKeD

RiSKeD commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

Only thing i am not sure about or happy with is that we need to expose the global keywords and their handlers as global vars. Another approach would be to hide these behind functions, which in my opinion is even more cumbersome though...

@RiSKeD RiSKeD requested a review from jenstopp May 13, 2026 08:49
@RiSKeD RiSKeD mentioned this pull request May 28, 2026
@RiSKeD RiSKeD force-pushed the feat/reserved-keyword-registry branch from f8b6613 to 6893ee5 Compare June 30, 2026 09:37
RiSKeD added 4 commits June 30, 2026 11:38
Single source of truth for names reserved by dutctl client-side
dispatch, shared by the dutctl client and dutagent config validation.

Each keyword carries its description and dispatch handler. Handlers
operate through a small Client interface so the package stays free of
client-binary internals, letting both binaries import it without a cycle.

Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
Devlist/command decoding now rejects any device or command named with a
reserved keyword (keyword.IsReservedDeviceName / IsReservedCommandName),
returning keyword.ErrReservedName so a colliding config fails at load.

Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
Replace the hardcoded lock/unlock switch and help check with registry
lookups (keyword.CommandHandler / DeviceHandler). The application
implements keyword.Client, so handlers live in pkg/keyword and stay in
sync with config validation without a separate dispatch table.

Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
Point the doc links at pkg/keyword.CommandKeywords / DeviceKeywords.

Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
@RiSKeD RiSKeD force-pushed the feat/reserved-keyword-registry branch from 6893ee5 to 8bbc2f8 Compare June 30, 2026 09:39
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.

Handle reserved keywords

1 participant