Documentation ¶
Index ¶
- func Base64Decode(value string) string
- func Base64Encode(string string) string
- func Camelize(in string) string
- func CompareHash(hash string, value string) bool
- func CreateFolder(path string)
- func Decrypt(encryptedString string, keyString string) (decryptedString string)
- func Encrypt(stringToEncrypt string, keyString string) (encryptedString string)
- func Error(values ...interface{})
- func FormToMap(r *http.Request) map[string]interface{}
- func GetRequestBody(r *http.Request) string
- func GetRootPath() string
- func Goroutines(intervalTime time.Duration)
- func Hash(value string) string
- func InterfaceToString(value interface{}) string
- func IsNil(a interface{}) bool
- func JSONDecode(value string, base64Decode bool) interface{}
- func JSONEncode(value interface{}, base64Encode bool) string
- func JSONToMap(element interface{}) map[string]interface{}
- func Log(values ...interface{})
- func LogFile(values ...interface{})
- func MapListToStructure(list []map[string]interface{}, s interface{})
- func MapToStruct(data map[string]interface{}, structPointer interface{})
- func MapToStructure(m map[string]interface{}, s interface{})
- func MergeObjects(values ...map[string]interface{}) map[string]interface{}
- func PathData(path string) map[string]interface{}
- func ReplaceNotCase(value string, search string, replace string) string
- func SendAndLoad(url string, data interface{}) string
- func String(value interface{}) string
- func StructureToMap(element interface{}) map[string]interface{}
- func Type(value interface{}) string
- func URLToMap(urlString string) map[string]interface{}
- func UUID() string
- func Value(data interface{}, path string, defaultValue interface{}) interface{}
- func Wait(values ...interface{})
- type DataBase
- func (db *DataBase) Add(table string, data map[string]interface{}, condition string, ...) map[string]interface{}
- func (db *DataBase) Delete(table string, condition string) map[string]interface{}
- func (db *DataBase) GetList(table string, condition string, limit string, orderBy string, columns string) []map[string]interface{}
- func (db *DataBase) GetMap(rows *sql.Rows) []map[string]interface{}
- func (db *DataBase) GetRow(table string, condition string, orderBy string, columns string) map[string]interface{}
- func (db *DataBase) GetTables() []map[string]interface{}
- func (db *DataBase) Insert(table string, data map[string]interface{}, columnsToReturn string) map[string]interface{}
- func (db *DataBase) SQL(query string) []map[string]interface{}
- func (db *DataBase) TestConnection() bool
- func (db *DataBase) Update(table string, data map[string]interface{}, condition string, ...) map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func CompareHash ¶
func CreateFolder ¶
func CreateFolder(path string)
func Decrypt ¶ added in v0.0.3
Example: decryptedText := Decrypt("MyEncryptedText", "256-bit-key-generator") Key generator = https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx
func Encrypt ¶ added in v0.0.3
Example: encryptedText := Encrypt("MyText", "256-bit-key-generator") Key generator = https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx
func GetRequestBody ¶
func GetRootPath ¶
func GetRootPath() string
func Goroutines ¶
func InterfaceToString ¶
func InterfaceToString(value interface{}) string
func JSONDecode ¶
data := utils.JSONDecode(string, false)
func JSONEncode ¶
func MapListToStructure ¶
func MapListToStructure(list []map[string]interface{}, s interface{})
func MapToStruct ¶
func MapToStruct(data map[string]interface{}, structPointer interface{})
Example: var user User; utils.MapToStruct(result, &user)
func MapToStructure ¶
func MapToStructure(m map[string]interface{}, s interface{})
func MergeObjects ¶
func SendAndLoad ¶
func StructureToMap ¶
func StructureToMap(element interface{}) map[string]interface{}
Types ¶
type DataBase ¶
type DataBase struct { Host string Port string Db string Username string Password string Conn *sql.DB }
DataBase : DataBase Structure
func NewDataBase ¶
Example: db := cuppago.NewDataBase("localhost","golang", "root", "", "")
func (*DataBase) Add ¶
func (db *DataBase) Add(table string, data map[string]interface{}, condition string, columnsToReturn string) map[string]interface{}
Add : Check if record exist if exist update it or create one
func (*DataBase) GetList ¶
func (db *DataBase) GetList(table string, condition string, limit string, orderBy string, columns string) []map[string]interface{}
Example: data := db.GetList("users", "", "", "", "")
func (*DataBase) GetRow ¶
func (db *DataBase) GetRow(table string, condition string, orderBy string, columns string) map[string]interface{}
GetRow : Get a map of data from a specific table
func (*DataBase) Insert ¶
func (db *DataBase) Insert(table string, data map[string]interface{}, columnsToReturn string) map[string]interface{}
Example: data := map[string]interface{}{"name":"Tufik","age":50, "date":"NOW()"} db.Insert("users", data, "")