Skip to content
/ gone Public

Gone is a lightweight dependency injection framework for Golang, designed to integrate with a variety of third-party components, enabling rapid development of cloud-native micro services.

License

Notifications You must be signed in to change notification settings

gone-io/gone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English  |  中文

license GoDoc Go Report Card codecov Build and Test Release Mentioned in Awesome Go

logo

Gone

What Is Gone?

Gone is a lightweight dependency injection framework for Golang, designed to integrate with a variety of third-party components, enabling rapid development of cloud-native microservices.

Features

  • Dependency injection: Supports automatic injection of struct fields and function parameters.
  • Gonectr: Generates projects, auxiliary code, compiles, and starts the project.
  • Unit testing solution: Mock testing based on interfaces.
  • Multiple pluggable components: Supports cloud-native and microservices architectures.

architecture

Quick Start

  1. Install gonectr and mockgen
    go install github.com/gone-io/gonectr@latest
    go install go.uber.org/mock/mockgen@latest
  2. Create a new project
    gonectr create myproject
  3. Run the project
    cd myproject
    gonectr run ./cmd/server
    Or use run Make command if you have installed make:
    cd myproject
    make run
    Or with docker compose:
    cd myproject
    docker compose build
    docker compose up

Contributing

If you have a bug report or feature request, you can open an issue, and pull requests are also welcome.

Changelog

v1.2.1

  • Introduced gone.Provider, a factory function for injecting external components (such as structs, struct pointers, functions, and interfaces) that are not Goner into Goners filed which tag by gone.
  • Fixed an issue where gone.NewProviderPriest failed to create a Priest for gone.Provider instances that generate interface types.
  • Added test cases for goner/gorm and completed other missing test cases; updated documentation accordingly.

v1.2.0

  • Introduced a new gone.GonerOption, enabling type-based injection by delegating the task of constructing injected type instances to a Goner that implements Suck(conf string, v reflect.Value, field reflect.StructField) error.
  • Added a helper function for implementing Goner Provider: func NewProviderPriest[T any, P any](fn func(tagConf string, param P) (T, error)) Priest.
  • Provided a strategy configuration solution for the cluster mode in goner/xorm.
  • Improved the goner/gorm code and conducted functional tests to support integration with multiple databases.

v1.1.1

  • goner/xorm now supports clustering and multiple databases. Latest documentation: https://goner.fun/references/xorm.html
  • Added goner/gorm, a wrapper for gorm.io/gorm for database access. Currently, only MySQL is supported, and improvements are ongoing.

Contact

If you have questions, feel free to reach out to us in the following ways:

License

gone released under MIT license, refer LICENSE file.

About

Gone is a lightweight dependency injection framework for Golang, designed to integrate with a variety of third-party components, enabling rapid development of cloud-native micro services.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages