utils

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 5 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OpenFile = openFile

OpenFile is like os.Open but might be able to open some locked files. The windows implementation sets FILE_SHARE_DELETE in addition.

Functions

func DetectFileType

func DetectFileType(filename string) (f *os.File, typ string, e error)

func Value added in v0.2.2

func Value[T any](row TableRow, columnName string) (T, error)

func ValueOrFallback added in v0.2.2

func ValueOrFallback[T any](row TableRow, columnName string, fallback T, tryConvert bool) (T, error)

func VisitTableRows

func VisitTableRows(db *sqlite3.DbFile, tableName string, columnNameMappings map[string]string, f func(rowID *int64, row TableRow) error) error

Types

type TableRow

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

func (TableRow) Bool

func (row TableRow) Bool(columnName string) (bool, error)

func (TableRow) BytesOrFallback

func (row TableRow) BytesOrFallback(columnName string, fallback []byte) ([]byte, error)

func (TableRow) BytesStringOrFallback

func (row TableRow) BytesStringOrFallback(columnName string, fallback []byte) ([]byte, error)

func (TableRow) Int64

func (row TableRow) Int64(columnName string) (int64, error)

func (TableRow) String

func (row TableRow) String(columnName string) (string, error)

func (TableRow) Value

func (row TableRow) Value(columnName string) (any, error)

func (TableRow) ValueOrFallback

func (row TableRow) ValueOrFallback(columnName string, fallback any) any

Jump to

Keyboard shortcuts

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