Documentation ¶
Index ¶
- Constants
- Variables
- func Basename(fn string) (bn string)
- func BasenameExt(fn string) (bn string)
- func ConnectToDb(auth string) *pgx.Conn
- func DbFprint(db bool, fp io.Writer, format string, arg ...interface{})
- func DbPrint(db bool, format string, arg ...interface{})
- func DbValueFromRow(rvdata []map[string]interface{}, row int, col string, def string) (rv string)
- func DbValueIsNull(rvdata []map[string]interface{}, row int, col string) (rv bool)
- func Dirname(fn string) (bn string)
- func DumpVar(v interface{})
- func EscapeDoubleQuote(s string) string
- func EscapeError(err error) string
- func Exists(name string) bool
- func ExistsGetUDate(name string) (bool, os.FileInfo)
- func ExistsIsDir(name string) bool
- func ExtendData(a map[string]interface{}, b map[string]interface{}) (rv map[string]interface{})
- func ExtendDataS(a map[string]string, b map[string]string) (rv map[string]string)
- func ExtendStringMap(a map[string]string, b map[string]string) map[string]string
- func FilesMatchingPattern(dir, pattern string) []string
- func FilterArray(re string, inArr []string) (outArr []string)
- func FindDirsWithSQLCfg(pth string, ignoreDirs []string) (rv []string)
- func FindFiles(pth string, ignoreDirs []string) (rv []string)
- func FnToCSSClass(filename string) string
- func Fopen(fn string, mode string) (file *os.File, err error)
- func GetColumns(rows pgx.Rows) (columns []string, err error)
- func GetFile(fn string) string
- func GetFilenames(dir string) (filenames, dirs []string)
- func GetIPFromRemoteAddr(RemoteAddr string) (rv string)
- func GetImageFiles(dir string) []string
- func GetLead() (lead string)
- func HasKeys(v map[string]interface{}) bool
- func HexSha1(s string) string
- func InArray(lookFor string, inArr []string) bool
- func InArrayN(lookFor string, inArr []string) int
- func InsSel(db *pgx.Conn, sel string, ins string, mdata map[string]string) (id string)
- func InsUpd(db *pgx.Conn, ins string, upd string, mdata map[string]string)
- func IntersectData(a map[string]interface{}, b map[string]interface{}) (rv map[string]interface{})
- func IsIntString(s string) bool
- func JSONStringToData(s string) (theJSON map[string]interface{}, err error)
- func LeftData(a map[string]interface{}, b map[string]interface{}) (rv map[string]interface{})
- func LowerCaseNames(a map[string]interface{}) (rv map[string]interface{})
- func NeedRebuild(parent string, optsRebuild bool, child string, child1 string, child2 string) bool
- func ParseBool(s string) (b bool)
- func Qt(format string, data map[string]string) string
- func QtR(format string, data map[string]interface{}) string
- func ReadJSONDataWithComments(path string) (file []byte, err error)
- func ReadJSONPath(pth string) map[string]string
- func RmExt(filename string) string
- func RowsToInterface(rows pgx.Rows) ([]map[string]interface{}, string, int)
- func RowsToJson(rows pgx.Rows) (string, string)
- func RowsToJsonFirstRow(rows pgx.Rows) (string, string)
- func Run1(db *pgx.Conn, q string, arg ...interface{}) error
- func Run2(db *pgx.Conn, q string, arg ...interface{}) (nr int64, err error)
- func SQLQuery(db *sql.DB, stmt string, data ...interface{}) (resultSet *sql.Rows, err error)
- func SVar(v interface{}) string
- func SVarI(v interface{}) string
- func SearchPath(rawFileName string, searchPath string) (fullFileName string, ok bool)
- func SearchPathApp(rawFileName string, appName string, searchPath string) (fullFileName string, ok bool)
- func SearchPathAppModule(rawFileName string, appName string, searchPath []string) (fullFileName []string, ok bool)
- func SelData(db *pgx.Conn, q string, data ...interface{}) []map[string]interface{}
- func SelData2(db *pgx.Conn, q string, data ...interface{}) ([]map[string]interface{}, error)
- func SelQ(db *pgx.Conn, q string, data ...interface{}) (Rows pgx.Rows, err error)
- func SlugToUUID(slug string) (uuid string)
- func SubstitueUserInFilePath(s string, mdata map[string]string) (rs string, has bool)
- func SubstitueUserInFilePathImmediate(s string) (rs string)
- func TypeOf(v []interface{})
- func URIToStringMap(req *http.Request) (m url.Values, fr map[string]string)
- func UUIDAsStr() (s_id string)
- func UUIDAsStrPacked() (s_id string)
- func UUIDToSlug(uuid string) (slug string)
- func XVar(v interface{}) string
- func XVarI(v interface{}) string
Constants ¶
const ISO8601 = "2006-01-02T15:04:05.99999Z07:00"
ISO format for date
const ISO8601output = "2006-01-02T15:04:05.99999-0700"
ISO format for date
const ReturnPacked = true
Variables ¶
var IsBSD = false
var IsLinux = true
var IsUnix = true
var IsWindows = false
Functions ¶
func Basename ¶
------------------------------------------------------------------------------------------------- xyzzy - str. Return the basename from a file path. This is the last component with the directory path stripped off. File extension removed. -------------------------------------------------------------------------------------------------
func BasenameExt ¶
------------------------------------------------------------------------------------------------- xyzzy - str. With file extension -------------------------------------------------------------------------------------------------
func ConnectToDb ¶
func ConnectToDb(auth string) *pgx.Conn
-------------------------------------------------------------------------------------------------
func DbValueFromRow ¶
func DbValueIsNull ¶
func DumpVar ¶
func DumpVar(v interface{})
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
func EscapeDoubleQuote ¶
------------------------------------------------------------------------------------------------
func EscapeError ¶
func Exists ¶
------------------------------------------------------------------------------------------------- Tested Exists reports whether the named file or directory exists. -------------------------------------------------------------------------------------------------
func ExistsGetUDate ¶
-------------------------------------------------------------------------------------------------
type FileInfo interface { Name() string // base name of the file Size() int64 // length in bytes for regular files; system-dependent for others Mode() FileMode // file mode bits ModTime() time.Time // modification time IsDir() bool // abbreviation for Mode().IsDir() Sys() interface{} // underlying data source (can return nil) }
Tested Exists reports whether the named file or directory exists. -------------------------------------------------------------------------------------------------
func ExistsIsDir ¶
func ExtendData ¶
func ExtendDataS ¶
func ExtendStringMap ¶
ExtendStringMap merges map of restuls from multiple JSON reads
func FilesMatchingPattern ¶
func FilterArray ¶
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
func FindDirsWithSQLCfg ¶
FindDirsWithSQLCfg searches a possibly recursive set of directories looking for directories containing sql-cfg*.json file.
func FnToCSSClass ¶
------------------------------------------------------------------------------------------------- xyzzy - str. Tested -------------------------------------------------------------------------------------------------
func GetColumns ¶
-------------------------------------------------------------------------------------------------
func GetFile ¶
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
func GetFilenames ¶
------------------------------------------------------------------------------------------------- Get a list of filenames and directorys. xyzzy - fil. -------------------------------------------------------------------------------------------------
func GetIPFromRemoteAddr ¶
GetIPFromRemoteAddr get client ip address from request
Example: ip,_,_ := net.SplitHostPort(r.RemoteAddr)
func GetImageFiles ¶
------------------------------------------------------------------------------------------------- list of image files in a directory -------------------------------------------------------------------------------------------------
func HasKeys ¶
------------------------------------------------------------------------------------------------ func HasKeys ( v map[string]Validation ) bool {
func InArray ¶
------------------------------------------------------------------------------------------------- xyzzy - str. -------------------------------------------------------------------------------------------------
func InsSel ¶
------------------------------------------------------------------------------------------------- xyzzy-Rewrite
mdata["group_id"] = insSel ( "select \"id\" from \"img_group\" where \"group_name\" = '%{user_id%}'",
-------------------------------------------------------------------------------------------------
func InsUpd ¶
-------------------------------------------------------------------------------------------------
func IntersectData ¶
Keep the data that has common keys between 'a' and 'b', prefering data from 'b' not used at the moment.
func IsIntString ¶
func JSONStringToData ¶
JsonStringToData convert from a string to a map[string]interface{} - parse JSON
func LowerCaseNames ¶
------------------------------------------------------------------------------------------------ Copy 'a', then copy 'b' over 'a' Tests: t-extendData.go ------------------------------------------------------------------------------------------------ jDataDefaults = lowerCaseNames ( jDataDefaults )
func NeedRebuild ¶
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
func Qt ¶
Qt Quick template %{name%} gets replace with substitution from map if it is in map, else ""
func ReadJSONDataWithComments ¶
ReadJSONDataWithComments read in the file and handle __LINE__, __FILE__ and comments starting with 4 slashes.
func ReadJSONPath ¶
read JSON file to map -------------------------------------------------------------------------------------------------
func RmExt ¶
------------------------------------------------------------------------------------------------- Tested -------------------------------------------------------------------------------------------------
func RowsToInterface ¶
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
func RowsToJson ¶
------------------------------------------------------------------------------------------------- Rows to JSON -- Go from a set of "rows" returned by db.Query to a JSON string. -------------------------------------------------------------------------------------------------
func RowsToJsonFirstRow ¶
------------------------------------------------------------------------------------------------- Rows to JSON -- Go from a set of "rows" returned by db.Query to a JSON string. -------------------------------------------------------------------------------------------------
func Run1 ¶
------------------------------------------------------------------------------------------------- test: t-run1q.go, .sql, .out -------------------------------------------------------------------------------------------------
func SQLQuery ¶
SQLQuery runs stmt and returns rows. func Run1(db *sql.DB, q string, arg ...interface{}) error {
func SVar ¶
func SVar(v interface{}) string
SVar convert a variable to it's JSON representation and return
func SVarI ¶
func SVarI(v interface{}) string
SVarI convert a variable to it's JSON representation with indendted JSON
func SearchPath ¶
func SearchPathApp ¶
func SearchPathApp(rawFileName string, appName string, searchPath string) (fullFileName string, ok bool)
Perform a search for files and return the full name for each file.
rawFileName: sql-cfg.json appName: "store"
func SearchPathAppModule ¶
func SelData2 ¶
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
func SelQ ¶
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
func SlugToUUID ¶
func SubstitueUserInFilePath ¶
func TypeOf ¶
func TypeOf(v []interface{})
------------------------------------------------------------------------------------------------
func UUIDAsStrPacked ¶
func UUIDAsStrPacked() (s_id string)
func UUIDToSlug ¶
Types ¶
This section is empty.