datasheet

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell added in v0.7.0

type Cell struct {
	Offset uint32
	Field2 []byte `yaml:",flow"`
}

type Column

type Column struct {
	Crc32      uint32
	Offset     uint32
	ColumnType uint32
}

type ColumnData added in v0.7.0

type ColumnData struct {
	Name       string
	ColumnType ColumnType
}

type ColumnType

type ColumnType int32
const (
	ColumnTypeString ColumnType = iota + 1
	ColumnTypeNumber
	ColumnTypeBoolean
)

type DataSheet

type DataSheet struct {
	Type     string
	UniqueId string
	Columns  []ColumnData
	Rows     [][]string
}

func Parse

func Parse(dataSheetFile *DataSheetFile) (*DataSheet, error)

func ParseBody added in v0.7.0

func ParseBody(r io.ReadSeeker, meta *Meta) (*DataSheet, error)

func (*DataSheet) GetCellValueByColumnName added in v0.10.0

func (dataSheet *DataSheet) GetCellValueByColumnName(row []string, columnName string) (string, error)

func (*DataSheet) GetColumnIndexes added in v0.3.3

func (dataSheet *DataSheet) GetColumnIndexes() map[string]int

type DataSheetFile

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

func FindAll

func FindAll(root string) ([]*DataSheetFile, error)

func NewDataSheet

func NewDataSheet(path string, relPath string) *DataSheetFile

func (*DataSheetFile) GetData added in v0.7.2

func (dataSheetFile *DataSheetFile) GetData() (*DataSheet, error)

func (*DataSheetFile) GetMeta added in v0.7.2

func (dataSheetFile *DataSheetFile) GetMeta() (*Meta, error)

func (DataSheetFile) GetPath

func (dataSheetFile DataSheetFile) GetPath() string

func (DataSheetFile) GetRelPath added in v0.7.2

func (dataSheetFile DataSheetFile) GetRelPath() string
type Header struct {
	Signature      []byte `yaml:",flow"`
	UniqueIdCrc32  uint32
	UniqueIdOffset uint32
	TypeCrc32      uint32
	TypeOffset     uint32
	Field6         []byte `yaml:",flow"`
	BodyLength     uint32
	Field8         []byte `yaml:"-"`
	Field9         []byte `yaml:"-"`
	Field10        []byte `yaml:"-"`
	Field11        []byte `yaml:"-"`
	Field12        []byte `yaml:"-"`
	Field13        []byte `yaml:"-"`
	Field14        []byte `yaml:"-"`
	BodyOffset     uint32
}

func ParseHeader added in v0.7.0

func ParseHeader(r io.Reader) (*Header, error)

type Meta added in v0.3.3

type Meta struct {
	Header        *Header
	Field2        []byte `yaml:",flow"`
	Field3        []byte `yaml:"-"`
	ColumnCount   uint32
	RowCount      uint32
	Field6        []byte `yaml:"-"`
	Field7        []byte `yaml:"-"`
	Field8        []byte `yaml:"-"`
	Field9        []byte `yaml:"-"`
	ColumnsIndex  []*Column
	RowsIndex     []*Row
	WorksheetName string
	UniqueId      string
	Type          string
}

func ParseMeta added in v0.3.3

func ParseMeta(r io.ReadSeeker) (*Meta, error)

type Row added in v0.7.0

type Row struct {
	Cells []*Cell
}

type Store added in v0.5.0

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

func NewStore added in v0.5.0

func NewStore(dataTableDir string) (*Store, error)

func (*Store) GetAll added in v0.7.2

func (store *Store) GetAll() []*DataSheetFile

func (*Store) GetByType added in v0.7.2

func (store *Store) GetByType(typ string) ([]*DataSheetFile, error)

func (*Store) GetByUniqueId added in v0.7.2

func (store *Store) GetByUniqueId(typ string, uniqueId string) (*DataSheetFile, error)

func (*Store) GetTypes added in v0.7.0

func (store *Store) GetTypes() ([]string, error)

Jump to

Keyboard shortcuts

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