go-utls
Utilities for Go
go-utls is a small Go repository where I put all the useful stuff I regularly need in my projects.
Feel free to use at your discretion with the appropriate license mentions.
NB: I've developed the same kind of library for TypeScript, available on NPM: ts-utls
Usage
go get github.com/cyrildever/go-utls
This repository contains the following modules:
crypto
: a proxy to Go-Ethereum's ECIES library and to my ecies-geth
JavaScript library (including the Path
type) as well as a small SSHPublicKey2String()
utility;
io
: a light REST client utility on top of fasthttp
with Delete
, Get
, Patch
, Post
and Put
methods;
model
: a list of types I frequently use in my projects (such as Base64
or Hash
types) all implementing my Model
interface;
normalizer
: the adaptation of my Empreinte Sociométrique™ patented work for normalizing contact data (see its specific README or use its TypeScript equivalent on NPM: es-normalizer
);
- a few utility sub-modules:
caller
: to get information about the location of the calling function (file name and line number);
concurrent
: to handle concurrent maps and slices (with faster slice appending when its length is set at instantiation through the concurrent.NewSlice
function);
email
: my "quick-and-dirty" SMTP client (including examples in tests for use with AWS SES or Gmail);
event
: a simple event bus manager;
file
: to find, truncate, know existence, delete or get lines from files;
logger
: a wrapper to the log
package to output logs to stderr and optionally a file;
ntp
: another small wrapper to handle time with NTP;
packer
: to marshal/unmarshal data (JSON, MessagePack, MongoDB's Bson, …);
utils
: a bunch of useful utility functions (Capitalize()
, Chunk()
, DateFormat()
from Java notation, EuclideanDivision()
, Flatten()
, FromHex()
/ToHex()
, back-and-forth conversions of byte arrays (to string, number, etc.), IsPointer()
/IsValue()
test methods, ToUTF8()
string formatting, …);
xor
: to apply XOR operation to strings or byte arrays.
License
These modules are distributed under a MIT license.
See the LICENSE file.
© 2020-2021 Cyril Dever. All rights reserved.