directive

package
v0.0.0-...-5b643b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package directive parses directive comments from ast or dst.

Index

Constants

View Source
const (
	DirectiveCommentIgnore    = "ignore"
	DirectiveCommentGenerated = "generated"
)
View Source
const (
	DirectivePrefix = "codegen:"
)

Variables

This section is empty.

Functions

func EnumerateCommentGroup

func EnumerateCommentGroup(comments *ast.CommentGroup) iter.Seq[string]

func ExcludeIgnoredGenDecl

func ExcludeIgnoredGenDecl(genDecl *ast.GenDecl) (bool, error)

func ExcludeIgnoredTypeSpec

func ExcludeIgnoredTypeSpec(ts *ast.TypeSpec, _ types.Object) (bool, error)

func ParseFieldDirectiveCommentDst

func ParseFieldDirectiveCommentDst[T any](
	prefix string,
	comments dst.FieldDecorations,
	parser func(s []string) (T, error),
) (T, bool, error)

Types

type Direction

type Direction struct {
	// contains filtered or unexported fields
}

func ParseDirectiveComment

func ParseDirectiveComment(comments *ast.CommentGroup) (Direction, bool, error)

func ParseDirectiveCommentDst

func ParseDirectiveCommentDst(comments dst.NodeDecs) (Direction, bool, error)

func (Direction) IsGenerated

func (d Direction) IsGenerated() bool

func (Direction) MustIgnore

func (d Direction) MustIgnore() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL