GithubHelp home page GithubHelp logo

go-utils's Introduction

KintoHub Go Utils

A project that holds common logic used across all go services @ KintoHub.

General Rules

  • Postfix a function with OrDie means that it will throw a panic and is used during the startup of the app
  • Prefix a fucntion with Run means that it is a blocking function that will not stop and go into an infinite loop. (Usually good to be called with go threads unless using it for a specific cause)

Logger

Basic logger using zero log. This is a dependency across all of utils and expected to call InitLogger to set it up.

Logger expects an environment variable LOG_LEVEL of value VERBOSE, DEBUG, INFO, WARN, ERROR, PANIC, FATAL

Server

Server currently only has an implementation of grpc but may have future server implementations such as fasthttp, websockets etc. There are common utilities within server so that it can be abstracted. Most importantly, server/utils/errors.go can be used to create standard errors across different server implementations so that your business logic can return errors such as NotFound or Internal and depending on the implementation, it will handle the error code and message gracefully.

Additionally, any errors that are returned and sent out will be automatically logged through middleware. So logging errors is unnecessary when using this package.

Config

Config package has utility functions to load configuration from environment variables with ease.

Utils

Utils package has basic logic that is reused across projects.

go-utils's People

Contributors

bakayolo avatar codingben avatar disturbing avatar nadeemkhedr avatar nandiheath avatar nandikinto avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.