Set of plugins that can used with in Gowok foundation library. Each plugin is designed to work together with Gowok internal or other plugins. You can turn off some Gowok functions and activate any plugins to replace it functionality.
Here some of available plugins:
- amqp - Interact to AMQP protocol, usually used for utilize RabbitMQ.
- cache - High level cache interface with multiple storage support.
- fiber - HTTP server library if you won't to use what Gowok has.
- gorm - Manage multiple connection of GORM.
- mongo - Manage multiple connection of MongoDB
- openapi - Serving API documentation with OpenAPI standard.
- opentelemetry - Metrics and tracers telemetry exporter.
- policy - Manage access rules to authorize user with all Casbin abilities.
- translator - Utilities to make translation easier to use.
- validator - Utilities to make validation easier to use.
In general, a plugin has public function that called Configure as entry point.
It receive Gowok project object as parameter, then continue to the factory.
After that, plugin is ready to use.
Overview of Configure function:
func Configure(project *gowok.Project)Example:
plugin1.Configure(gowok.Get())
plugin2.Configure(gowok.Get())
plugin3.Configure(gowok.Get())Or, inside Gowok Configures function:
gowok.Get().Configures(
plugin1.Configure,
plugin2.Configure,
plugin3.Configure,
)After the Configure function called, other things are managed by plugin.
Each plugin has different behaviour based on how it will be used.
Reading the plugin documentation is highly recommended.
After knowing what plugins are provided here and how to use them, you can imagine that creating a plugin is easy.
First thing you need is Configure function.
Just start to make it into your plugin and continue.
Because Configure function receive a Gowok project object, you can read configuration on that.
If you want to read configuration managed by Gowok, do it.
project.ConfigIf you want to read raw configuration in map[string]any, do it.
project.ConfigMapAfter that, you can use that to making your plugin.
You can make your own plugin. Or, if you want to contribute in this plugin collection, feel free to make an issue or lovely pull request 😎