Gone is a lightweight golang dependency injection framework; a series of Goners components are built in for rapid development of micro services.
Go to file
大鹏 68e2928a34
Some checks failed
Test and coverage / build (1.21.x) (push) Has been cancelled
Test and coverage / build (1.22.x) (push) Has been cancelled
Test and coverage / build (1.23.x) (push) Has been cancelled
Merge pull request #45 from gone-io/v1.2.x
feat: update code of process chan
2025-01-02 20:38:58 +08:00
.github/workflows feat: test for goner/gorm 2024-11-23 23:08:30 +08:00
.idea feat: 完成基本设计 2022-10-16 23:02:09 +08:00
docs feat: update readme,add architecture png 2024-11-24 10:44:47 +08:00
example feat: update mock code 2024-12-21 12:53:23 +08:00
goner feat: update code of process chan 2025-01-02 20:26:13 +08:00
internal/json feat: 1. add internal/json and replace encoding/json 2024-06-26 09:38:00 +08:00
tools/gone feat: Use mobile go.uber.org/mock instead of github.com/golang/mock 2024-11-13 18:24:46 +08:00
.gitignore feat: add zap for log 2024-06-07 19:22:16 +08:00
cemetery_test.go feat: Use mobile go.uber.org/mock instead of github.com/golang/mock 2024-11-13 18:24:46 +08:00
cemetery.go feat: code finishing 2024-11-25 10:15:44 +08:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2024-05-21 21:27:08 +08:00
error_test.go test: add test for error.go 2024-06-27 09:12:05 +08:00
error.go feat: goner/xorm unit test 2024-11-20 20:55:58 +08:00
gin_interface.go doc: Adjust the Chinese comments in the code to English 2024-06-14 22:46:00 +08:00
go.mod feat: update deps and add Loads(priests ...Priest) *Preparer to Preparer 2024-12-21 12:42:19 +08:00
go.sum feat: update deps and add Loads(priests ...Priest) *Preparer to Preparer 2024-12-21 12:42:19 +08:00
h_test.go feat: AfterStopSignalWaitSecond as an Attribute add to heaven 2024-05-30 21:01:45 +08:00
heaven_test.go feat: Use mobile go.uber.org/mock instead of github.com/golang/mock 2024-11-13 18:24:46 +08:00
heaven.go feat: Add Default Preparer for new code directory structure 2024-11-06 16:08:22 +08:00
help_test.go feat: test for gone.TagStringParse 2024-11-23 18:27:41 +08:00
help.go feat: code finishing 2024-11-25 10:15:44 +08:00
inject_by_provider_test.go feat: provide a way to create Type Provider 2024-11-23 12:41:38 +08:00
interface.go feat: code finishing 2024-11-25 10:15:44 +08:00
LICENSE doc: update readme and change LICENSE to MIT 2024-06-20 07:08:33 +08:00
logger_test.go test: add test cases 2024-06-14 17:26:47 +08:00
logger.go feat: fix gone.IsDefault error; check examples 2024-06-15 11:37:57 +08:00
mock_test.go feat: Use mobile go.uber.org/mock instead of github.com/golang/mock 2024-11-13 18:24:46 +08:00
prepare_test.go feat: test for Preparer.LoadPriest, Preparer.Load, Preparer.Bury 2024-11-24 10:56:46 +08:00
prepare.go feat: update deps and add Loads(priests ...Priest) *Preparer to Preparer 2024-12-21 12:42:19 +08:00
README_CN.md feat: update readme, and add example of simple-web 2024-11-25 22:22:01 +08:00
README.md feat: update readme, and add example of simple-web 2024-11-25 22:22:01 +08:00
tomb.go fix: templates of tools/gone 2024-06-15 14:09:49 +08:00
version.go feat: release for v1.2.1 2024-11-24 11:46:08 +08:00

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
    

Full Documentation

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.