mainflux

package module
v0.24.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

Mainflux

go report card license

banner

Mainflux is modern, scalable, secure, open-source, and patent-free IoT cloud platform written in Go.

It accepts user and thing (sensor, actuator, application) connections over various network protocols (i.e. HTTP, MQTT, WebSocket, CoAP), thus making a seamless bridge between them. It is used as the IoT middleware for building complex IoT solutions.

For more details, check out the official documentation.

Features

  • Multi-protocol connectivity and bridging (HTTP, MQTT, WebSocket and CoAP)
  • Device management and provisioning (Zero Touch provisioning)
  • Mutual TLS Authentication (mTLS) using X.509 Certificates
  • Fine-grained access control (policies, ABAC/RBAC)
  • Message persistence (Cassandra, InfluxDB, MongoDB and PostgresSQL)
  • Platform logging and instrumentation support (Grafana, Prometheus and OpenTracing)
  • Event sourcing
  • Container-based deployment using Docker and Kubernetes
  • Edge Agent and Export services for remote IoT gateway management and edge computing
  • SDK
  • CLI
  • Small memory footprint and fast execution
  • Domain-driven design architecture, high-quality code and test coverage

Prerequisites

The following are needed to run Mainflux:

Developing Mainflux will also require:

Install

Once the prerequisites are installed, execute the following commands from the project's root:

docker-compose -f docker/docker-compose.yml up

This will bring up the Mainflux docker services and interconnect them. This command can also be executed using the project's included Makefile:

make run

If you want to run services from specific release checkout code from github and make sure that MF_RELEASE_TAG in .env is being set to match the release version

git checkout tags/<release_number> -b <release_number>
# e.g. `git checkout tags/0.13.0 -b 0.13.0`

Check that .env file contains:

MF_RELEASE_TAG=<release_number>

docker-compose should be used for development and testing deployments. For production we suggest using Kubernetes.

Usage

The quickest way to start using Mainflux is via the CLI. The latest version can be downloaded from the official releases page.

It can also be built and used from the project's root directory:

make cli
./build/mainfluxlabs-cli version

Additional details on using the CLI can be found in the CLI documentation.

Documentation

Official documentation is hosted at Mainflux official docs page. Documentation is auto-generated, checkout the instructions on official docs repository:

If you spot an error or a need for corrections, please let us know - or even better: send us a PR.

Authors

Main architect and BDFL of Mainflux project is @drasko.

Additionally, @nmarcetic and @janko-isidorovic assured overall architecture and design, while @manuio and @darkodraskovic helped with crafting initial implementation and continuously worked on the project evolutions.

Besides them, Mainflux is constantly improved and actively developed by @anovakovic01, @dusanb94, @srados, @gsaleh, @blokovi, @chombium, @mteodor and a large set of contributors.

Maintainers are listed in MAINTAINERS file.

The Mainflux team would like to give special thanks to @mijicd for his monumental work on designing and implementing a highly improved and optimized version of the platform, and @malidukica for his effort on implementing the initial user interface.

Professional Support

There are many companies offering professional support for the Mainflux system.

If you need this kind of support, best is to reach out to @drasko directly, and he will point you out to the best-matching support team.

Contributing

Thank you for your interest in Mainflux and the desire to contribute!

  1. Take a look at our open issues. The good-first-issue label is specifically for issues that are great for getting started.
  2. Checkout the contribution guide to learn more about our style and conventions.
  3. Make your changes compatible to our workflow.

License

Apache-2.0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version represents the last service git tag in git history.
	// It's meant to be set using go build ldflags:
	// -ldflags "-X 'github.com/MainfluxLabs/mainflux.Version=0.0.0'"
	Version = "0.0.0"
	// Commit represents the service git commit hash.
	// It's meant to be set using go build ldflags:
	// -ldflags "-X 'github.com/MainfluxLabs/mainflux.Commit=ffffffff'"
	Commit = "ffffffff"
	// BuildTime represetns the service build time.
	// It's meant to be set using go build ldflags:
	// -ldflags "-X 'github.com/MainfluxLabs/mainflux.BuildTime=1970-01-01_00:00:00'"
	BuildTime = "1970-01-01_00:00:00"
)

