Categorygithub.com/ankorstore/yokai-contrib/fxslack
package
1.0.0
Repository: https://github.com/ankorstore/yokai-contrib.git
Documentation: pkg.go.dev

# README

Fx Slack Module

ci go report codecov Deps PkgGoDev

Fx module for Slack.

Overview

This module provides to your Fx application a slack.Client, that you can inject anywhere to interact with the Slack API.

Installation

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

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

Testing

In test mode, this client is configured to interact with a fake slack server.

See example.