Documentation ¶
Index ¶
- func CleanUpGeneratedFiles(dir string) error
- func DBClose(db *sql.DB)
- func DirExists(path string) (bool, error)
- func EnsureDirPath(dirPath string) error
- func ErrorCatch(err *error)
- func ExtractDateTimeComponents(duration time.Duration) (days, hours, minutes, seconds, microseconds int64)
- func IsNil(v interface{}) bool
- func MustBe(v interface{}, kind reflect.Kind, errorStr string)
- func MustBeInitializedPtr(val interface{}, errorStr string)
- func MustBeTrue(condition bool, errorStr string)
- func PanicOnError(err error)
- func SaveGoFile(dirPath, fileName string, text []byte) error
- func StringSliceContains(strings []string, contains string) bool
- func ToGoEnumValueIdentifier(enumName, enumValue string) string
- func ToGoFileName(databaseIdentifier string) string
- func ToGoIdentifier(databaseIdentifier string) string
- func TypeMustBe(v reflect.Type, kind reflect.Kind, errorStr string)
- func ValueMustBe(v reflect.Value, kind reflect.Kind, errorStr string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanUpGeneratedFiles ¶
CleanUpGeneratedFiles deletes everything at folder dir.
func EnsureDirPath ¶
EnsureDirPath ensures dir path exists. If path does not exist, creates new path.
func ErrorCatch ¶
func ErrorCatch(err *error)
ErrorCatch is used in defer to recover from panics and to set err
func ExtractDateTimeComponents ¶
func ExtractDateTimeComponents(duration time.Duration) (days, hours, minutes, seconds, microseconds int64)
ExtractDateTimeComponents extracts number of days, hours, minutes, seconds, microseconds from duration
func MustBeInitializedPtr ¶
func MustBeInitializedPtr(val interface{}, errorStr string)
MustBeInitializedPtr panics with errorStr if val interface is nil
func MustBeTrue ¶
MustBeTrue panics when condition is false
func SaveGoFile ¶
SaveGoFile saves go file at folder dir, with name fileName and contents text.
func StringSliceContains ¶
StringSliceContains checks if slice of strings contains a string
func ToGoEnumValueIdentifier ¶
ToGoEnumValueIdentifier converts enum value name to Go identifier name.
func ToGoFileName ¶
ToGoFileName converts database identifier to Go file name.
func ToGoIdentifier ¶
ToGoIdentifier converts database to Go identifier.
func TypeMustBe ¶
TypeMustBe panics with errorStr error, if v type is not of reflect kind
Types ¶
This section is empty.