Functions

func Env

func Env(key, fallback string) string

Env reads specified environment variable. If no value has been found, fallback is returned.

func Health

func Health(service string) http.HandlerFunc

Health exposes an HTTP handler for retrieving service health.

func LoadEnvFile

func LoadEnvFile(envfilepath string) error

LoadEnvFile loads environment variables defined in an .env formatted file.

Types

type HealthInfo

type HealthInfo struct {
	// Status contains service status.
	Status string `json:"status"`

	// Version contains current service version.
	Version string `json:"version"`

	// Commit represents the git hash commit.
	Commit string `json:"commit"`

	// Description contains service description.
	Description string `json:"description"`

	// BuildTime contains service build time.
	BuildTime string `json:"build_time"`
}

HealthInfo contains version endpoint response.

Directories

Path Synopsis
api
Package api contains implementation of Auth service HTTP API.
Package api contains implementation of Auth service HTTP API.
api/grpc
Package grpc contains implementation of Auth service gRPC API.
Package grpc contains implementation of Auth service gRPC API.
jwt
postgres
Package postgres contains Key repository implementations using PostgreSQL as the underlying database.
Package postgres contains Key repository implementations using PostgreSQL as the underlying database.
tracing
Package tracing contains middlewares that will add spans to existing traces.
Package tracing contains middlewares that will add spans to existing traces.
Package certs contains the domain concept definitions needed to support Mainflux certs service functionality.
Package certs contains the domain concept definitions needed to support Mainflux certs service functionality.
api
Package api contains implementation of certs service HTTP API.
Package api contains implementation of certs service HTTP API.
pki
Package pki wraps vault client
Package pki wraps vault client
postgres
Package postgres contains repository implementations using PostgreSQL as the underlying database.
Package postgres contains repository implementations using PostgreSQL as the underlying database.
cmd
certs
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: Apache-2.0
cli
ws
Package coap contains the domain concept definitions needed to support Mainflux CoAP adapter service functionality.
Package coap contains the domain concept definitions needed to support Mainflux CoAP adapter service functionality.
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
Package consumers contain the domain concept definitions needed to support Mainflux consumer services functionality.
Package consumers contain the domain concept definitions needed to support Mainflux consumer services functionality.
notifiers
Package notifiers contain the domain concept definitions needed to support Mainflux notifications functionality.
Package notifiers contain the domain concept definitions needed to support Mainflux notifications functionality.
notifiers/smpp
Package smpp contains the domain concept definitions needed to support Mainflux SMS notifications.
Package smpp contains the domain concept definitions needed to support Mainflux SMS notifications.
notifiers/smtp
Package smtp contains the domain concept definitions needed to support Mainflux SMTP notifications.
Package smtp contains the domain concept definitions needed to support Mainflux SMTP notifications.
writers
Package writers contain the domain concept definitions needed to support Mainflux writer services functionality.
Package writers contain the domain concept definitions needed to support Mainflux writer services functionality.
writers/influxdb
Package influxdb contains the domain concept definitions needed to support Mainflux InfluxDB writer service functionality.
Package influxdb contains the domain concept definitions needed to support Mainflux InfluxDB writer service functionality.
writers/mongodb
Package mongodb contains the domain concept definitions needed to support Mainflux MondoDB writer service functionality.
Package mongodb contains the domain concept definitions needed to support Mainflux MondoDB writer service functionality.
writers/postgres
Package postgres contains repository implementations using Postgres as the underlying database.
Package postgres contains repository implementations using Postgres as the underlying database.
writers/timescale
Package timescale contains repository implementations using Timescale as the underlying database.
Package timescale contains repository implementations using Timescale as the underlying database.
Package http contains the domain concept definitions needed to support Mainflux http adapter service functionality.
Package http contains the domain concept definitions needed to support Mainflux http adapter service functionality.
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
Package logger contains logger API definition, wrapper that can be used around any other logger.
Package logger contains logger API definition, wrapper that can be used around any other logger.
api
api/http
Package http contains implementation of kit service HTTP API.
Package http contains implementation of kit service HTTP API.
redis
Package redis contains cache implementations using Redis as the underlying database.
Package redis contains cache implementations using Redis as the underlying database.
pkg
Package pkg contains library packages used by Mainflux services and external services that integrate with Mainflux.
Package pkg contains library packages used by Mainflux services and external services that integrate with Mainflux.
messaging/mqtt
Package mqtt hold the implementation of the Publisher and PubSub interfaces for the MQTT messaging system, the internal messaging broker of the Mainflux IoT platform.
Package mqtt hold the implementation of the Publisher and PubSub interfaces for the MQTT messaging system, the internal messaging broker of the Mainflux IoT platform.
messaging/nats
Package nats hold the implementation of the Publisher and PubSub interfaces for the NATS messaging system, the internal messaging broker of the Mainflux IoT platform.
Package nats hold the implementation of the Publisher and PubSub interfaces for the NATS messaging system, the internal messaging broker of the Mainflux IoT platform.
messaging/rabbitmq
Package rabbitmq holds the implementation of the Publisher and PubSub interfaces for the RabbitMQ messaging system, the internal messaging broker of the Mainflux IoT platform.
Package rabbitmq holds the implementation of the Publisher and PubSub interfaces for the RabbitMQ messaging system, the internal messaging broker of the Mainflux IoT platform.
transformers
Package transformers contains the domain concept definitions needed to support Mainflux transformer services functionality.
Package transformers contains the domain concept definitions needed to support Mainflux transformer services functionality.
ulid
Package ulid provides a ULID identity provider.
Package ulid provides a ULID identity provider.
uuid
Package uuid provides a UUID identity provider.
Package uuid provides a UUID identity provider.
api
influxdb
Package influxdb contains the domain concept definitions needed to support Mainflux InfluxDB reader service functionality.
Package influxdb contains the domain concept definitions needed to support Mainflux InfluxDB reader service functionality.
mongodb
Package mongodb contains the domain concept definitions needed to support Mainflux MondoDB reader service functionality.
Package mongodb contains the domain concept definitions needed to support Mainflux MondoDB reader service functionality.
postgres
Package postgres contains repository implementations using Postgres as the underlying database.
Package postgres contains repository implementations using Postgres as the underlying database.
timescale
Package timescale contains repository implementations using Timescale as the underlying database.
Package timescale contains repository implementations using Timescale as the underlying database.
Package things contains the domain concept definitions needed to support Mainflux things service functionality.
Package things contains the domain concept definitions needed to support Mainflux things service functionality.
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
api/grpc
Package grpc contains implementation of things service gRPC API.
Package grpc contains implementation of things service gRPC API.
api/http
Package http contains implementation of things service HTTP API.
Package http contains implementation of things service HTTP API.
postgres
Package postgres contains repository implementations using PostgreSQL as the underlying database.
Package postgres contains repository implementations using PostgreSQL as the underlying database.
redis
Package redis contains cache implementations using Redis as the underlying database.
Package redis contains cache implementations using Redis as the underlying database.
standalone
Package standalone contains implementation for auth service in single-user scenario.
Package standalone contains implementation for auth service in single-user scenario.
tracing
Package tracing contains middlewares that will add spans to existing traces.
Package tracing contains middlewares that will add spans to existing traces.
tools
api/grpc
Package grpc contains implementation of users service gRPC API.
Package grpc contains implementation of users service gRPC API.
api/http
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
bcrypt
Package bcrypt provides a hasher implementation utilizing bcrypt.
Package bcrypt provides a hasher implementation utilizing bcrypt.
postgres
Package postgres contains repository implementations using PostgreSQL as the underlying database.
Package postgres contains repository implementations using PostgreSQL as the underlying database.
tracing
Package tracing contains middlewares that will add spans to existing traces.
Package tracing contains middlewares that will add spans to existing traces.
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
api/http
Package http contains implementation of kit service HTTP API.
Package http contains implementation of kit service HTTP API.
ws
api
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL