Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
NpgsqlRest/NpgsqlRest/IEndpointCreateHandler.cs at master · NpgsqlRest/NpgsqlRest · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading.
Please reload this page
.
NpgsqlRest
/
NpgsqlRest
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
11
Star
130
Code
Issues
0
Pull requests
4
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Files
Expand file tree
master
Breadcrumbs
NpgsqlRest
/
NpgsqlRest
/
IEndpointCreateHandler.cs
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
72 lines (66 loc) · 3.83 KB
master
Breadcrumbs
NpgsqlRest
/
NpgsqlRest
/
IEndpointCreateHandler.cs
Copy path
Top
File metadata and controls
Code
Blame
72 lines (66 loc) · 3.83 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
namespace
NpgsqlRest
{
public
interface
IEndpointCreateHandler
{
/// <summary>
/// Before creating endpoints.
/// </summary>
/// <param name="builder">current application builder</param>
/// <param name="options">current NpgsqlRest options</param>
void
Setup
(
IApplicationBuilder
builder
,
NpgsqlRestOptions
options
)
{
}
/// <summary>
/// Called by the core comment parser, within its single parse pass, for each comment line
/// that core did NOT recognize as a built-in directive. Lets a plugin claim its own
/// annotations (e.g. <c>openapi …</c>, <c>mcp …</c>) without a second pass over the comment.
/// <para>
/// If this plugin owns the line, apply it (typically by storing into
/// <see cref="RoutineEndpoint.Items"/>) and return a <see cref="CommentLineResult"/> with a
/// short label — core logs it centrally (consistent with built-in annotation logging) and
/// stops offering the line to other handlers. Return <c>null</c> if the line is not this
/// plugin's annotation; it is then offered to the next handler, and finally surfaced via
/// <see cref="RoutineEndpoint.UnhandledCommentLines"/> (prose) if no handler claims it.
/// </para>
/// <paramref name="words"/> / <paramref name="wordsLower"/> are pre-tokenized by core (split
/// on space/comma; the lower-cased variant for keyword matching) so handlers do not re-tokenize.
/// <para>
/// Set <see cref="CommentLineResult.RequestsEndpoint"/> to true when the annotation means the
/// routine should be exposed as an endpoint (e.g. <c>mcp</c>) — under
/// <see cref="CommentsMode.OnlyAnnotated"/> this lets a routine with no HTTP tag still be
/// created. Leave it false for pure modifiers (e.g. <c>openapi hide</c>), which must NOT by
/// themselves cause an endpoint to be created.
/// </para>
/// </summary>
CommentLineResult
?
HandleCommentLine
(
RoutineEndpoint
endpoint
,
string
line
,
string
[
]
words
,
string
[
]
wordsLower
)
=>
null
;
/// <summary>
/// Annotation keywords (first word of a comment line, lower-case, without the optional <c>@</c>
/// prefix) for which this handler's <see cref="HandleCommentLine"/> returns
/// <see cref="CommentLineResult.RequestsEndpoint"/> = true (e.g. <c>mcp</c>, <c>mcp_name</c>).
/// <para>
/// Used by endpoint sources that need a cheap, textual pre-check for exposure intent before the
/// comment parser runs — e.g. the SQL file source skips files with no HTTP tag, but a file whose
/// comment carries one of these keywords is an endpoint candidate (an MCP-only tool) and must
/// not be skipped. Default: empty (this handler never requests endpoints).
/// </para>
/// </summary>
string
[
]
EndpointRequestingAnnotations
=>
[
]
;
/// <summary>
/// After successful endpoint creation.
/// </summary>
void
Handle
(
RoutineEndpoint
endpoint
)
{
}
/// <summary>
/// After all endpoints are created.
/// </summary>
void
Cleanup
(
RoutineEndpoint
[
]
endpoints
)
{
}
/// <summary>
/// After all endpoints are created.
/// </summary>
void
Cleanup
(
)
{
}
}
/// <summary>
/// Result of <see cref="IEndpointCreateHandler.HandleCommentLine"/> when a plugin claims a comment
/// line. <c>Label</c> is a short description logged centrally by core (consistent with built-in
/// annotation logging). <c>RequestsEndpoint</c> = true signals the routine should be created as an
/// endpoint even without an HTTP tag (exposure intent); false = modifier only.
/// </summary>
public
readonly
record
struct
CommentLineResult
(
string
Label
,
bool
RequestsEndpoint
=
false
)
;
}
You can’t perform that action at this time.