gext

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: MIT Imports: 9 Imported by: 0

README

Go Extensions

gext extends standard go libraries for commonly used programming patterns and utilities

concurency

premise implementation and event aggregator

data
Union

Union merge two maps.If existing map and altered map contains same key than value of existing is replaced by value of altered

union := extensions.Union(existingMap, alteredMap)
date
env

reading string from environment variable

env.MustGetStringFlagFromEnv(envLabels)
guard

guardians, panics or throw errors. It is bad practice to panic within library packages, return error instead

err := s.ListenAndServeTLS(certPath, keyPath)
guards.FailOnError(err, "server stopped")
if contentType := r.Header.Get("Content-Type"); contentType != httphead.ContentType.ApplicationJSON {
		guards.HttpThrowError(w, http.StatusInternalServerError, "Content-Type=%s, expect application/json", contentType)
		return
}
httphead
log
package main

import "github.com/kuritka/gext/log"

var logger = log.Log

func main(){
	logger.Panic().Msg("panic!")
}
{"level":"panic","time":"2020-03-02T16:29:20+01:00","caller":"/home/michal/go/src/gext/main.go:8","message":"panic!"}
parser

Used for parsing basic types values

.ToString()
.ToFloat64()
.ToInt()
...
rand

Random numbers and guids

reflection

Currently modifying structures. Add items to slices etc..

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package Concurency prvides basic structures to handle concurency i.e.
Package Concurency prvides basic structures to handle concurency i.e.
Data provides extended data operations over maps and slices
Data provides extended data operations over maps and slices
Package formats and parese date .
Package formats and parese date .
Env provides easy access to environment variables.
Env provides easy access to environment variables.
Guards throws errors or panics when error occur Package utils implements helpers.
Guards throws errors or panics when error occur Package utils implements helpers.
Package helps parse http headers.
Package helps parse http headers.
Package log wraps zerolog logger and provides standard log functionality
Package log wraps zerolog logger and provides standard log functionality
Package simplifies parsing numbers and strings.
Package simplifies parsing numbers and strings.
Package helps with generating random numbers and guids.
Package helps with generating random numbers and guids.
Package reflection provides reflection helpers over structures.
Package reflection provides reflection helpers over structures.

Jump to

Keyboard shortcuts

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