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 CompareInterfaceValue(a, b interface{}) int
- 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 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 ExistInArray[T ~string | int | int8 | int16 | int32 | int64 | float32 | float64](set []T, value T) bool
- func ForEach[T any](set []T, action func(elem T) error) error
- 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 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 SizeOf(v any) int
- 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 SSLConfig
Constants ¶
View Source
const ( SSLModeRequire = "require" SSLModeDisable = "disable" SSLModeVerifyCA = "verify-ca" SSLModeVerifyFull = "verify-full" Unknown = "" )
Variables ¶
This section is empty.
Functions ¶
func AddConstantToInterface ¶
func CheckIfFilesExists ¶
func CompareInterfaceValue ¶
func CompareInterfaceValue(a, b interface{}) int
return 0 for equal, -1 if a < b else 1 if a>b
func ComputeConfigHash ¶ added in v0.1.2
func Concurrent ¶
func ConcurrentC ¶
func ConcurrentInGroup ¶
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 ExistInArray ¶
func GetKeysHash ¶
GetKeysHash returns md5 hashsum of concatenated map values (sort keys before)
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 SizeOf ¶
Of returns the size of 'v' in bytes. If there is an error during calculation, Of returns -1.
func StreamIdentifier ¶
Types ¶
type SSLConfig ¶
type SSLConfig struct {
// SSL mode
//
// @jsonschema(
// required=true,
// enum=["require","disable","verify-ca","verify-full"]
// )
Mode string `mapstructure:"mode,omitempty" json:"mode,omitempty" yaml:"mode,omitempty"`
// CA Certificate
//
// @jsonschema(
// title="CA Certificate"
// )
ServerCA string `mapstructure:"server_ca,omitempty" json:"server_ca,omitempty" yaml:"server_ca,omitempty"`
// Client Certificate
//
// @jsonschema(
// title="Client Certificate"
// )
ClientCert string `mapstructure:"client_cert,omitempty" json:"client_cert,omitempty" yaml:"client_cert,omitempty"`
// Client Certificate Key
//
// @jsonschema(
// title="Client Certificate Key"
// )
ClientKey string `mapstructure:"client_key,omitempty" json:"client_key,omitempty" yaml:"client_key,omitempty"`
}
SSLConfig is a dto for deserialized SSL configuration for Postgres
Source Files
¶
Click to show internal directories.
Click to hide internal directories.