Documentation ¶
Index ¶
Constants ¶
View Source
const ( TYPE_PRIMITIVE = "primitive" TYPE_USER = "user" TYPE_WRAPPER = "wrapper" )
Variables ¶
View Source
var ALLOWED_PRIMITIVE_STRING = fmt.Sprintf("[%s]", getPrimitiveString())
View Source
var LIST_WRAPPER_REGEX = "^list<[a-zA-Z0-9<>,\\.]*>$"
View Source
var MAP_WRAPPER_REGEX = "^map<[a-zA-Z0-9<>,\\.]*\\,[a-zA-Z0-9<>,\\.]*>$"
View Source
var OPTIONAL_WRAPPER_REGEX = "^optional<[a-zA-Z0-9<>,\\.]*>$"
View Source
var PRIMITIVES = map[string]TypeInterface{ "string": makePrimitive("string", true), "byte": makePrimitive("byte", false), "binary": makePrimitive("[]byte", false), "short": makePrimitive("int16", false), "int": makePrimitive("int", false), "long": makePrimitive("int64", false), "float": makePrimitive("float32", false), "double": makePrimitive("float64", false), "boolean": makePrimitive("bool", false), "datetime": makeImportPrimitive("time", "Time", false), }
Functions ¶
func IsPrimitive ¶
Types ¶
type Import ¶
func GenerateParsedImport ¶
type ListWrapper ¶
type ListWrapper struct {
Type TypeInterface
}
type MapWrapper ¶
type MapWrapper struct { Type1 TypeInterface Type2 TypeInterface }
type OptionalWrapper ¶
type OptionalWrapper struct {
Type TypeInterface
}
type TypeInterface ¶
type TypeInterface interface { Write() *jen.Statement GetBaseType() BaseType GetWrappedType() string }
func GetPrimitive ¶
func GetPrimitive(prim string) TypeInterface
func GetWrapper ¶
func GetWrapper(typeStr string, imports map[string]Import) TypeInterface
type Wrapper ¶
type Wrapper struct { Types []TypeInterface WrapperType WrapperType }
func (Wrapper) GetBaseType ¶
func (Wrapper) GetWrappedType ¶
func (w Wrapper) GetWrappedType() WrapperType
func (Wrapper) IsAllPrimitive ¶
type WrapperType ¶
type WrapperType = string
const ( LIST_WRAPPER WrapperType = "LIST_WRAPPER" MAP_WRAPPER WrapperType = "MAP_WRAPPER" OPTIONAL_WRAPPER WrapperType = "OPTIONAL_WRAPPER" )
Click to show internal directories.
Click to hide internal directories.