utils

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2019 License: Apache-2.0, BSD-3-Clause, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUpGeneratedFiles

func CleanUpGeneratedFiles(dir string) error

CleanUpGeneratedFiles deletes everything at folder dir.

func DirExists

func DirExists(path string) (bool, error)

DirExists checks if folder at path exist.

func EnsureDirPath

func EnsureDirPath(dirPath string) error

EnsureDirPath ensures dir path exists. If path does not exist, creates new path.

func FormatTimestamp

func FormatTimestamp(t time.Time) []byte

FormatTimestamp formats t into Postgres' text format for timestamps. From: github.com/lib/pq

func GenerateTemplate

func GenerateTemplate(templateText string, templateData interface{}) ([]byte, error)

GenerateTemplate generates template with template text and template data.

func IsNil

func IsNil(v interface{}) bool

func SaveGoFile

func SaveGoFile(dirPath, fileName string, text []byte) error

SaveGoFile saves go file at folder dir, with name fileName and contents text.

func ToGoFileName

func ToGoFileName(databaseIdentifier string) string

ToGoFileName converts database identifier to Go file name.

func ToGoIdentifier

func ToGoIdentifier(databaseIdentifier string) string

ToGoIdentifier converts database to Go identifier.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL