Documentation
¶
Index ¶
- Variables
- func BoolToBytes(b bool) []byte
- func BooleanWriterNew(w io.Writer) func(bool) IO[Void]
- func BytesWriterNew(w io.Writer) func([]byte) IO[Void]
- func ConvertToNullable[T any](t *T) sql.Null[T]
- func FloatNumberWriterNew[T any](cfg FloatWriterConfig[T], w io.Writer) func(T) IO[Void]
- func IntegerWriterNew[T any](integer2long func(T) int64, w io.Writer) func(T) IO[Void]
- func NullBooleanWriterNew(w io.Writer) func(sql.Null[bool]) IO[Void]
- func NullBytesWriterNew(w io.Writer) func(sql.Null[[]byte]) IO[Void]
- func NullFloatNumberWriterNew[T any](cfg FloatWriterConfig[T], w io.Writer) func(sql.Null[T]) IO[Void]
- func NullIntegerWriterNew[T any](integer2long func(T) int64, w io.Writer) func(sql.Null[T]) IO[Void]
- func NullStringWriterNew(w io.Writer) func(sql.Null[string]) IO[Void]
- func NullTimeWriterNew(w io.Writer) func(sql.Null[time.Time]) IO[Void]
- func NullUuidWriterNew(w io.Writer) func(sql.Null[uuid.UUID]) IO[Void]
- func NullWriterNew(w io.Writer) func(struct{}) IO[Void]
- func StringWriterNew(w io.Writer) func(string) IO[Void]
- func TimeWriterNew(w io.Writer) func(time.Time) IO[Void]
- func UuidWriterNew(w io.Writer) func(uuid.UUID) IO[Void]
- type AnyToValue
- type FloatWriterConfig
- type NullableWriter
- type PrimitiveWriter
- type Value
- func AnyToVal(a any) Value
- func BooleanToValue(p bool) Value
- func BytesToValue(p []byte) Value
- func DoubleToValue(p float64) Value
- func FloatToValue(p float32) Value
- func IntToValue(p int32) Value
- func InvalidValueFromErr(err error) Value
- func LongToValue(p int64) Value
- func NullToValue(p struct{}) Value
- func NullableBooleanToValue(p sql.Null[bool]) Value
- func NullableBytesToValue(p sql.Null[[]byte]) Value
- func NullableDoubleToValue(p sql.Null[float64]) Value
- func NullableFloatToValue(p sql.Null[float32]) Value
- func NullableIntToValue(p sql.Null[int32]) Value
- func NullableLongToValue(p sql.Null[int64]) Value
- func NullableStringToValue(p sql.Null[string]) Value
- func NullableTimeToValue(p sql.Null[time.Time]) Value
- func NullableUuidToValue(p sql.Null[uuid.UUID]) Value
- func StringToValue(p string) Value
- func TimeToValue(p time.Time) Value
- func UuidToValue(p uuid.UUID) Value
- type ValueWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var BoolFalse []byte = []byte("false")
View Source
var BoolTrue []byte = []byte("true")
View Source
var DoubleWriterNewDefault func( io.Writer, ) func(float64) IO[Void] = Curry[FloatWriterConfig[float64]]( FloatNumberWriterNew, )( FloatWriterConfig[float64]{ Format: 'g', Precision: -1, BitSize: 64, ToDouble: func(f float64) float64 { return f }, }, )
View Source
var (
ErrInvalidValue error = errors.New("invalid value")
)
View Source
var (
ErrUnimplementedWriter error = errors.New("unimplemented writer")
)
View Source
var FloatWriterNewDefault func( io.Writer, ) func(float32) IO[Void] = Curry[FloatWriterConfig[float32]]( FloatNumberWriterNew, )( FloatWriterConfig[float32]{ Format: 'g', Precision: -1, BitSize: 32, ToDouble: func(f float32) float64 { return float64(f) }, }, )
View Source
var IntWriterNew func( io.Writer, ) func(int32) IO[Void] = Curry[func(int32) int64](IntegerWriterNew)( func(i int32) int64 { return int64(i) }, )
View Source
var InvalidWtrRes IO[Void] = Err[Void](ErrUnimplementedWriter)
View Source
var LongWriterNew func( io.Writer, ) func(int64) IO[Void] = Curry[func(int64) int64](IntegerWriterNew)( func(i int64) int64 { return i }, )
View Source
var NullDoubleWriterNewDefault func( io.Writer, ) func(sql.Null[float64]) IO[Void] = Curry[FloatWriterConfig[float64]]( NullFloatNumberWriterNew, )( FloatWriterConfig[float64]{ Format: 'g', Precision: -1, BitSize: 64, ToDouble: func(f float64) float64 { return f }, }, )
View Source
var NullFloatWriterNewDefault func( io.Writer, ) func(sql.Null[float32]) IO[Void] = Curry[FloatWriterConfig[float32]]( NullFloatNumberWriterNew, )( FloatWriterConfig[float32]{ Format: 'g', Precision: -1, BitSize: 32, ToDouble: func(f float32) float64 { return float64(f) }, }, )
Functions ¶
func BoolToBytes ¶
func BooleanWriterNew ¶
func BytesWriterNew ¶
func ConvertToNullable ¶
func FloatNumberWriterNew ¶
func FloatNumberWriterNew[T any]( cfg FloatWriterConfig[T], w io.Writer, ) func(T) IO[Void]
func IntegerWriterNew ¶
func NullIntegerWriterNew ¶
func NullWriterNew ¶
func StringWriterNew ¶
Types ¶
type AnyToValue ¶
type FloatWriterConfig ¶
type NullableWriter ¶
type NullableWriter struct { StringWriter func(sql.Null[string]) IO[Void] BytesWriter func(sql.Null[[]byte]) IO[Void] IntWriter func(sql.Null[int32]) IO[Void] LongWriter func(sql.Null[int64]) IO[Void] FloatWriter func(sql.Null[float32]) IO[Void] DoubleWriter func(sql.Null[float64]) IO[Void] BooleanWriter func(sql.Null[bool]) IO[Void] TimeWriter func(sql.Null[time.Time]) IO[Void] UuidWriter func(sql.Null[uuid.UUID]) IO[Void] }
var NullableWriterDefault NullableWriter = NullableWriter{ StringWriter: func(_ sql.Null[string]) IO[Void] { return InvalidWtrRes }, BytesWriter: func(_ sql.Null[[]byte]) IO[Void] { return InvalidWtrRes }, IntWriter: func(_ sql.Null[int32]) IO[Void] { return InvalidWtrRes }, LongWriter: func(_ sql.Null[int64]) IO[Void] { return InvalidWtrRes }, FloatWriter: func(_ sql.Null[float32]) IO[Void] { return InvalidWtrRes }, DoubleWriter: func(_ sql.Null[float64]) IO[Void] { return InvalidWtrRes }, BooleanWriter: func(_ sql.Null[bool]) IO[Void] { return InvalidWtrRes }, TimeWriter: func(_ sql.Null[time.Time]) IO[Void] { return InvalidWtrRes }, UuidWriter: func(_ sql.Null[uuid.UUID]) IO[Void] { return InvalidWtrRes }, }
func NullableWriterNew ¶
func NullableWriterNew(w io.Writer) NullableWriter
type PrimitiveWriter ¶
type PrimitiveWriter struct { StringWriter func(string) IO[Void] BytesWriter func([]byte) IO[Void] IntWriter func(int32) IO[Void] LongWriter func(int64) IO[Void] FloatWriter func(float32) IO[Void] DoubleWriter func(float64) IO[Void] BooleanWriter func(bool) IO[Void] NullWriter func(struct{}) IO[Void] TimeWriter func(time.Time) IO[Void] UuidWriter func(uuid.UUID) IO[Void] }
var PrimitiveWriterDefault PrimitiveWriter = PrimitiveWriter{ StringWriter: func(_ string) IO[Void] { return InvalidWtrRes }, BytesWriter: func(_ []byte) IO[Void] { return InvalidWtrRes }, IntWriter: func(_ int32) IO[Void] { return InvalidWtrRes }, LongWriter: func(_ int64) IO[Void] { return InvalidWtrRes }, FloatWriter: func(_ float32) IO[Void] { return InvalidWtrRes }, DoubleWriter: func(_ float64) IO[Void] { return InvalidWtrRes }, BooleanWriter: func(_ bool) IO[Void] { return InvalidWtrRes }, NullWriter: func(_ struct{}) IO[Void] { return InvalidWtrRes }, TimeWriter: func(_ time.Time) IO[Void] { return InvalidWtrRes }, UuidWriter: func(_ uuid.UUID) IO[Void] { return InvalidWtrRes }, }
func PrimitiveWriterNew ¶
func PrimitiveWriterNew(w io.Writer) PrimitiveWriter
type Value ¶
type Value func(ValueWriter) IO[Void]
func BooleanToValue ¶
func BytesToValue ¶
func DoubleToValue ¶
func FloatToValue ¶
func IntToValue ¶
func InvalidValueFromErr ¶
func LongToValue ¶
func NullToValue ¶
func NullToValue(p struct{}) Value
func StringToValue ¶
func TimeToValue ¶
func UuidToValue ¶
type ValueWriter ¶
type ValueWriter struct { PrimitiveWriter NullableWriter }
var ValueWriterDefault ValueWriter = ValueWriter{ PrimitiveWriter: PrimitiveWriterDefault, NullableWriter: NullableWriterDefault, }
func ValueWriterNew ¶
func ValueWriterNew(w io.Writer) ValueWriter
Source Files
¶
Click to show internal directories.
Click to hide internal directories.