gotype

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbTOGoTypeTransformer

type DbTOGoTypeTransformer interface {
	ToGoType(col *plugin.Column) GoType
}

type GoType

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

func NewGoType

func NewGoType(fullTypeName string) *GoType

NewGoType creates a new GoType from a full type name e.g. plugin.Table -> GoType{typeName: "Table", packageName: "plugin"} e.g. *plugin.Table -> GoType{typeName: "Table", packageName: "plugin", isPointer: true} e.g. []plugin.Table -> GoType{typeName: "Table", packageName: "plugin", isArray: true, arrayDims: 1} e.g. github.com/sqlc-dev/plugin-sdk-go/plugin.Table -> GoType{typeName: "Table", packageName: "plugin", typeImport: Import{Path: "github.com/sqlc-dev/plugin-sdk-go/plugin"}}

func (*GoType) Import

func (g *GoType) Import() imports.Import

func (*GoType) IsArray

func (g *GoType) IsArray() bool

func (*GoType) IsPointer

func (g *GoType) IsPointer() bool

func (*GoType) PackageName

func (g *GoType) PackageName() string

func (*GoType) SetImport

func (g *GoType) SetImport(imp imports.Import) *GoType

func (*GoType) String

func (g *GoType) String() string

func (*GoType) TypeName

func (g *GoType) TypeName() string

func (*GoType) TypeWithPackage

func (g *GoType) TypeWithPackage() string

type GoTypeFormatter

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

func NewGoTypeFormatter

func NewGoTypeFormatter(
	typeTransformer DbTOGoTypeTransformer,
	options *opts.Options,
) *GoTypeFormatter

func (*GoTypeFormatter) ToGoType

func (f *GoTypeFormatter) ToGoType(col *plugin.Column) GoType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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