New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/huboh/godi

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/huboh/godi

  • v0.0.0-20241109200800-44157caae8fe
  • Source
  • Go
  • Socket score

Version published
Created
Source

Godi - Lightweight Modular Dependency Injection Framework for Go

Godi is a lightweight, modular dependency injection framework designed for building scalable Go applications. It simplifies the creation of highly maintainable Go applications through a modular architecture with clear boundaries and flexible configurations powered by Uber's Dig library under the hood.

Key Features

  • Modular Architecture: Organize your application into cohesive modules with well-defined interfaces.
  • Constructor-Based and Direct Injection: Inject dependencies either via constructors or directly.
  • Type-Safe Dependency Management: Ensure compile-time type safety in dependency injection.
  • Routing with Guards, Filters, Pipes, Interceptors: Easily configure guards filters, interceptors for controllers or routes for flexible request handling.

Getting Started

  • Read the detailed documentation, please refer to the Godi package documentation.

  • Add Godi to your project:

    go get github.com/huboh/godi
    

Quick example

Here’s a minimal setup to start a godi app

package main

import (
    "log"
    "github.com/huboh/godi"
)

const (
    port = "5000"
    host = "localhost"
)

func main() {
    app, err := godi.New(&main.module{})
    if err != nil {
        log.Fatal("Failed to create godi app:", err)
    }

    err := app.Listen(host, port);
    if err != nil {
        log.Fatal("Failed to start app server:", err)
    }
}

Authors

License

Godi is released under the MIT License.

FAQs

Package last updated on 09 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc