Documentation
¶
Index ¶
- type AutoComment
- type Comment
- type CommentSource
- type CommentTracker
- func (c *CommentTracker) GetComment(fullName string) Comment
- func (c *CommentTracker) RegisterComment(source, namespace, name string, comment *ast.Comment) string
- func (c *CommentTracker) ResolveComment(source, namespace, kind, name string, comment *ast.Comment) Comment
- func (c *CommentTracker) SetTags(tags ...string)
- type SettableComment
- type SourceComments
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoComment ¶
type AutoComment struct {
Summary string `yaml:"summary,omitempty"`
Description string `yaml:"description,omitempty"`
}
func (*AutoComment) SetDescription ¶
func (c *AutoComment) SetDescription(s string)
func (*AutoComment) SetSummary ¶
func (c *AutoComment) SetSummary(s string)
func (*AutoComment) ToComment ¶
func (c *AutoComment) ToComment() *Comment
type CommentSource ¶
type CommentSource string
const ( CSUser CommentSource = "" CSSuggest CommentSource = "suggest" CSOpenAPI CommentSource = "openapi" CSBuiltIn CommentSource = "builtin" )
type CommentTracker ¶
type CommentTracker struct {
// contains filtered or unexported fields
}
func New ¶
func New(tags ...string) *CommentTracker
func (*CommentTracker) GetComment ¶
func (c *CommentTracker) GetComment(fullName string) Comment
func (*CommentTracker) RegisterComment ¶
func (c *CommentTracker) RegisterComment(source, namespace, name string, comment *ast.Comment) string
RegisterComment stores a comment under (namespace, name) for the given source. Empty comments are ignored; use ResolveComment when an empty registration should claim the slot.
func (*CommentTracker) ResolveComment ¶
func (c *CommentTracker) ResolveComment(source, namespace, kind, name string, comment *ast.Comment) Comment
ResolveComment atomically registers a comment under (namespace, kind, name) for the given source and returns the merged comment for that key. An empty (or nil) comment claims the source slot, so the result reflects this registration — not another entity's — regardless of render-job order.
func (*CommentTracker) SetTags ¶
func (c *CommentTracker) SetTags(tags ...string)
type SettableComment ¶
type SourceComments ¶
type SourceComments struct {
Comment `yaml:",inline"`
OpenAPI *AutoComment `yaml:"openapi,omitempty"`
Builtin *AutoComment `yaml:"builtin,omitempty"`
Suggest *AutoComment `yaml:"suggest,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.