Code Monkey home page Code Monkey logo

gobb's Introduction

gobb - Go Building Blocks

In every projects, there are some patterns and stuff you're always using. This project contains the ones that I always write again and again and as such, I've decided to extract them and refines them here.

Every piece of code here should only depends on the standard library to make it more versatile. You could use one or more packages as you see fit.

Every code in this repo should be tested because it represents the foundation on which I build softwares using the Go language.

This is my living toolbelt, use it or duplicate it if you want to ๐Ÿ˜‰

What does it contains?

  • assert/: common test assertions to make tests more readable.
  • clock/: sometimes you need to mock time. This package provide a convenient clock.Time which could be easily mocked and returns the current time in UTC. Testing time based stuff is hard and I really like this approach more than any other.
  • errors/: in every application, you'll have domain specific errors which represents an expected error in the system. This package provides a DomainError which you can instantiate using the errors.New or errors.NewWithErr methods.
  • event/: provides some stuff to easily write aggregates which could store domain events and dispatchers to forward them to handlers. I really like this approach (see associated tests) because when every state change of an entity is represented as an event, it makes it really easy to extend an application and observe it.
  • logging/: who doesn't need logging after all? It provides a simple Logger interface and a default implementation which writes to given io.Writer.
  • validate/: this one is a WIP, it's hard to find a great way to deal with validation so keep tuned ;)

gobb's People

Contributors

yuukanoo 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.