gen_resource

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gen

func Gen(config Config) error

生成协议

func QuoteChar

func QuoteChar() interface{}

Types

type Bundle

type Bundle struct {
	BundleType          string // file binary db
	BundleName          string
	BundleStructName    string
	CapBundleStructName string
	ResourceNameArr     []string
	ResourceArr         []*Resource
}

type BundleAnnotate

type BundleAnnotate struct {
	Format string
}

type Config

type Config struct {
	RespositoryVersion string
	Force              bool
}

type Field

type Field struct {
	Tag             int
	FieldName       string     // 字段名
	StructFieldName string     // 字段名
	Type            field_type // 字段类型
	GoTypeName      string
	Comment         string
}

字段结构

type Loader

type Loader struct {
	LoaderStructName  string
	LoaderName        string
	HandlerStructName string

	BundleArr []*Bundle
	// contains filtered or unexported fields
}

type Parser

type Parser interface {
	// contains filtered or unexported methods
}

type Resource

type Resource struct {
	ResourceName   string
	StructName     string
	TableName      string
	CapStructName  string
	WrapStructName string
	WrapTypeName   string
	YamlFileName   string
	ArrTypeName    string // ErrorCodeArr
	FilePath       string
	Type           resource_type
	KeyArr         []string

	// map类型
	MapTypeName            string // ErrorCodeMap
	GoMapTypeName          string // map[int] *ErrorCode
	MapKeyArr              []string
	ObjectKeyGoTypeNameArr []string

	// object类型
	ObjectTypeName      string
	GoObjectTypeName    string // map[int] *ErrorCode
	MapKeyGoTypeNameArr []string
	ObjectKeyArr        []string
	ObjectKeyIndex      int

	FieldDict map[string]*Field // 字段信息
	FieldArr  []*Field          // 字段信息
	ValueArr  [][]interface{}   // 字段值
}

func (*Resource) IsDeriveMap

func (self *Resource) IsDeriveMap() bool

func (*Resource) IsDeriveObject

func (self *Resource) IsDeriveObject() bool

func (*Resource) Key0

func (self *Resource) Key0() string

func (*Resource) KeyLen

func (self *Resource) KeyLen() int

type ResourceAnnotate

type ResourceAnnotate struct {
	Excel  string
	Map    []string
	Object []string
}

Jump to

Keyboard shortcuts

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