internal

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CharCharacterTabulation     = 0x0009
	CharLineFeed                = 0x000A
	CharLineTabulation          = 0x000B
	CharFormFeed                = 0x000C
	CharCarriageReturn          = 0x000D
	CharSpace                   = 0x0020
	CharNextLine                = 0x0085
	CharNoBreakSpace            = 0x00A0
	CharOghamSpaceMark          = 0x1680
	CharEnQuad                  = 0x2000
	CharEmQuad                  = 0x2001
	CharEnSpace                 = 0x2002
	CharEmSpace                 = 0x2003
	CharThreePerEmSpace         = 0x2004
	CharFourPerEmSpace          = 0x2005
	CharSixPerEmSpace           = 0x2006
	CharFigureSpace             = 0x2007
	CharPunctuationSpace        = 0x2008
	CharThinSpace               = 0x2009
	CharHairSpace               = 0x200A
	CharLineSeparator           = 0x2028
	CharParagraphSeparator      = 0x2029
	CharNarrowNoBreakSpace      = 0x202F
	CharMediumMathematicalSpace = 0x205F
	CharIdeographicSpace        = 0x3000
)

Variables

This section is empty.

Functions

func DefaultIfEmpty added in v1.7.0

func DefaultIfEmpty(s, def string) string

func FormatBool added in v1.5.0

func FormatBool(v bool, format string) string

FormatBool returns the string representation of a bool in the requested format. Falls back to "True"/"False" if format not found.

func GetIndexOfSlice added in v1.5.0

func GetIndexOfSlice[T any](s []T, i int) (*T, error)

func IsFieldDelimiter added in v1.5.0

func IsFieldDelimiter(rn rune) bool

func IsLiteralEmptyString added in v1.5.0

func IsLiteralEmptyString(b []*byte) bool

func Map

func Map[T any, V any](s []T, fn func(e T, i int, a []T) V) []V

func ParseBool added in v1.5.0

func ParseBool(str, format string) (bool, error)

func ParseStructTagDateFormat added in v1.7.0

func ParseStructTagDateFormat(format string) string

func ParseWSVTag added in v1.7.0

func ParseWSVTag(f reflect.StructField) (key string, isComment bool, format string, literalEmptyField bool)

func Resolve added in v1.5.0

func Resolve(path string) (string, error)

func RuneToBytes added in v1.5.0

func RuneToBytes(rs []rune) []byte

func SerializeValue added in v1.5.0

func SerializeValue(v string) string

Seralizes non null values

- escaping whitespaces, double quoutes, and hyphens from the records value

- `""` for an empty string

func SerializeValues added in v1.5.0

func SerializeValues(s []string) []string

Maps the `SerializeValue()` function on non-null strings

- escaping whitespaces, double quoutes, and hyphens from the records value

- `""` for an empty string

func SplitEscaped added in v1.5.0

func SplitEscaped(s string) []string

SplitEscaped splits s by ',' unless the ',' is escaped with '\'

func SplitQuoted added in v1.5.0

func SplitQuoted(s string) []string

SplitQuoted splits s by [,] unless inside single quotes. Inside quotes, you can escape a single quote with [\']

func UnwrapStr added in v1.5.0

func UnwrapStr[t any](a t) string

Types

type Field added in v1.5.0

type Field struct {
	IsNull     bool
	Value      string
	FieldIndex int
	RowIndex   int
	FieldName  string
	IsHeader   bool
}

func (*Field) CalculateFieldLength added in v1.5.0

func (f *Field) CalculateFieldLength() int

Computes the rune length of the serialized value

func (*Field) SerializeText added in v1.5.0

func (f *Field) SerializeText() string

Serializes the values of the field

- escaping whitespaces, double quoutes, and hyphens from the records value

- returns the literal `-` character for null

- `""` for an empty string

type SortOption

type SortOption struct {
	// name of the field in the
	FieldName   string
	Desc        bool
	AsNumber    bool
	NumberRadix int
	AsTime      bool
	AsDuration  bool
	TimeFormat  string
}

Jump to

Keyboard shortcuts

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