general

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAnnotation

func GetAnnotation(c, name string) string

GetAnnotation extracts the annotation from comment text. It will return "foo" for comment "+kubebuilder:webhook:foo" .

func ParseDir

func ParseDir(dir string, parseFn func(string) error) error

ParseDir parses the Go files under given directory and parses the annotation by invoking the parseFn function on each comment group (multi-lines comments). TODO(droot): extend it to multiple dirs

func ParseFile

func ParseFile(fset *token.FileSet, filename string, src interface{}, parseFn func(string) error) error

ParseFile parses given filename or content src and parses annotations by invoking the parseFn function on each comment group (multi-lines comments).

func ParseKV

func ParseKV(s string) (key, value string, err error)

ParseKV parses key-value string formatted as "foo=bar" and returns key and value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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