layouts

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JsonPack

func JsonPack(sheet *excels.Sheet, layoutData *LayoutData, tags string) (json []byte, err error)

JsonPack 打包json資料; 將會把excel中的資料, 依據資料布局與排除標籤, 轉換為json格式的位元陣列

Types

type Data

type Data struct {
	Name   string         // 欄位名稱
	Field  fields.Field   // 欄位類型
	Layers []layers.Layer // 階層列表
	Back   int            // 倒退數量
	Tag    string         // 標籤字串
}

Data 布局資料

type Enum

type Enum struct {
	Name    string // 列舉名稱
	Index   int    // 列舉編號
	Comment string // 列舉說明
}

Enum 列舉資料

type Field

type Field struct {
	Name  string       // 欄位名稱
	Note  string       // 欄位註解
	Field fields.Field // 欄位類型
	Alter string       // 欄位類型別名
	Array bool         // 陣列旗標
}

Field 欄位資料

type LayoutData

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

LayoutData 資料布局器

func NewLayoutData

func NewLayoutData() *LayoutData

NewLayoutData 建立資料布局器

func (*LayoutData) Add

func (this *LayoutData) Add(name string, field fields.Field, layer []layers.Layer, back int, tag string) error

Add 新增布局

func (*LayoutData) Pack

func (this *LayoutData) Pack(datas []string, tags string) (result map[string]interface{}, pkey int64, err error)

Pack 打包資料

func (*LayoutData) PkeyCount

func (this *LayoutData) PkeyCount() int

PkeyCount 主要索引數量

type LayoutDepend

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

LayoutDepend 依賴布局器

func NewLayoutDepend

func NewLayoutDepend() *LayoutDepend

NewLayoutDepend 建立依賴布局器

func (*LayoutDepend) Add

func (this *LayoutDepend) Add(layer []layers.Layer, back int) error

Add 新增依賴

func (*LayoutDepend) Begin

func (this *LayoutDepend) Begin(name string) error

Begin 開始類型紀錄

func (*LayoutDepend) Closure

func (this *LayoutDepend) Closure() bool

Closure 取得是否閉合

func (*LayoutDepend) Depends

func (this *LayoutDepend) Depends(name string) (result []string)

Depends 取得依賴列表

func (*LayoutDepend) End

func (this *LayoutDepend) End() error

End 結束類型紀錄

func (*LayoutDepend) Merge

func (this *LayoutDepend) Merge(merge *LayoutDepend) error

Merge 合併依賴布局器

type LayoutEnum

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

LayoutEnum 列舉布局器

func NewLayoutEnum

func NewLayoutEnum() *LayoutEnum

NewLayoutEnum 建立列舉布局器

func (*LayoutEnum) Add

func (this *LayoutEnum) Add(data []string) error

Add 新增列舉

func (*LayoutEnum) Enums

func (this *LayoutEnum) Enums() []*Enum

Enums 取得列舉列表

type LayoutType

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

LayoutType 類型布局器

func NewLayoutType

func NewLayoutType() *LayoutType

NewLayoutType 建立類型布局器

func (*LayoutType) Add

func (this *LayoutType) Add(name, note string, field fields.Field, layer []layers.Layer, back int) error

Add 新增欄位

func (*LayoutType) Begin

func (this *LayoutType) Begin(name, excel, sheet string) error

Begin 開始類型紀錄

func (*LayoutType) Closure

func (this *LayoutType) Closure() bool

Closure 取得是否閉合

func (*LayoutType) End

func (this *LayoutType) End() error

End 結束類型紀錄

func (*LayoutType) FieldNames

func (this *LayoutType) FieldNames(name string) (result []string)

FieldNames 取得類型欄位名稱列表

func (*LayoutType) Fields

func (this *LayoutType) Fields(name string) (result []*Field)

Fields 取得類型欄位列表

func (*LayoutType) Merge

func (this *LayoutType) Merge(merge *LayoutType) error

Merge 合併類型布局器

func (*LayoutType) Type

func (this *LayoutType) Type(name string) *Type

Type 取得類型資料

func (*LayoutType) TypeNames

func (this *LayoutType) TypeNames() (result []string)

TypeNames 取得類型名稱列表

type Type

type Type struct {
	Excel  string            // excel檔案名稱
	Sheet  string            // excel表格名稱
	Reader bool              // 是否要產生讀取器
	Fields map[string]*Field // 欄位列表
}

Type 類型資料

Jump to

Keyboard shortcuts

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