Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reveldi sample - Simple Dependency Injection for Go apps

This Revel project shows how reveldi can be implemented.

You'll find some messenger Structs in app/modules/message which are just test services.

In the app/controllers/dic.go., you can uncomment some lines to see that the registered service can be changed.

The most important point is that your service is registered only once here.

You can instantiate once all Structs you need with custom parameters (and why not others services). And you'll be able to use them in any controller you want.

In your controller, just tell to Container.Get() that your service must be an interfacing whatever you want (here messengerInterface, and you will not have to care if the Struct is a prefixMessenger, superMessenger or simple messenger.

About

Reveldi Sample - A Dependency Injection Container for Go

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages