util

package
v0.0.0-...-6f8fa1e Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package util should stay empty.

davecheney: #golang top tip: don't write a "utils" package, don't make a "utils" project. 2/10/16, 11:42 PM

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelCaseToUnderscore

func CamelCaseToUnderscore(str string) string

CamelCaseToUnderscore converts from camel case form to underscore separated form. Eg.: CatalogProductEntity -> catalog_product_entity

func LintName

func LintName(name string) (should string)

LintName returns a different name if it should be different. @see github.com/golang/lint/lint.go

func ParseTimeStrict

func ParseTimeStrict(layout, value string) (time.Time, error)

ParseTimeStrict parses a formatted string and returns the time value it represents. The output is identical to time.Parse except it returns an error for strings that don't format to the input value.

An example where the output differs from time.Parse would be: parseTimeStrict("1/2/06", "11/31/15")

- time.Parse returns "2015-12-01 00:00:00 +0000 UTC"

- ParseTimeStrict returns an error

func RandAlnum

func RandAlnum(n int) string

RandAlnum returns a random string with a defined length n of alpha numerical characters. This function does not use the global rand variable from math/rand package.

func StrIsAlNum

func StrIsAlNum(s string) bool

StrIsAlNum returns true if an alpha numeric string consists of characters a-zA-Z0-9_

func UnderscoreCamelize

func UnderscoreCamelize(s string) string

UnderscoreCamelize transforms from snake case to CamelCase. Also removes quotes and takes care of special names.

idx_eav_id 				=> IDXEAVID
hello_gopher_id 		=> HelloGopherID
catalog_product_entity 	=> CatalogProductEntity

func UnderscoreToCamelCase

func UnderscoreToCamelCase(s string) string

UnderscoreToCamelCase converts from underscore separated form to camel case form. Eg.: catalog_product_entity -> CatalogProductEntity

Types

This section is empty.

Directories

Path Synopsis
Package bufferpool implements a pool of reusable auto-resizing buffers.
Package bufferpool implements a pool of reusable auto-resizing buffers.
Package conv - easy and safe casting from one type to another.
Package conv - easy and safe casting from one type to another.
Package csjwt handles JSON web tokens.
Package csjwt handles JSON web tokens.
cmd/jwt
A useful example app.
A useful example app.
jwtclaim
Package jwtclaim provides claim structs and maps for convenience.
Package jwtclaim provides claim structs and maps for convenience.
Package csmath provides additional math helper functions.
Package csmath provides additional math helper functions.
Package cstesting provides testing helpers
Package cstesting provides testing helpers
package diff compares two strings and prints out all differences
package diff compares two strings and prints out all differences
Package errors provides simple error handling primitives.
Package errors provides simple error handling primitives.
Package hashpool implements a pool for reusable and registered hash.Hash types.
Package hashpool implements a pool for reusable and registered hash.Hash types.
Package magento contains helper functions to handle the different versions.
Package magento contains helper functions to handle the different versions.
Package naughtystrings is a collection of strings for testing that have a high probability of causing issues when used as user input.
Package naughtystrings is a collection of strings for testing that have a high probability of causing issues when used as user input.
Package null contains SQL types that consider zero input and null input as separate values, with convenient support for JSON and text marshaling.
Package null contains SQL types that consider zero input and null input as separate values, with convenient support for JSON and text marshaling.
zero
Package zero contains SQL types that consider zero input and null input to be equivalent with convenient support for JSON and text marshaling.
Package zero contains SQL types that consider zero input and null input to be equivalent with convenient support for JSON and text marshaling.
php
Package php provides compatibility functions between Go and PHP.
Package php provides compatibility functions between Go and PHP.
phpdate
Package phpdate converts a PHP date format into Go format.
Package phpdate converts a PHP date format into Go format.
phpsession
Package phpsession provides possibility to decode/encode php session data in php_binary format.
Package phpsession provides possibility to decode/encode php session data in php_binary format.
Package shortid enables the generation of short, unique, non-sequential and by default URL friendly Ids.
Package shortid enables the generation of short, unique, non-sequential and by default URL friendly Ids.
Package slices contains functions for working on specific slice types.
Package slices contains functions for working on specific slice types.
package sqlbeautifier formats a SQL string to a more human readable format.
package sqlbeautifier formats a SQL string to a more human readable format.
dependency/bson
Package bson implements encoding and decoding of BSON objects.
Package bson implements encoding and decoding of BSON objects.
dependency/bytes2
Package bytes2 provides alternate implementations of functionality similar to go's bytes package.
Package bytes2 provides alternate implementations of functionality similar to go's bytes package.
dependency/hack
Package hack gives you some efficient functionality at the cost of breaking some Go rules.
Package hack gives you some efficient functionality at the cost of breaking some Go rules.
dependency/sqltypes
Package sqltypes implements interfaces and types that represent SQL values.
Package sqltypes implements interfaces and types that represent SQL values.
Package translit replaces characters in a string using a huge conversion table.
Package translit replaces characters in a string using a huge conversion table.
Package validation provides abstract functions and options to allow validation of any struct or slice without reflection or struct fields.
Package validation provides abstract functions and options to allow validation of any struct or slice without reflection or struct fields.

Jump to

Keyboard shortcuts

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