Skip to content

cyrildever/go-utls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-utls

Utilities for Go

GitHub tag (latest by date) GitHub last commit GitHub issues GitHub

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 libraries for TypeScript and Python.

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);
    • env: to know if an environment variable is set and cast it as either a boolean, an integer or a string (potentially setting it with a default value);
    • event: a simple event bus manager;
    • file: to find, truncate, know existence, delete, get line count or read all lines from a file;
    • 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, PrettyPrintJSON(), Reverse() for strings, 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-2024 Cyril Dever. All rights reserved.