Documentation
¶
Index ¶
Constants ¶
View Source
const ( TypeUnknown primitiveType = iota TypeInt TypeInt8 TypeInt16 TypeInt32 TypeInt64 TypeUint TypeUint8 TypeUint16 TypeUint32 TypeUint64 TypeFloat32 TypeFloat64 TypeStruct TypeMap TypeString TypeSlice TypeInterface TypeBool TypePointer )
Variables ¶
This section is empty.
Functions ¶
func DefaultValue ¶
func FindFiles ¶
GetFiles returns a list of files from the pkg of your choice. To be sure, just use an absolute path which can be retrieved from runtime:
package main
import (
"fmt"
"path/filepath"
"runtime"
"github.com/andersfylling/ggi"
)
var (
_, b, _, _ = runtime.Caller(0)
basepath = filepath.Dir(b)
genpath = "/generate/testing" // diff path; from root pkg to this files pkg
)
func main() {
path := basepath[:len(basepath)-len(genpath)]
files, err := astrix.FindFiles(path, regexp.MustCompile(".*\_gen\.go"))
if err != nil {
panic(err)
}
// TODO: make sure these prints the .go files in your desired directory
for _, f := range files {
fmt.Println(f.Name())
}
}
func ToCamelCase ¶
ToCamelCase takes typical CONST names such as T_AS and converts them to TAs. TEST_EIN_TRES => TestEinTres
Types ¶
type InterfaceInfo ¶
type TypeInfo ¶
type TypeInfo struct {
T *TypeInfo
PrimitiveType primitiveType
DefaultValueString string
Name string
Fields map[string]*FieldInfo
Exported bool
}
func GetTypes ¶
func GetTypes(path string, excludeFilesRegexp *regexp.Regexp, excludeTypesRegexp *regexp.Regexp) (types []*TypeInfo, err error)
GenerateTypes generates a list of types that can be reflected upon.
func GetTypesFromFile ¶
Click to show internal directories.
Click to hide internal directories.