isr

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

`isr` package is the syntactic sugar of insyra.

Index

Constants

This section is empty.

Variables

View Source
var DL = dl{}

Use `DL.From` to create a new DataList from a slice or multiple elements of any type.

View Source
var DT = dt{}

Use `DT.From` to create a new DataTable from a DataList, DL, Row, Col, []Row, []Col, CSV, JSON, map[string]any, or map[int]any.

Functions

func Name

func Name(value string) name

func PtrDL deprecated

func PtrDL[T *insyra.DataList | dl](l T) *dl

Deprecated: Use UseDL instead. PtrDL converts a DataList or DL to a *DL. You should no longer use this function, use UseDL instead.

func PtrDT deprecated

func PtrDT[T *insyra.DataTable | dt](t T) *dt

Deprecated: Use UseDT instead. PtrDT converts a DataTable or DT to a *DT. You should no longer use this function, use UseDT instead.

func UseDL added in v0.2.5

func UseDL[T *insyra.DataList | dl](l T) *dl

UseDL converts a DataList or DL to a *DL. It is the alias of PtrDL. Recommended to use this function instead of PtrDL.

func UseDT added in v0.2.5

func UseDT[T *insyra.DataTable | dt](t T) *dt

UseDT converts a DataTable or DT to a *DT. It is the alias of PtrDT. Recommended to use this function instead of PtrDT.

Types

type CSV

type CSV struct {
	FilePath   string
	String     string
	InputOpts  CSV_inOpts
	OutputOpts CSV_outOpts
}

type CSV_inOpts

type CSV_inOpts struct {
	FirstCol2RowNames bool
	FirstRow2ColNames bool
	Encoding          string // optional, default is "auto", only for FilePath input
}

type CSV_outOpts

type CSV_outOpts struct {
	RowNames2FirstCol bool
	ColNames2FirstRow bool
}

type Col

type Col map[any]any

DL is a type alias for map[any]any. It is used to represent a column in a DataTable. Every key in the map represents a row Index.

type Cols added in v0.2.4

type Cols = []Col

Cols is a type alias for []Col.

type DLs

type DLs = []insyra.IDataList

DLs is a type alias for []*DL. It is used to represent a list of DataList.

type Excel added in v0.2.10

type Excel struct {
	FilePath  string
	SheetName string
	InputOpts Excel_inOpts
}

Excel represents a sheet in an Excel file.

type Excel_inOpts added in v0.2.10

type Excel_inOpts struct {
	FirstCol2RowNames bool
	FirstRow2ColNames bool
}

type JSON added in v0.1.7

type JSON struct {
	// FilePath is the path to the JSON file.
	FilePath string

	// Bytes is the raw JSON data. Only used when FilePath is empty.
	Bytes []byte
}

type Row

type Row map[any]any

Row is a type alias for map[any]any. It is used to represent a row in a DataTable. Every key in the map represents a column Index or Number Index.

type Rows added in v0.2.4

type Rows = []Row

Rows is a type alias for []Row.

Jump to

Keyboard shortcuts

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