golang

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeString    = Type{Name: "string", Null: &TypeSQLNullString}
	TypeByteSlice = Type{Name: "[]byte"}
	TypeFloat32   = Type{Name: "float32"}
	TypeFloat64   = Type{Name: "float64", Null: &TypeSQLNullFloat64}
	TypeBool      = Type{Name: "bool", Null: &TypeSQLNullBool}
	TypeInt       = Type{Name: "int", Null: &TypeSQLNullInt64}
	TypeInt16     = Type{Name: "int16", Null: &TypeSQLNullInt16}
	TypeInt64     = Type{Name: "int64", Null: &TypeSQLNullInt64}

	TypeTimeTime = Type{Name: "Time", PackageName: "time", PackagePath: "time", Null: &TypeSQLNullTime}

	TypeSQLNullInt64   = Type{Name: "NullInt64", PackageName: "sql", PackagePath: "database/sql"}
	TypeSQLNullInt16   = Type{Name: "NullInt16", PackageName: "sql", PackagePath: "database/sql"}
	TypeSQLNullFloat64 = Type{Name: "NullFloat64", PackageName: "sql", PackagePath: "database/sql"}
	TypeSQLNullBool    = Type{Name: "NullBool", PackageName: "sql", PackagePath: "database/sql"}
	TypeSQLNullString  = Type{Name: "NullString", PackageName: "sql", PackagePath: "database/sql"}
	TypeSQLNullTime    = Type{Name: "NullTime", PackageName: "sql", PackagePath: "database/sql"}
)
View Source
var ReservedNameReplaceMap = map[string]string{
	"type":      "typ",
	"interface": "interfac",
	"chan":      "ch",
	"else":      "els",
	"if":        "iff",
	"map":       "mmap",
	"for":       "ffor",
}

Functions

func Ptr

func Ptr(t string) string

Types

type File added in v0.3.0

type File struct {
	Name    string
	Package *Package
	Imports *ImportGroups
}

func NewFile added in v0.3.0

func NewFile(name string, pkg *Package) File

func (*File) CallRelativePath added in v0.3.0

func (f *File) CallRelativePath(that File, namePrefix string) string

func (*File) ImportLocal added in v0.3.0

func (f *File) ImportLocal(pkg *Package)

func (*File) ImportShared added in v0.3.0

func (f *File) ImportShared(pkg *Package)

func (*File) ImportStd added in v0.3.0

func (f *File) ImportStd(pkg *Package)

type ImportGroup added in v0.3.0

type ImportGroup struct {
	*gds.Set[string]
}

func (*ImportGroup) SortedList added in v0.3.0

func (g *ImportGroup) SortedList() []string

type ImportGroups added in v0.3.0

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

func NewImportGroups added in v0.3.0

func NewImportGroups() *ImportGroups

func (*ImportGroups) AddLocal added in v0.3.0

func (g *ImportGroups) AddLocal(pkg string)

func (*ImportGroups) AddShared added in v0.3.0

func (g *ImportGroups) AddShared(pkg string)

func (*ImportGroups) AddStd added in v0.3.0

func (g *ImportGroups) AddStd(pkg string)

func (*ImportGroups) Sorted added in v0.3.0

func (g *ImportGroups) Sorted() [][]string

func (*ImportGroups) Valid added in v0.3.0

func (g *ImportGroups) Valid() bool

type ModFile added in v0.3.0

type ModFile struct {
	Module string
}

type ModFinder added in v0.3.0

type ModFinder struct {
}

func NewModFinder added in v0.3.0

func NewModFinder() *ModFinder

func (*ModFinder) FindIn added in v0.3.0

func (f *ModFinder) FindIn(dir *fs.Directory) (*ModFile, error)

type Package added in v0.3.0

type Package struct {
	Name                string
	ProjectRelativePath string
	FullName            string
}

func BuildPackage added in v0.3.0

func BuildPackage(pkgName string, module string) (*Package, error)

func (*Package) CallToStruct added in v0.3.0

func (p *Package) CallToStruct(currentPackage *Package, structName string) string

func (*Package) IsCurrent added in v0.3.0

func (p *Package) IsCurrent(currentPackage *Package) bool

type StringEnum added in v0.3.0

type StringEnum struct {
	Name   *gds.String
	Values []*StringEnumValue
}

func NewStringEnumOfValues added in v0.3.0

func NewStringEnumOfValues(name *gds.String, values []string) *StringEnum

func (*StringEnum) AddNamedValue added in v0.3.0

func (e *StringEnum) AddNamedValue(name string, value string)

func (*StringEnum) AddValue added in v0.3.0

func (e *StringEnum) AddValue(values ...string)

type StringEnumValue added in v0.3.0

type StringEnumValue struct {
	Name  string
	Value string
}

type Type added in v0.4.0

type Type struct {
	Name        string
	PackageName string
	PackagePath string

	Null *Type
}

func (*Type) Call added in v0.4.0

func (t *Type) Call() string

Jump to

Keyboard shortcuts

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