 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- func SetCommandArgs(argsStr string)
- type Code
- type CodeFile
- type CodeStruct
- type CodeStructField
- type Codegen
- type CodegenConfig
- type CodegenGo
- type CodegenUE5
- type Config
- type Datasource
- type DatasourceCSV
- type DatasourceConfig
- type DatasourceExcel
- type DatasourceSpreadsheetGAS
- type FieldType
- type OutputConfig
- type StructMap
- type TableData
- type TableField
- type TableMetadata
- type TableMetadataQuery
- type TableParser
- type TableWriter
- type TableWriterBin
- type TableWriterJSON
- type When
Constants ¶
      View Source
      
  
const ( TableMetadataRow = 0 TableFieldTagRow = 1 TableFieldNameRow = 2 TableFieldTypeRow = 3 TableDataStartRow = 5 TableFieldIndexCol = 0 )
Variables ¶
      View Source
      
  
var ErrSkipTable = fmt.Errorf("skip table")
    Functions ¶
func SetCommandArgs ¶
func SetCommandArgs(argsStr string)
Types ¶
type Code ¶
func AnalyzeTableCode ¶
type CodeFile ¶
type CodeFile struct {
	IsTable          bool
	IsMap            bool
	Name             string
	Struct           *CodeStruct
	AnonymousStructs []*CodeStruct
	FileRefs         []*CodeFile
	FieldTypes       []FieldType
	IDField          *CodeStructField
	IDFieldType      FieldType // this will be set even if IDField is nil
}
    type CodeStruct ¶
type CodeStruct struct {
	Name   string
	Fields []*CodeStructField
}
    type CodeStructField ¶
type CodeStructField struct {
	Name      string
	Type      FieldType
	IsArray   bool
	StructRef *CodeStruct
}
    type CodegenConfig ¶
type CodegenConfig struct {
	When *When    `yaml:"when,omitempty"`
	Tags []string `yaml:"tags"`
	Go  *CodegenGo  `yaml:"go,omitempty"`
	UE5 *CodegenUE5 `yaml:"ue5,omitempty"`
	// contains filtered or unexported fields
}
    func (*CodegenConfig) Generate ¶
func (c *CodegenConfig) Generate(tableDatas []*TableData) error
func (*CodegenConfig) UnmarshalYAML ¶
func (c *CodegenConfig) UnmarshalYAML(node *yaml.Node) error
type CodegenGo ¶
type CodegenUE5 ¶
func (*CodegenUE5) Generate ¶
func (c *CodegenUE5) Generate(code *Code) error
type Config ¶
type Config struct {
	Datasources []DatasourceConfig `yaml:"datasources"`
	Outputs     []OutputConfig     `yaml:"outputs"`
	Codegens    []CodegenConfig    `yaml:"codegens"`
}
    func ParseConfig ¶
type Datasource ¶
type DatasourceCSV ¶
type DatasourceCSV struct {
	Patterns []string `yaml:"patterns"`
}
    func (*DatasourceCSV) Collect ¶
func (d *DatasourceCSV) Collect(out chan<- *TableData) error
type DatasourceConfig ¶
type DatasourceConfig struct {
	When *When `yaml:"when,omitempty"`
	SpreadsheetGAS *DatasourceSpreadsheetGAS `yaml:"spreadsheet_gas,omitempty"`
	Excel          *DatasourceExcel          `yaml:"excel,omitempty"`
	CSV            *DatasourceCSV            `yaml:"csv,omitempty"`
	// contains filtered or unexported fields
}
    func (*DatasourceConfig) Collect ¶
func (c *DatasourceConfig) Collect(out chan<- *TableData) error
func (*DatasourceConfig) UnmarshalYAML ¶
func (c *DatasourceConfig) UnmarshalYAML(node *yaml.Node) error
type DatasourceExcel ¶
type DatasourceExcel struct {
	Patterns     []string `yaml:"patterns"`
	DebugSaveDir *string  `yaml:"debug_save_dir,omitempty"`
}
    func (*DatasourceExcel) Collect ¶
