This module provides to your Fx application a slack.Client,
that you can inject
anywhere to interact with the Slack API.
This module requires fxhttpclient.
Install the modules:
go get github.com/ankorstore/yokai/fxhttpclient
go get github.com/ankorstore/yokai-contrib/fxslack
Then activate them in your application bootstrapper:
// internal/bootstrap.go
package internal
import (
"github.com/ankorstore/yokai-contrib/fxslack"
"github.com/ankorstore/yokai/fxcore"
"github.com/ankorstore/yokai/fxhttpclient"
)
var Bootstrapper = fxcore.NewBootstrapper().WithOptions(
// load modules
fxhttpclient.FxHttpClientModule,
fxslack.FxSlackModule,
// ...
)
Configuration reference:
# ./configs/config.yaml
app:
name: app
env: dev
version: 0.1.0
debug: true
modules:
slack:
auth_token: ${SLACK_AUTH_TOKEN} # Slack Auth Token
app_level_token: ${SLACK_APP_LEVEL_TOKEN} # Slack App level Token
In test
mode, this client is configured to interact with a fake slack server.
See example.