Documentation
¶
Index ¶
- Constants
- func Absolute[T int | int8 | int16 | int32 | int64 | float32 | float64](value T) T
- func AddConstantToInterface(val interface{}, increment int) (interface{}, error)
- func ArrayContains[T any](set []T, match func(elem T) bool) (int, bool)
- func CheckIfFilesExists(files ...string) error
- func ComputeConfigHash(srcPath, destPath string) string
- func Concurrent[T any](ctx context.Context, array []T, concurrency int, ...) error
- func ConcurrentC[T any](ctx context.Context, next *Next[T], concurrency int, ...) error
- func ConcurrentF(ctx context.Context, functions ...CtxFunc) error
- func ConcurrentInGroup[T any](group *CxGroup, array []T, execute func(ctx context.Context, one T) error)
- func ConnWithCustomDeadlineSupport(conn net.Conn) (net.Conn, error)
- func ConvertToString(value interface{}) string
- func Decrypt(encryptedText string) (string, error)
- func DetermineSystemMemoryGB() int64
- func ErrExec(functions ...func() error) error
- func ErrExecFormat(format string, function func() error) func() error
- func ErrExecSequential(functions ...func() error) error
- func ExecCommand(ctx context.Context, c testcontainers.Container, cmd string) (int, []byte, error)
- func ExistInArray[T ~string | int | int8 | int16 | int32 | int64 | float32 | float64](set []T, value T) bool
- func ExtractColumnName(groups ...string) string
- func ForEach[T any](set []T, action func(elem T) error) error
- func GenerateDestinationDetails(namespace, name string, sourceDatabase *string) (string, string)
- func GetHash(m map[string]interface{}) string
- func GetKeysHash(m map[string]interface{}, keys ...string) string
- func IsInstance(val any, typ reflect.Kind) bool
- func IsJSON(str string) bool
- func IsLetterOrNumber(symbol int32) bool
- func IsOfType(object any, decidingKey string) (bool, error)
- func IsSubset[T comparable](setArray, subsetArray []T) bool
- func IsValidSubcommand(available []*cobra.Command, sub string) bool
- func MaxDate(v1, v2 time.Time) time.Time
- func NormalizedEqual(strune1, strune2 string) bool
- func ParsePrivateKey(pemText, passphrase string) (ssh.Signer, error)
- func Reformat(key string) string
- func SizeOf(v any) int
- func SplitAndTrim(s string) []string
- func StreamIdentifier(name, namespace string) string
- func Ternary(cond bool, a, b any) any
- func TimestampedFileName(extension string) string
- func ULID() string
- func Unmarshal(from, object any) error
- func UnmarshalFile(file string, dest any, credsFile bool) error
- func Validate[T any](structure T) error
- type CtxFunc
- type CxGroup
- type Next
- type NoDeadlineConn
- type SSHConfig
- type SSLConfig
Constants ¶
const ( SSLModeRequire = "require" SSLModeDisable = "disable" SSLModeVerifyCA = "verify-ca" SSLModeVerifyFull = "verify-full" Unknown = "" )
Variables ¶
This section is empty.
Functions ¶
func AddConstantToInterface ¶
func CheckIfFilesExists ¶
func ComputeConfigHash ¶ added in v0.1.2
func Concurrent ¶
func ConcurrentC ¶
func ConcurrentInGroup ¶
func ConnWithCustomDeadlineSupport ¶ added in v0.3.5
The crypto/ssh package does not support deadline methods.
- Required for: mongodb and oracle drivers, which internally set default deadlines or call these methods unconditionally.
- Not Required for: mysql driver (only calls SetDeadline if a timeout is explicitly configured) or postgres driver (uses context for timeouts).
func ConvertToString ¶
func ConvertToString(value interface{}) string
func DetermineSystemMemoryGB ¶
func DetermineSystemMemoryGB() int64
DetermineSystemMemoryGB returns the total system memory in GB. Returns -1 if unable to determine memory.
func ErrExecFormat ¶
func ErrExecSequential ¶
func ExecCommand ¶ added in v0.1.7
func ExecCommand( ctx context.Context, c testcontainers.Container, cmd string, ) (int, []byte, error)
Helper function to execute container commands
func ExistInArray ¶
func ExtractColumnName ¶ added in v0.3.5
ExtractColumnName extracts a column name from regex capture groups. It returns the first non-empty group from the provided groups. This is used when parsing filter expressions where column names can be:
- Quoted (for special characters): "user-name", "email@domain", "column.with.dots"
- Unquoted (for normal identifiers): age, status, count
Example usage:
// For filter: \"user-name\" = \"John\" // matches[1] = "user-name" (quoted column), matches[2] = "" (unquoted column) columnName := ExtractColumnName(matches[1], matches[2]) // Returns: "user-name" // For filter: age > 18 // matches[1] = "" (quoted column), matches[2] = "age" (unquoted column) columnName := ExtractColumnName(matches[1], matches[2]) // Returns: "age"
func GenerateDestinationDetails ¶ added in v0.2.0
GenerateDestinationDetails creates the default Iceberg database and table names. It combines prefix, source database, and namespace into a proper DB name.
func GetKeysHash ¶
GetKeysHash returns md5 hashsum of concatenated map values (sort keys before)
func IsLetterOrNumber ¶ added in v0.2.0
IsLetterOrNumber returns true if input symbol is:
A - Z: 65-90 a - z: 97-122
func IsSubset ¶
func IsSubset[T comparable](setArray, subsetArray []T) bool
func IsValidSubcommand ¶
IsValidSubcommand checks if the passed subcommand is supported by the parent command
func NormalizedEqual ¶ added in v0.1.7
func ParsePrivateKey ¶ added in v0.2.2
ParsePrivateKey parses a private key from a PEM string
func Reformat ¶ added in v0.2.0
Reformat makes all keys to lower case and replaces all special symbols with '_'
func SizeOf ¶
Of returns the size of 'v' in bytes. If there is an error during calculation, Of returns -1.
func SplitAndTrim ¶ added in v0.3.0
splitAndTrim splits a comma-separated string and trims whitespace
func StreamIdentifier ¶
Types ¶
type NoDeadlineConn ¶ added in v0.3.5
NoDeadlineConn wraps a net.Conn to suppress "deadline not supported" errors from the crypto/ssh package.
func (*NoDeadlineConn) SetDeadline ¶ added in v0.3.5
func (c *NoDeadlineConn) SetDeadline(_ time.Time) error
func (*NoDeadlineConn) SetReadDeadline ¶ added in v0.3.5
func (c *NoDeadlineConn) SetReadDeadline(_ time.Time) error
func (*NoDeadlineConn) SetWriteDeadline ¶ added in v0.3.5
func (c *NoDeadlineConn) SetWriteDeadline(_ time.Time) error
type SSHConfig ¶ added in v0.2.2
type SSHConfig struct {
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
Username string `json:"username,omitempty"`
PrivateKey string `json:"private_key,omitempty"`
Passphrase string `json:"passphrase,omitempty"`
Password string `json:"password,omitempty"`
}
func (*SSHConfig) SetupSSHConnection ¶ added in v0.2.2
type SSLConfig ¶
type SSLConfig struct {
Mode string `mapstructure:"mode,omitempty" json:"mode,omitempty" yaml:"mode,omitempty"`
ServerCA string `mapstructure:"server_ca,omitempty" json:"server_ca,omitempty" yaml:"server_ca,omitempty"`
ClientCert string `mapstructure:"client_cert,omitempty" json:"client_cert,omitempty" yaml:"client_cert,omitempty"`
ClientKey string `mapstructure:"client_key,omitempty" json:"client_key,omitempty" yaml:"client_key,omitempty"`
}
SSLConfig is a dto for deserialized SSL configuration for Postgres