dalgo2fs

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 9 Imported by: 0

README

dalgo2fs

Package dalgo2fs is a a DALgo adapter to OS file system.

Created mostly for testing and demonstration purposes but is used in DataTug.

  • Files and Directories are mapped to dal.Record of the Objects collection. Columns:
    • File.Name: string
    • File.Size: int
    • File.IsDir: bool
    • File.Modified: time.Time
  • Directory record can have child Objects collection

Content of the .json and .yaml files is parsed and extends columns of the Objects recordset.

If we have person1.json file with content:

File: 'jack.json'

{
  "FirstName": "Jack",
  "YearOfBirth": 1980
}

File: 'john.json'

{
  "FirstName": "John",
  "DateOfBirth": "1976-12-30"
}

The Objects recordset will have this columns and records:

Columns:
  - File.Name: string
  - File.IsDir: boolean
  - FirstName: string
  - YearOfBirth: int
  - DateOfBirth: time.Time
Records:
  - example.josn:
      File.Name: "example.josn"
      File.IsDir: false
      FirstName: "Jack"
      YearOfBirth: 1980
      DateOfBirth: null
  - example.josn:
      File.Name: "example.josn"
      File.IsDir: false
      FirstName: "John"
      YearOfBirth: 0
      DateOfBirth: { year: 1976, month: 12, day: 30 }

Documentation

Index

Constants

View Source
const (
	ColumnFileName     = "File.Name"
	ColumnIsDir        = "File.IsDir"
	ColumnFileSize     = "File.Size"
	ColumnFileExt      = "File.Ext"
	ColumnFileModified = "File.Modified"
)

Variables

This section is empty.

Functions

func NewDB

func NewDB(dirPath string) (db dal.DB, err error)

func NewDirReader

func NewDirReader(name string, columns ...recordset.Column[any]) (reader dal.RecordsetReader, err error)

func NewFileExtColumn

func NewFileExtColumn() recordset.Column[string]

func NewFileInfoColumns

func NewFileInfoColumns() []recordset.Column[any]

func NewFileModifiedColumn

func NewFileModifiedColumn() recordset.Column[time.Time]

func NewFileNameColumn

func NewFileNameColumn() recordset.Column[string]

func NewFileRecord

func NewFileRecord(key *dal.Key) dal.Record

func NewFileSizeColumn

func NewFileSizeColumn() recordset.Column[int64]

func NewIsDirColumn

func NewIsDirColumn() recordset.Column[bool]

Types

This section is empty.

Jump to

Keyboard shortcuts

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