Documentation ¶
Index ¶
- func GetAllSelectors(doc *goquery.Document) ([]string, error)
- func GetMinifiedDoc(url string, disallowedTags []string) (doc *goquery.Document, err error)
- func GetSelectors(ctx context.Context, db *data.Database[master.Queries], url string, ...) (selectors []master.Selector, err error)
- func IsValidFileName(fileName string) error
- func IsValidPackageName(packageName string) error
- func IsValidURL(uri string) error
- type Dimensions
- type GoField
- type GoFile
- type GoImport
- type GoInterface
- type GoMethod
- type GoStruct
- type GoStructMethod
- type GoTag
- type GoType
- type PackImporter
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllSelectors ¶
GetAllSelectors retrieves all selectors from the given HTML document.
func GetMinifiedDoc ¶
GetMinifiedDoc gets a minified goquery doc from a given url and returns goquery doc and error if there is an error while getting the doc.
func GetSelectors ¶
func GetSelectors( ctx context.Context, db *data.Database[master.Queries], url string, ignores []string, mustOccur int, ) (selectors []master.Selector, err error)
GetSelectors gets all the selectors from the given URL and appends them to the selectors slice.
func IsValidFileName ¶
func IsValidPackageName ¶
Types ¶
type GoFile ¶
type GoFile struct { Package string Path string GlobalConstants []*GoType GlobalVariables []*GoType Structs []*GoStruct Interfaces []*GoInterface Imports []*GoImport StructMethods []*GoStructMethod }
GoFile is a struct for a go file
https://golang.org/pkg/go/ast/#File
func ParseDir ¶
func ParseDir( path string, withComments bool, filterFiles func(fs.FileInfo) bool, ) ([]*GoFile, error)
ParseFiles parses files at the same time
func ParseSingleFile ¶
ParseSingleFile parses a single file at the same time
func ParseSource ¶
ParseSource parses the source of a given golang file.
type GoInterface ¶
GoInterface is a struct for an interface within a file
type GoMethod ¶
GoMethod is a struct for a method within a file https://golang.org/pkg/go/ast/#FuncDecl
type GoStruct ¶
type GoStruct struct { File *GoFile StartRow int EndRow int Name string Comments string Fields []*GoField SeltablURL string SeltablOccurances int SeltablIgnores []string }
GoStruct is a struct for a struct within a file.
type GoStructMethod ¶
GoStructMethod is a struct for a struct method within a file.
type PackImporter ¶
PackImporter is a struct for a package importer
type State ¶
type State int
State represents the state of a position within a struct.
const ( // StateInTag is the state for when the position is within a struct tag. StateInTag State = iota // StateInTagValue is the state for when the position is within a struct tag value. StateInTagValue // StateAfterColon is the state for when the position is after a colon. StateAfterColon // StateOnURL is the state for when the position is on a url. StateOnURL // StateInvalid is the state for when the position is invalid or not within a struct. StateInvalid )
func ParsePosState ¶
ParsePosState parses the state of a position within a struct.