generator

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheHashGen

func CacheHashGen(dir string) (string, error)

func CacheHashRead

func CacheHashRead(dir string) (string, error)

func Generate

func Generate(cwd string) error

Generate parses all ".go" source files in the given working directory, based on the resulting abstract syntax tree it will output "makefile_generated.go" in the same directory, this contains a main function that executes a cobra cli application.

Types

type ErrMainPackageNotFound

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

ErrMainPackageNotFound is returned when a folder of ".go" source files have been provided that are not part of a "main" package. Or there simply are no source files. All direct children of a ".gomake" folder must be part of the "main" package.

func (*ErrMainPackageNotFound) Error

func (e *ErrMainPackageNotFound) Error() string

func (*ErrMainPackageNotFound) InnerError

func (e *ErrMainPackageNotFound) InnerError() error

type ErrParserFailed

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

ErrParserFailed is returned when the golang parser fails. This would usually be due to a syntax issue in your makefile ".go" source files. See the InnerError for cause.

func (*ErrParserFailed) Error

func (e *ErrParserFailed) Error() string

func (*ErrParserFailed) InnerError

func (e *ErrParserFailed) InnerError() error

type ErrUnsupportedFlagType

type ErrUnsupportedFlagType struct {
	OriginalTypeName string
	IsArray          bool
	MappedTypeName   string
	// contains filtered or unexported fields
}

ErrUnsupportedFlagType is returned when a makefile function has used a parameter type that this generator and / or cobra does not support.

func (*ErrUnsupportedFlagType) Error

func (e *ErrUnsupportedFlagType) Error() string

func (*ErrUnsupportedFlagType) InnerError

func (e *ErrUnsupportedFlagType) InnerError() error

type ErrVariadicMustBeString

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

ErrVariadicMustBeString is returned when a makefile function has used a variadic parameter that is not of type "string".

func (*ErrVariadicMustBeString) Error

func (e *ErrVariadicMustBeString) Error() string

func (*ErrVariadicMustBeString) InnerError

func (e *ErrVariadicMustBeString) InnerError() error

type ErrWritingMakefile

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

ErrWritingMakefile is returned when `writeGeneratedMakefile` fails. See InnerError for more details.

func (*ErrWritingMakefile) Error

func (e *ErrWritingMakefile) Error() string

func (*ErrWritingMakefile) InnerError

func (e *ErrWritingMakefile) InnerError() error

Jump to

Keyboard shortcuts

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