Documentation
¶
Index ¶
- Constants
- Variables
- func BytesFromBytesNew() func([]byte) (*ps.PgcopyBytes, error)
- func BytesToBoolNew() func([]byte) (*ps.PgcopyBool, error)
- func BytesToBoolNewN() func([]byte) (*ps.PgcopyBoolN, error)
- func BytesToDoubleNew() func([]byte) (*ps.PgcopyDouble, error)
- func BytesToDoubleNewN() func([]byte) (*ps.PgcopyDoubleN, error)
- func BytesToFloatNew() func([]byte) (*ps.PgcopyFloat, error)
- func BytesToFloatNewN() func([]byte) (*ps.PgcopyFloatN, error)
- func BytesToIntNew() func([]byte) (*ps.PgcopyInt, error)
- func BytesToIntNewN() func([]byte) (*ps.PgcopyIntN, error)
- func BytesToLongNew() func([]byte) (*ps.PgcopyLong, error)
- func BytesToLongNewN() func([]byte) (*ps.PgcopyLongN, error)
- func BytesToShortNew() func([]byte) (*ps.PgcopyShort, error)
- func BytesToShortNewN() func([]byte) (*ps.PgcopyShortN, error)
- func CheckStringUtf8(s string) error
- func ConfigToConverterBool(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func ConfigToConverterBoolN(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func ConfigToConverterDouble(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func ConfigToConverterDoubleN(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func ConfigToConverterFloat(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func ConfigToConverterFloatN(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func ConfigToConverterInt(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func ConfigToConverterIntN(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func ConfigToConverterLong(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func ConfigToConverterLongN(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func ConfigToConverterShort(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func ConfigToConverterShortN(_ ConvertConfig) func([]byte) util.IO[ps.Value]
- func NullBytesFromBytesNew() func([]byte) (*ps.PgcopyBytesN, error)
- func NullStringFromBytesNew(checker func(string) error) func([]byte) (*ps.PgcopyStringN, error)
- func NullStringFromBytesNewDefault() func([]byte) (*ps.PgcopyStringN, error)
- func StringFromBytesNew(checker func(string) error) func([]byte) (*ps.PgcopyString, error)
- func StringFromBytesNewDefault() func([]byte) (*ps.PgcopyString, error)
- func TimeFromBytesNew() func([]byte) (*ps.PgcopyTime, error)
- func TimeFromBytesNewN() func([]byte) (*ps.PgcopyTimeN, error)
- func TypeToConverter(typ ps.ColumnType, cfg ConvertConfig) func([]byte) util.IO[ps.Value]
- func UuidFromBytesNew() func([]byte) (*ps.PgcopyUuid, error)
- func UuidFromBytesNewN() func([]byte) (*ps.PgcopyUuidN, error)
- type CfgToConv
- type ConvertConfig
- type ConverterIx
- type IndexedTypeInfo
- type Input
- type PgcopyBytesBool
- type PgcopyBytesDouble
- type PgcopyBytesFloat
- type PgcopyBytesInt
- type PgcopyBytesLong
- type PgcopyBytesShort
- type TypeInfo
- func TypeInfoFromEnvVar(ctx context.Context, getenv func(string) util.IO[string], keysKey string) TypeInfo
- func TypeInfoFromEnvVarAndKeys(ctx context.Context, getenv func(string) util.IO[string], keys []string) TypeInfo
- func TypeInfoFromEnvVarDefault(ctx context.Context, getenv func(string) util.IO[string]) TypeInfo
- func TypeInfoFromIndexIter(i iter.Seq[IndexedTypeInfo]) TypeInfo
- func TypeInfoFromIter(i iter.Seq2[int16, ps.ColumnType]) TypeInfo
- func TypeInfoFromJsonIter(i iter.Seq[string]) TypeInfo
- func TypeInfoFromJsonReadable(rdr io.Reader) TypeInfo
Constants ¶
View Source
const (
KeysKeyDefault string = "ENV_KEYS_KEY"
)
Variables ¶
View Source
var ( ErrUnsupportedType error = errors.New("unsupported type") ErrConverterNotFound error = errors.New("converter missing") )
View Source
var (
ErrInvalidUtf8 error = errors.New("invalid utf8")
)
Functions ¶
func BytesFromBytesNew ¶
func BytesFromBytesNew() func([]byte) (*ps.PgcopyBytes, error)
func BytesToBoolNew ¶
func BytesToBoolNew() func([]byte) (*ps.PgcopyBool, error)
func BytesToBoolNewN ¶
func BytesToBoolNewN() func([]byte) (*ps.PgcopyBoolN, error)
func BytesToDoubleNew ¶
func BytesToDoubleNew() func([]byte) (*ps.PgcopyDouble, error)
func BytesToDoubleNewN ¶
func BytesToDoubleNewN() func([]byte) (*ps.PgcopyDoubleN, error)
func BytesToFloatNew ¶
func BytesToFloatNew() func([]byte) (*ps.PgcopyFloat, error)
func BytesToFloatNewN ¶
func BytesToFloatNewN() func([]byte) (*ps.PgcopyFloatN, error)
func BytesToIntNewN ¶
func BytesToIntNewN() func([]byte) (*ps.PgcopyIntN, error)
func BytesToLongNew ¶
func BytesToLongNew() func([]byte) (*ps.PgcopyLong, error)
func BytesToLongNewN ¶
func BytesToLongNewN() func([]byte) (*ps.PgcopyLongN, error)
func BytesToShortNew ¶
func BytesToShortNew() func([]byte) (*ps.PgcopyShort, error)
func BytesToShortNewN ¶
func BytesToShortNewN() func([]byte) (*ps.PgcopyShortN, error)
func CheckStringUtf8 ¶
func ConfigToConverterBool ¶
func ConfigToConverterBoolN ¶
func ConfigToConverterDouble ¶
func ConfigToConverterFloat ¶
func ConfigToConverterFloatN ¶
func ConfigToConverterInt ¶
func ConfigToConverterIntN ¶
func ConfigToConverterLong ¶
func ConfigToConverterLongN ¶
func ConfigToConverterShort ¶
func ConfigToConverterShortN ¶
func NullBytesFromBytesNew ¶
func NullBytesFromBytesNew() func([]byte) (*ps.PgcopyBytesN, error)
func NullStringFromBytesNew ¶
func NullStringFromBytesNewDefault ¶
func NullStringFromBytesNewDefault() func([]byte) (*ps.PgcopyStringN, error)
func StringFromBytesNew ¶
func StringFromBytesNewDefault ¶
func StringFromBytesNewDefault() func([]byte) (*ps.PgcopyString, error)
func TimeFromBytesNew ¶
func TimeFromBytesNew() func([]byte) (*ps.PgcopyTime, error)
func TimeFromBytesNewN ¶
func TimeFromBytesNewN() func([]byte) (*ps.PgcopyTimeN, error)
func TypeToConverter ¶
func TypeToConverter( typ ps.ColumnType, cfg ConvertConfig, ) func([]byte) util.IO[ps.Value]
func UuidFromBytesNew ¶
func UuidFromBytesNew() func([]byte) (*ps.PgcopyUuid, error)
func UuidFromBytesNewN ¶
func UuidFromBytesNewN() func([]byte) (*ps.PgcopyUuidN, error)
Types ¶
type ConvertConfig ¶
type ConvertConfig struct {
// contains filtered or unexported fields
}
var ConvertConfigDefault ConvertConfig = ConvertConfig{}. WithStringChecker(CheckStringUtf8)
func (ConvertConfig) WithStringChecker ¶
func (c ConvertConfig) WithStringChecker( checker func(string) error, ) ConvertConfig
type IndexedTypeInfo ¶
type Input ¶
type Input struct {
ps.ColumnType
Raw []byte
}
type PgcopyBytesBool ¶
type PgcopyBytesBool []byte
func (PgcopyBytesBool) Convert ¶
func (t PgcopyBytesBool) Convert() (*ps.PgcopyBool, error)
Slow converter which may use heap allocation.
type PgcopyBytesDouble ¶
type PgcopyBytesDouble []byte
func (PgcopyBytesDouble) Convert ¶
func (t PgcopyBytesDouble) Convert() (*ps.PgcopyDouble, error)
Slow converter which may use heap allocation.
type PgcopyBytesFloat ¶
type PgcopyBytesFloat []byte
func (PgcopyBytesFloat) Convert ¶
func (t PgcopyBytesFloat) Convert() (*ps.PgcopyFloat, error)
Slow converter which may use heap allocation.
type PgcopyBytesInt ¶
type PgcopyBytesInt []byte
type PgcopyBytesLong ¶
type PgcopyBytesLong []byte
func (PgcopyBytesLong) Convert ¶
func (t PgcopyBytesLong) Convert() (*ps.PgcopyLong, error)
Slow converter which may use heap allocation.
type PgcopyBytesShort ¶
type PgcopyBytesShort []byte
func (PgcopyBytesShort) Convert ¶
func (t PgcopyBytesShort) Convert() (*ps.PgcopyShort, error)
Slow converter which may use heap allocation.
type TypeInfo ¶
type TypeInfo map[int16]ps.ColumnType
func TypeInfoFromEnvVar ¶
func TypeInfoFromEnvVar( ctx context.Context, getenv func(string) util.IO[string], keysKey string, ) TypeInfo
Gets type info from env vars.
Arguments ¶
- getenv: Gets env var.
- keysKey: env var key of keys of env vars.
func TypeInfoFromEnvVarAndKeys ¶
func TypeInfoFromEnvVarAndKeys( ctx context.Context, getenv func(string) util.IO[string], keys []string, ) TypeInfo
Gets type info from env vars and keys of env vars.
Arguments ¶
- getenv: Gets env var.
- keys: env var keys for vars which contains type string.
func TypeInfoFromEnvVarDefault ¶
func TypeInfoFromEnvVarDefault( ctx context.Context, getenv func(string) util.IO[string], ) TypeInfo
Gets type info from env vars using default env vars key.
Arguments ¶
- getenv: Gets env var.
func TypeInfoFromIndexIter ¶
func TypeInfoFromIndexIter( i iter.Seq[IndexedTypeInfo], ) TypeInfo
func TypeInfoFromIter ¶
func TypeInfoFromJsonIter ¶
Gets type info from strings(JSONs).
JSON sample:
{"index":0, "type": "string"}
{"index":1, "type": "string-null"}
{"index":2, "type": "int"}
{"index":3, "type": "int-null"}
func TypeInfoFromJsonReadable ¶
Gets type info from the reader(JSON lines).
func (TypeInfo) ToConverterIx ¶
func (t TypeInfo) ToConverterIx(cfg ConvertConfig) ConverterIx
func (TypeInfo) ToConverterIxDefault ¶
func (t TypeInfo) ToConverterIxDefault() ConverterIx
Click to show internal directories.
Click to hide internal directories.