coltype

package
v0.0.0-...-79c606f Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package coltype provides the built-in ColumnTypes for Sif Schemas

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(colName string) sif.GenericColumnAccessor[bool]

Bool returns a GenericColumnAccessor for a FixedWidthColumnType which stores a boolean value

func Byte

func Byte(colName string) sif.GenericColumnAccessor[byte]

Byte returns a GenericColumnAccessor for a FixedWidthColumnType which stores a byte value

func Float32

func Float32(colName string) sif.GenericColumnAccessor[float32]

Float32 returns a GenericColumnAccessor for a FixedWidthColumnType which stores a float32value

func Float64

func Float64(colName string) sif.GenericColumnAccessor[float64]

Float64 returns a GenericColumnAccessor for a FixedWidthColumnType which stores a float64value

func Int16

func Int16(colName string) sif.GenericColumnAccessor[int16]

Int16 returns a GenericColumnAccessor for a FixedWidthColumnType which stores an int16 value

func Int32

func Int32(colName string) sif.GenericColumnAccessor[int32]

Int32 returns a GenericColumnAccessor for a FixedWidthColumnType which stores an int32 value

func Int64

func Int64(colName string) sif.GenericColumnAccessor[int64]

Int64 returns a GenericColumnAccessor for a FixedWidthColumnType which stores an int64 value

func Int8

func Int8(colName string) sif.GenericColumnAccessor[int8]

Int8 returns a GenericColumnAccessor for a FixedWidthColumnType which stores an int8 value

func List

func List[T any](colName string, itemType sif.GenericColumnAccessor[T], length int) sif.GenericColumnAccessor[[]T]

List returns a GenericColumnAccessor for a FixedWidthColumnType which stores a fixed number of fixed-width type items

func String

func String(colName string, length int) sif.GenericColumnAccessor[string]

String returns a GenericColumnAccessor for a FixedWidthColumnType which stores a string value

func Time

func Time(args ...string) sif.GenericColumnAccessor[time.Time]

Time returns a GenericColumnAccessor for a FixedWidthColumnType which stores a time.Time value The first argument should be the name of the column (required), the second is an optional format Because of https://github.com/golang/go/issues/15716, Times stored and retrieved may fail equality tests, despite passing UnixNano() equality tests.

func Uint16

func Uint16(colName string) sif.GenericColumnAccessor[uint16]

Uint16 returns a GenericColumnAccessor for a FixedWidthColumnType which stores a uint16 value

func Uint32

func Uint32(colName string) sif.GenericColumnAccessor[uint32]

Uint32 returns a GenericColumnAccessor for a FixedWidthColumnType which stores a uint32 value

func Uint64

func Uint64(colName string) sif.GenericColumnAccessor[uint64]

Uint64 returns a GenericColumnAccessor for a FixedWidthColumnType which stores a uint64 value

func Uint8

func Uint8(colName string) sif.GenericColumnAccessor[uint8]

Uint8 returns a GenericColumnAccessor for a FixedWidthColumnType which stores a uint8 value

func VarList

func VarList[T any](colName string, itemType sif.GenericColumnAccessor[T]) sif.GenericColumnAccessor[[]T]

VarList returns a GenericColumnAccessor for a ColumnType which stores a variable number of variable (or fixed)-width type items

func VarMap

func VarMap[T comparable, U any](colName string, itemType sif.GenericColumnAccessor[U]) sif.GenericColumnAccessor[map[T]U]

VarMap returns a GenericColumnAccessor for a ColumnType which stores a map of variable (or fixed)-width type values and generic keys

func VarString

func VarString(colName string) sif.GenericColumnAccessor[string]

VarString returns a GenericColumnAccessor for a ColumnType which stores a variable-length string value

Types

type ListColumnType

type ListColumnType[T any] interface {
	sif.ColumnType
	GetLength() int
	GetItemType() sif.GenericFixedWidthColumnType[T]
}

ListColumnType provides access to the Length and ItemType set for a GenericColumnType[T]

type StringColumnType

type StringColumnType interface {
	sif.ColumnType
	GetLength() int
}

StringColumnType provides access to the Length set for a GenericColumnType[string]

type TimeColumnType

type TimeColumnType interface {
	sif.ColumnType
	GetFormat() string // Returns the time format (or nil) which should be used by a DataSource to parse time strings into this column
}

TimeColumnType provides access to the Format set for a GenericColumnType[time.Time]

Jump to

Keyboard shortcuts

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