extractor

package
v0.0.0-...-42c897b Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(url string) []byte

func GetBundleLoader

func GetBundleLoader(source fs.FS) (fs.FS, error)

func LoadParser

func LoadParser(gameVersion string)

func LoadSchema

func LoadSchema(gameVersion string)

func ParseDat

func ParseDat(data io.Reader, filename string) ([]interface{}, error)

Types

type Column

type Column struct {
	Until       interface{} `json:"until"`
	Name        *string     `json:"name"`
	Description *string     `json:"description"`
	References  *References `json:"references"`
	File        *string     `json:"file"`
	Type        Type        `json:"type"`
	Files       []File      `json:"files"`
	Array       bool        `json:"array"`
	Unique      bool        `json:"unique"`
	Localized   bool        `json:"localized"`
}

type Enumeration

type Enumeration struct {
	Name        string    `json:"name"`
	Enumerators []*string `json:"enumerators"`
	Indexing    int64     `json:"indexing"`
}

type File

type File string

type References

type References struct {
	Column *string `json:"column,omitempty"`
	Table  string  `json:"table"`
}

type SchemaFile

type SchemaFile struct {
	Tables       []Table       `json:"tables"`
	Enumerations []Enumeration `json:"enumerations"`
	Version      int64         `json:"version"`
	CreatedAt    int64         `json:"createdAt"`
}

type Table

type Table struct {
	Name    string   `json:"name"`
	Columns []Column `json:"columns"`
}

func GetSchema

func GetSchema(name string) Table

func (Table) ToJSONFormat

func (t Table) ToJSONFormat() dat.JsonFormat

type Type

type Type string
const (
	TypeArray      Type = "array"
	TypeBool       Type = "bool"
	TypeEnumRow    Type = "enumrow"
	TypeF32        Type = "f32"
	TypeForeignRow Type = "foreignrow"
	TypeI32        Type = "i32"
	TypeRow        Type = "row"
	TypeString     Type = "string"
)

type WebFS

type WebFS struct {
	BasePath string
}

func NewWebFS

func NewWebFS(gameVersion string) *WebFS

func (*WebFS) Open

func (w *WebFS) Open(name string) (fs.File, error)

type WebFile

type WebFile struct {
	BasePath   string
	Name       string
	CachedFile []byte
}

func (*WebFile) Close

func (w *WebFile) Close() error

func (*WebFile) Read

func (w *WebFile) Read(bytes []byte) (int, error)

func (*WebFile) ReadAt

func (w *WebFile) ReadAt(p []byte, off int64) (int, error)

func (*WebFile) Stat

func (w *WebFile) Stat() (fs.FileInfo, error)

Jump to

Keyboard shortcuts

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