package
0.23.2
Repository: https://github.com/mainfluxlabs/mainflux.git
Documentation: pkg.go.dev

# README

Webhooks

Webhooks service provides forwarding received messages to other platforms.

Configuration

The service is configured using the environment variables from the following table. Note that any unset variables will be replaced with their default values.

VariableDescriptionDefault
MF_WEBHOOKS_LOG_LEVELLog level for Webhooks (debug, info, warn, error)error
MF_WEBHOOKS_DB_HOSTDatabase host addresslocalhost
MF_WEBHOOKS_DB_PORTDatabase host port5432
MF_WEBHOOKS_DB_USERDatabase usermainflux
MF_WEBHOOKS_DB_PASSDatabase passwordmainflux
MF_WEBHOOKS_DBName of the database used by the servicewebhooks
MF_WEBHOOKS_DB_SSL_MODEDatabase connection SSL mode (disable, require, verify-ca, verify-full)disable
MF_WEBHOOKS_DB_SSL_CERTPath to the PEM encoded certificate file
MF_WEBHOOKS_DB_SSL_KEYPath to the PEM encoded key file
MF_WEBHOOKS_DB_SSL_ROOT_CERTPath to the PEM encoded root certificate file
MF_WEBHOOKS_CLIENT_TLSFlag that indicates if TLS should be turned onfalse
MF_WEBHOOKS_CA_CERTSPath to trusted CAs in PEM format
MF_WEBHOOKS_HTTP_PORTWebhooks service HTTP port9021
MF_WEBHOOKS_SERVER_CERTPath to server certificate in pem format
MF_WEBHOOKS_SERVER_KEYPath to server key in pem format
MF_JAEGER_URLJaeger server URLlocalhost:6831
MF_BROKER_URLMessage broker URLnats://127.0.0.1:4222
MF_THINGS_AUTH_GRPC_URLThings auth service gRPC URLlocalhost:8183
MF_THINGS_AUTH_GRPC_TIMEOUTThings auth service gRPC request timeout in seconds1s

Deployment

The service is distributed as a Docker container. Check the webhooks service section in docker-compose to see how service is deployed.

To start the service outside of the container, execute the following shell script:

# download the latest version of the service
go get github.com/MainfluxLabs/mainflux

cd $GOPATH/src/github.com/MainfluxLabs/mainflux

# compile the webhooks
make webhooks

# copy binary to bin
make install

# set the environment variables and run the service
MF_WEBHOOKS_LOG_LEVEL=[Webhooks log level]
MF_WEBHOOKS_DB_HOST=[Database host address]
MF_WEBHOOKS_DB_PORT=[Database host port]
MF_WEBHOOKS_DB_USER=[Database user]
MF_WEBHOOKS_DB_PASS=[Database password]
MF_WEBHOOKS_DB=[Name of the database used by the service]
MF_WEBHOOKS_DB_SSL_MODE=[SSL mode to connect to the database with]
MF_WEBHOOKS_DB_SSL_CERT=[Path to the PEM encoded certificate file]
MF_WEBHOOKS_DB_SSL_KEY=[Path to the PEM encoded key file]
MF_WEBHOOKS_DB_SSL_ROOT_CERT=[Path to the PEM encoded root certificate file]
MF_WEBHOOKS_CLIENT_TLS=[Flag that indicates if TLS should be turned on]                                           
MF_WEBHOOKS_CA_CERTS=[Path to trusted CAs in PEM format]                            
MF_WEBHOOKS_HTTP_PORT=[Service HTTP port]
MF_WEBHOOKS_SERVER_CERT=[String path to server cert in pem format]
MF_WEBHOOKS_SERVER_KEY=[String path to server key in pem format]
MF_JAEGER_URL=[Jaeger server URL]
MF_BROKER_URL=[Message broker URL]
MF_THINGS_AUTH_GRPC_URL=[Things auth service gRPC URL]
MF_THINGS_AUTH_GRPC_TIMEOUT=[Things auth service gRPC request timeout in seconds]
$GOBIN/mainflux-kit

Usage

For more information about service capabilities and its usage, please check out the API documentation.

# Packages

Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

New instantiates the webhooks service implementation.
No description provided by the author

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
Service specifies an API that must be fullfiled by the domain service implementation, and all of its decorators (e.g.
No description provided by the author

# Type aliases

No description provided by the author