generate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package generate implements code generation for repository types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRepository

func GenerateRepository(options Options) ([]byte, error)

Types

type FieldMapping

type FieldMapping struct {
	Field  string
	Column string
	Type   string
	Opts   FieldOptions
}

func (*FieldMapping) SQLType

func (f *FieldMapping) SQLType() string

type FieldOptions

type FieldOptions struct {
	ID bool
}

type Options

type Options struct {
	Filename    string
	EntityName  string
	TableName   string
	RepoPackage string
	RepoName    string
	ReadOnly    bool
}

type StructMapping

type StructMapping struct {
	Package string
	Name    string
	Fields  []FieldMapping
}

func (*StructMapping) ID

func (s *StructMapping) ID() *FieldMapping

Jump to

Keyboard shortcuts

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