plugin

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TagString = "gen"

Functions

func MargeTags

func MargeTags(tags ...*FieldTag) string

func New

func New() *dao

Types

type Field

type Field struct {
	Name       string
	Type       fieldType
	Tags       []*FieldTag
	Alias      string
	Num        int
	IsRepeated bool
	Desc       *generator.FieldDescriptor
	Map        *MapFields
	Slice      *descriptor.FieldDescriptorProto
	File       *generator.FileDescriptor
}

type FieldTag

type FieldTag struct {
	Key    string
	Values []string
	Seq    string
}

func (*FieldTag) String

func (t *FieldTag) String() string

type MapFields

type MapFields struct {
	Key   *descriptor.FieldDescriptorProto
	Value *descriptor.FieldDescriptorProto
}

type Namer added in v1.5.4

type Namer interface {
	TableName(table string) string
	ColumnName(table, column string) string
}

Namer namer interface

type NamingStrategy added in v1.5.4

type NamingStrategy struct {
	TablePrefix   string
	SingularTable bool
	NameReplacer  Replacer
	NoLowerCase   bool
}

NamingStrategy tables, columns naming strategy

func (NamingStrategy) ColumnName added in v1.5.4

func (ns NamingStrategy) ColumnName(table, column string) string

ColumnName convert string to column name

func (NamingStrategy) TableName added in v1.5.4

func (ns NamingStrategy) TableName(str string) string

TableName convert string to table name

type Replacer added in v1.5.4

type Replacer interface {
	Replace(name string) string
}

Replacer replacer interface like strings.Replacer

type Storage added in v1.3.7

type Storage struct {
	Name     string
	PK       *Field
	DeleteAt *Field
	MFields  map[string]*Field
	Fields   []*Field
	SDField  *Field
	Desc     *generator.MessageDescriptor
	Table    string
	Deep     bool
	TypeMeta bool
}

type Tag

type Tag struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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