{"repo":"golobby/container","free":true,"listed":false,"github":"https://github.com/golobby/container","clone":"git clone https://github.com/golobby/container.git","description":"A lightweight yet powerful IoC dependency injection container for the Go programming language","language":"Go","stars":612,"topics":["ioc","ioc-container","container","dependency-injection","go","golang","golang-package","di-container","di-framework","inversion-of-control"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"Container GoLobby Container is a lightweight yet powerful IoC (dependency injection) container for Go projects. It's built neat, easy-to-use, and performance-in-mind to be your ultimate requirement. Features: - Singleton and Transient bindings - Named dependencies (bindings) - Resolve by functions, variables, and structs - Must helpers that convert errors to panics - Optional lazy loading of bindings - Global instance for small applications - 100% Test coverage! Documentation Required Go Versions It requires Go v1.11 or newer versions. Installation To install this package, run the following command in your project directory. Next, include it in your application: Introduction GoLobby Container is used to bind abstractions to their implementations. Binding is the process of introducing appropriate concretes (implementations) of abstractions to an IoC container. In this process, you also determine the resolving type, singleton or transient. In singleton bindings, the container provides an instance once and returns it for all the requests. In transient bindings, the container always returns a brand-new instance for each request. After the binding process, you can ask the IoC container to make the appropriate implementation of the abstraction that your code needs. Then your code will depend on abstractions, not implementations! Quick Start The following example demonstrates a simple binding and resolving. Typed Binding Singleton The following snippet expresses singleton binding. I","default_branch":null,"files":null,"tree":[],"storefront":"/r/golobby","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/golobby/container/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}