internal

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GenerateGoConfigTemplate = `` /* 1856-byte string literal not displayed */

	GenerateGoDefineTemplate = `` /* 149-byte string literal not displayed */

)

Variables

View Source
var (
	ErrReadConfigFailedIgnore                     = errors.New("read config skip ignore")
	ErrReadConfigFailedSame                       = errors.New("read config skip, same name")
	ErrReadConfigFailedWithDisplayName            = errors.New("read config display name failed, can not found position")
	ErrReadConfigFailedWithName                   = errors.New("read config name failed, can not found position")
	ErrReadConfigFailedWithIndexCount             = errors.New("read config index count failed, can not found position")
	ErrReadConfigFailedWithIndexCountLessThanZero = errors.New("read config index count failed, value less than zero")
	ErrReadConfigFailedWithFieldPosition          = errors.New("read config index count failed, field position exception")
	ErrReadConfigFailedWithNameDuplicate          = errors.New("read config index count failed, duplicate field names")
	ErrReadConfigFailedWithExportParamException   = errors.New("read config index count failed, export param must is s or c or sc or cs")
	ErrReadConfigFailedWithIndexTypeException     = errors.New("read config index count failed, the index type is only allowed to be the basic type")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Exist       map[string]bool
	Prefix      string
	DisplayName string
	Name        string
	Describe    string
	ExportParam string
	IndexCount  int
	Fields      []*Field
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(sheet *xlsx.Sheet, exist map[string]bool) (*Config, error)

NewConfig 定位为空将读取Sheet名称

  • 表格中需要严格遵守 描述、名称、类型、导出参数、数据列的顺序

func (*Config) GetVariable

func (slf *Config) GetVariable() string

func (*Config) GetVariableGen

func (slf *Config) GetVariableGen() string

func (*Config) JsonClient

func (slf *Config) JsonClient() []byte

func (*Config) JsonServer

func (slf *Config) JsonServer() []byte

func (*Config) String

func (slf *Config) String() string

type Field

type Field struct {
	Name        string
	Type        string
	SourceType  string
	TypeNotStar string
	Fields      []*Field
	SliceField  *Field
	ExportParam string
	Server      bool
	Describe    string
	Ignore      bool
}

func NewField

func NewField(configName, fieldName, fieldType string) *Field

func (*Field) String

func (slf *Field) String() string

func (*Field) Struct

func (slf *Field) Struct() string

type Position

type Position struct {
	X int
	Y int
}

func NewPosition

func NewPosition(x, y int) *Position

Jump to

Keyboard shortcuts

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