parser

package
v0.0.0-...-332fa53 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModulePath

func ModulePath(b []byte) []byte

ModulePath returns the module declaration of a go.mod file "b" contents.

func Package

func Package(b []byte) []byte

Package returns the package declaration (without "package") of "b" source-code contents.

func TryFindPackage

func TryFindPackage(dir string) (pkg []byte)

TryFindPackage returns a go package based on the dir, it reads the package declaration of the `main.go` or any `*go`

Types

type AssetDir

type AssetDir struct {
	Dir             string
	ShouldGenerated bool
}

AssetDir represents the parsed asset directories that are handled by Iris.

type Result

type Result struct {
	AssetDirs []*AssetDir
	Commands  []*SourceCommand
}

Result is the `Parse` return value.

func Parse

func Parse(src interface{}) (*Result, error)

Parse accepts a source and returns a `Result`. Source "src" can be a filepath, directory or Go source code contents.

type SourceCommand

type SourceCommand struct {
	Dir  string   // working dir, the filename dir.
	Name string   // the command to run.
	Args []string // any command's arguments.
}

Jump to

Keyboard shortcuts

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