fs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDB

func CopyDB(oldName, name, dir string) error

func CopyTable

func CopyTable(oldName, name, db, dir string) error

func DeleteDB

func DeleteDB(name, dir string) error

func DeleteTable

func DeleteTable(name, db, dir string) error

func DetermineDatatype

func DetermineDatatype(datatype string) (any, error)

func GetDBs

func GetDBs(dir string) ([]string, error)

func GetTables

func GetTables(db, dir string) ([]string, error)

func ModifyTable

func ModifyTable(data Table, name string, db string, dir string) error

func MoveDB

func MoveDB(oldName, name, dir string) error

func MoveTable

func MoveTable(oldName, name, db, dir string) error

func NewDB

func NewDB(name, dir string) error

func NewTable

func NewTable(name, db, dir string) error

Types

type Column

type Column struct {
	Name    string `json:"name"`
	Type    any    `json:"type"` // Any value of a specific datatype. reflect.TypeOf() to gt-get the type.
	Default any    `json:"default"`
}

type Conf

type Conf struct {
	// Basic config
	Port   string `json:"port"`
	Dir    string `json:"dir"`
	LogDir string `json:"log_dir"`
	// HTTPS config
	HTTPSMode bool   `json:"https"`
	SSLCert   string `json:"cert"`
	SSLKey    string `json:"key"`
	// Query config
	EnableGTSyntax  bool `json:"gt_syntax"`
	EnableSQLSyntax bool `json:"sql_syntax"`
}

func Config

func Config() (Conf, error)

type Table

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

func GetTable

func GetTable(name, db, dir string) (Table, error)

func Jtot

func Jtot(j TableJSON) (Table, error)

Jtot - JSON to Table

func (Table) GetColumns

func (t Table) GetColumns() []Column

func (Table) GetRows

func (t Table) GetRows() [][]interface{}

func (Table) SetColumns

func (t Table) SetColumns(columns []Column) Table

func (Table) SetRows

func (t Table) SetRows(rows [][]interface{}) (Table, error)

type TableJSON

type TableJSON struct {
	Columns []Column        `json:"columns"`
	Rows    [][]interface{} `json:"rows"`
}

func Ttoj

func Ttoj(t Table) TableJSON

Ttoj - Table to JSON

Jump to

Keyboard shortcuts

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