func (d *DatasourceExcel) Collect(out chan<- *TableData) error
type DatasourceSpreadsheetGAS ¶
type DatasourceSpreadsheetGAS struct {
	URL                  string   `yaml:"url"`
	Password             string   `yaml:"password"`
	GoogleDriveFolderIDs []string `yaml:"google_drive_folder_ids"`
	SpreadsheetFileIDs   []string `yaml:"spreadsheet_file_ids"`
	DebugSaveDir         *string  `yaml:"debug_save_dir,omitempty"`
}
    func (*DatasourceSpreadsheetGAS) Collect ¶
func (d *DatasourceSpreadsheetGAS) Collect(out chan<- *TableData) error
type OutputConfig ¶
type OutputConfig struct {
	When *When    `yaml:"when,omitempty"`
	Tags []string `yaml:"tags"`
	JSON *TableWriterJSON `yaml:"json,omitempty"`
	Bin  *TableWriterBin  `yaml:"bin,omitempty"`
	// contains filtered or unexported fields
}
    func (*OutputConfig) UnmarshalYAML ¶
func (c *OutputConfig) UnmarshalYAML(node *yaml.Node) error
func (*OutputConfig) Write ¶
func (c *OutputConfig) Write(tableData *TableData) error
type StructMap ¶
StructMap - you can map a field id to a named struct
You can match the field id with a regex by enclosing it with / (e.g. /regex/), If the field is part of a named struct, you should omit the parent struct's name. ex. RewardWin.Weight,RewardWin.RewardPool.Reward.Type,RewardWin.RewardPool.Reward.Param struct=RewardWin:GameReward&struct=/RewardPool\.Reward$/:GameRewardPool
type TableData ¶
type TableField ¶
type TableField struct {
	Name             string
	Type             FieldType
	IsMultiLineArray bool
	IsCellArray      bool
	StructFields     []*TableField
	ParentField      *TableField
	// contains filtered or unexported fields
}
    func (*TableField) Clone ¶
func (f *TableField) Clone() *TableField
func (*TableField) GetMultiLineArrayField ¶
func (f *TableField) GetMultiLineArrayField() *TableField
func (*TableField) Identifier ¶
func (f *TableField) Identifier() string
func (*TableField) IsArray ¶
func (f *TableField) IsArray() bool
func (*TableField) Iterate ¶
func (f *TableField) Iterate(yield func(*TableField) bool)
func (*TableField) StructEqual ¶
func (f *TableField) StructEqual(other *TableField) bool
type TableMetadata ¶
type TableMetadata struct {
	AsMap      bool      `query:"as_map"`
	SortAscBy  string    `query:"sort_asc_by"`
	SortDescBy string    `query:"sort_desc_by"`
	Structs    StructMap `query:"struct"`
}
    func (*TableMetadata) Validate ¶
func (m *TableMetadata) Validate(td *TableData) error
type TableMetadataQuery ¶
type TableMetadataQuery string
func (TableMetadataQuery) Decode ¶
func (q TableMetadataQuery) Decode() (*TableMetadata, error)
type TableParser ¶
type TableParser struct {
	// contains filtered or unexported fields
}
    func NewTableParser ¶
func NewTableParser(td *TableData) *TableParser
func (*TableParser) Marshal ¶
func (p *TableParser) Marshal(fields []*TableField) (any, error)
func (*TableParser) ParseTableFields ¶
func (p *TableParser) ParseTableFields(tags []string) ([]*TableField, error)
type TableWriter ¶
type TableWriterBin ¶
type TableWriterBin struct {
	RootDir string `yaml:"root_dir"`
}
    type TableWriterJSON ¶
       Source Files
      ¶
      Source Files
      ¶
    
   Click to show internal directories. 
   Click to hide internal directories.