gohelpers

package module
v0.0.0-...-d814896 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 6 Imported by: 0

README

GoHelpers

Some utility functions for the web

Crypto
- Basic Crypto functions for symmetric and asymmetric key encryptions
Email
- Email Module for sending emails
Localization
- Localization module to extract locales and perform translations
- Supports translations in JSON format ( Ex: en.json, de.json ) with key value pairs
Logger
- Logger Module for easy application logging
- Supports console and writing to file
Middleware
- Middlewares for echo server
    - ErrorHandler
        - Handles Error Translations
    - Localization
        - Sets the Translator so that we can translate in the error handler, or any other part of our code
    - RateLimiter
        - RateLimits Requests
    - Tracing
        - Adds OpenTracing to our server
ObjectStore
- Supplies Helpers to Upload/Download File/Image to Amazon S3 Store
Response
- Defines the input/output interfaces for the internal business handlers
Validation
- Provides helpers to perform input validation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(arr []string, elem string) bool

Contains -- Check if element exists in array

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func GenerateRandomString

func GenerateRandomString(n int) (string, error)

GenerateRandomString returns a securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func GetRegexCaptureGroupParams

func GetRegexCaptureGroupParams(regEx, in string) (paramsMap map[string]string)

GetRegexCaptureGroupParams -- Parses url with the given regular expression and returns the group values defined in the expression.

func StructToLowerCase

func StructToLowerCase(data interface{}, skipFields []string)

StructToLowerCase --Converts all fields of the struct to lowercase

func ToJSON

func ToJSON(i interface{}) string

ToJSON -- Convert any struct to text

Types

This section is empty.

Directories

Path Synopsis
cmd
middleware
s3

Jump to

Keyboard shortcuts

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