consts

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrMsgSrcNotfound       = "source file is required"
	ErrMsgNoStructsFound    = "source file has no structs"
	ErrMsgNameNotFound      = "name is required"
	ErrMsgTypeNotFound      = "type not found for field"
	ErrMsgNotGoFile         = "source is not a valid go file"
	ErrMsgInvalidStruct     = "invalid struct type"
	ErrMsgInvalidConfigFile = "invalid config file"
)
View Source
const (
	PARAM_NAME = "BuilderGen"
	VERSION    = "v0.2.1"

	DEFAULT_BUILDER_SUFFIX = "_builder.go"

	BUILD_HEADER  = "// Code generated by " + PARAM_NAME + " " + VERSION
	BUILD_PACKAGE = "package"

	DEFAULT_TRIM = "\n\r\t "
)
View Source
const (
	KEYWORD_GO          = "go"
	KEYWORD_IF          = "if"
	KEYWORD_FOR         = "for"
	KEYWORD_MAP         = "map"
	KEYWORD_VAR         = "var"
	KEYWORD_CASE        = "case"
	KEYWORD_CHAN        = "chan"
	KEYWORD_ELSE        = "else"
	KEYWORD_FUNC        = "func"
	KEYWORD_GOTO        = "goto"
	KEYWORD_TYPE        = "type"
	KEYWORD_BREAK       = "break"
	KEYWORD_CONST       = "const"
	KEYWORD_DEFER       = "defer"
	KEYWORD_RANGE       = "range"
	KEYWORD_RETURN      = "return"
	KEYWORD_SELECT      = "select"
	KEYWORD_STRUCT      = "struct"
	KEYWORD_SWITCH      = "switch"
	KEYWORD_IMPORT      = "import"
	KEYWORD_DEFAULT     = "default"
	KEYWORD_PACKAGE     = "package"
	KEYWORD_CONTINUE    = "continue"
	KEYWORD_INTERFACE   = "interface"
	KEYWORD_FALLTHROUGH = "fallthrough"

	EMPTY_STR     = ""
	COMMENTS      = "//"
	COMMENT_START = "/*"
	COMMENT_END   = "*/"

	HASH_IDX_MOD = 73
)

Variables

View Source
var (
	ErrSrcNotFound       = errors.New(ErrMsgSrcNotfound)
	ErrNoStructsFound    = errors.New(ErrMsgNoStructsFound)
	ErrNameNotFound      = errors.New(ErrMsgNameNotFound)
	ErrTypeNotfound      = errors.New(ErrMsgTypeNotFound)
	ErrNotGoFile         = errors.New(ErrMsgNotGoFile)
	ErrInvalidStructType = errors.New(ErrMsgInvalidStruct)
	ErrSyntaxErr         = errors.New("syntax error")
	ErrPackageNotFound   = errors.New("package not found")
	ErrNotFound          = errors.New("target struct is not found")
	ErrDone              = errors.New("done")
	ErrInvalidConfigFile = errors.New(ErrMsgInvalidConfigFile)
	ErrInvalidParserMode = errors.New("invalid Parser Mode")

	ImportOptions = &imports.Options{
		FormatOnly: false,
		TabIndent:  true,
		Comments:   true,
	}
)
View Source
var (
	ALL_MODES = []Mode{
		MODE_FAST,
		MODE_AST,
	}
)

Functions

This section is empty.

Types

type Mode added in v0.2.1

type Mode string
const (
	MODE_AST  Mode = "DEFAULT"
	MODE_FAST Mode = "FAST"
)

Jump to

Keyboard shortcuts

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