Versions in this module Expand all Collapse all v1 v1.37.0 May 10, 2024 v1.35.3 Apr 12, 2024 Changes in this version + func Validate(errs *perr.List, d *Directive, spec ValidateSpec) (ok bool) + type Directive struct + AST *ast.CommentGroup + Fields []Field + Name string + Options []Field + Tags []Field + func Parse(errs *perr.List, cg *ast.CommentGroup) (dir *Directive, doc string, ok bool) + func (d Directive) End() token.Pos + func (d Directive) Get(name string) string + func (d Directive) GetList(name string) []string + func (d Directive) HasOption(name string) bool + func (d Directive) Pos() token.Pos + func (d Directive) String() string + type Field struct + Key string + Value string + func (f Field) End() token.Pos + func (f Field) Equal(other Field) bool + func (f Field) List() []string + func (f Field) Pos() token.Pos + type ValidateSpec struct + AllowedFields []string + AllowedOptions []string + ValidateField func(*perr.List, Field) (ok bool) + ValidateOption func(*perr.List, Field) (ok bool) + ValidateTag func(*perr.List, Field) (ok bool)