Skip to content

gowok/plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

129 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Usage

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.

Plugin Creation

After knowing what plugins are provided here and how to use them, you can imagine that creating a plugin is easy.

Configure

First thing you need is Configure function. Just start to make it into your plugin and continue.

Read Configuration

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.Config

If you want to read raw configuration in map[string]any, do it.

project.ConfigMap

After that, you can use that to making your plugin.

Contribution

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 😎

About

Set of plugins that can used with in Gowok foundation library

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages