Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

daominah/gomicrokit

Repository files navigation

Gomicrokit

Often used packages for developing microservices

Packages

auth

  • genrsa: generate a RSA key pair as PEM files (idRsa, idRsaPub)
  • jwt: easy to use JSON web token, depend on dgrijalva/jwt-go
    CreateAuthToken(authInfo interface{}) (jwtToken string)
    CheckAuthToken(jwtToken string, outPointer interface{}) error
  • password:
    HashPassword(plain string) (hashed string)
    CheckHashPassword(hashed string, plain string) bool

gofast

Often used functions. Ex: cron job, find index in slice, UUID, ..

httpsvr

Http server supports http method, url params, logging, metric.
API is similar to standard http ServeMux HandleFunc.
Depend on julienschmidt/httprouter

kafka

An easy to use, pure go Kafka client.
Depend on Shopify/sarama

log

A leveled, rotated (by time and file size) logger.
Depend on go.uber.org/zap and natefinch/lumberjack

metric

Package metric is used for observing request count and duration.
It use an order statistic tree to store durations, so it can calculate percentiles very fast.

textproc

Extracting information from text and html

websocket

An easy-to-use websocket client and server.
Depend on gorilla/websocket

Example usages

Directory a_examples contains executables as example usage of other packages in this project