goentity

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entities

type Entities struct {
	Entities []*Entity
	Imports  *golang.ImportGroups
}

type EntitiesExporter

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

func NewEntitiesExporter

func NewEntitiesExporter(
	pager *common.Pager,
	entityMapper *EntityMapper,
	entityGenerator *EntityGenerator,
	goModFinder *golang.ModFinder,
) *EntitiesExporter

func (*EntitiesExporter) Export

func (*EntitiesExporter) ExportPerFile

func (e *EntitiesExporter) ExportPerFile(
	ctx context.Context,
	params *exporter.ExportParams,
) ([]*exporter.ExportedPage, error)

type Entity

type Entity struct {
	Name       *gds.String
	Table      *schema.Table
	Properties *goProperties
	Imports    *golang.ImportGroups
	Package    *golang.Package

	AsVarName string
}

func (*Entity) Call

func (e *Entity) Call(pkg *golang.Package) string

type EntityGenerator

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

func NewEntityGenerator

func NewEntityGenerator(pager *common.Pager) *EntityGenerator

func (*EntityGenerator) GenerateEntities

func (g *EntityGenerator) GenerateEntities(
	entities *Entities,
	pkg *golang.Package,
	enums map[string]*golang.StringEnum,
) (*exporter.ExportedPage, error)

func (*EntityGenerator) GenerateEntity

func (g *EntityGenerator) GenerateEntity(params *GenerateEntityParams) (*exporter.ExportedPage, error)

type EntityMapper

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

func NewEntityMapper

func NewEntityMapper(propertyMapper *GoPropertyMapper) *EntityMapper

func (*EntityMapper) MapEntities

func (m *EntityMapper) MapEntities(params *MapEntitiesParams) *Entities

func (*EntityMapper) MapEntity

func (m *EntityMapper) MapEntity(
	params *MapEntityParams,
) *Entity

type GenerateEntityParams

type GenerateEntityParams struct {
	Entity       *Entity
	Package      *golang.Package
	Repositories []*Repository
	WithMocks    bool
}

type GoProperty

type GoProperty struct {
	Name       *gds.String
	PluralName string
	Type       string

	Column *schema.Column
}

func (*GoProperty) IsString

func (p *GoProperty) IsString() bool

type GoPropertyMapper

type GoPropertyMapper struct {
}

func NewGoPropertyMapper

func NewGoPropertyMapper() *GoPropertyMapper

type MapEntitiesParams

type MapEntitiesParams struct {
	SourceDriver config.DatabaseDriver
	Tables       []*schema.Table
	Package      *golang.Package
	Enums        map[string]*golang.StringEnum
}

type MapEntityParams

type MapEntityParams struct {
	SourceDriver config.DatabaseDriver
	Table        *schema.Table
	Package      *golang.Package
	Enums        map[string]*golang.StringEnum
}

type Repository

type Repository struct {
	Name       string
	Interface  RepositoryInterface
	Entity     *Entity
	EntityCall string

	Filters struct {
		List   repositoryEntityFilter
		Get    repositoryEntityFilter
		Delete repositoryEntityFilter
	}
	Package *golang.Package

	File golang.File
}

type RepositoryExporter

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

func NewRepositoryExporter

func NewRepositoryExporter(
	pager *common.Pager,
	goModFinder *golang.ModFinder,
	entityMapper *EntityMapper,
	entityGenerator *EntityGenerator,
	propertyMapper *GoPropertyMapper,
) *RepositoryExporter

func (*RepositoryExporter) Export

func (*RepositoryExporter) ExportPerFile

func (e *RepositoryExporter) ExportPerFile(
	ctx context.Context,
	params *exporter.ExportParams,
) ([]*exporter.ExportedPage, error)

type RepositoryInterface

type RepositoryInterface struct {
	Name    string
	Package *golang.Package
}

func (*RepositoryInterface) Call

func (i *RepositoryInterface) Call(pkg *golang.Package) string

Jump to

Keyboard shortcuts

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