mainflux

package module
v0.0.0-...-8a250b4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

TELLEE

Introduction

“Telle” mission - our platform connects rotating equipment to Cloud services or customer’s on-premises servers; collects and stores industrial data; analyzes machine performance with the help of machine-learning algorithms.

Moreover, Tellee is capable of connecting various industrial equipment and performing analysis to improve operational efficiency.

Modern industrial production implies the presence of automated technology process and lean business processes, which are evaluated based on integrated plant performance factors, such as cost of a single production unit, faulty production expenses, downtime expenses, costs related to delivery and storage of end products; efficiency and productivity of deployed equipment.

In the process of improving the productivity of the enterprise, machine learning and big data analysis are the key instruments that supplement classical methods of production optimization.

The most common examples of machine learning use include: increase in productivity of manufacturing activity as a result of equipment optimal operation mode selection; increase in end-product quality through diagnostics of critical factors that influence the end product; optimization of maintenance and repairs of expensive manufacturing equipment, predictive diagnostics and analysis of the reduction in efficiency of equipment; dynamic management of supply chain – optimization and forecasting of the procurement process, delivery, storage, demand and supply; comprehensive enhancement of production indexes by means of detecting implicit factors that affect the production process, deployment of new methods for equipment operation modelling with the use of digital technologies.

tellee

Mainflux

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

It accepts user and thing 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.

  • Protocol bridging (i.e. [HTTP](https://ru.wikipedia.org/wiki/HTTP), [MQTT](https://ru.wikipedia.org/wiki/MQTT), [WebSocket](https://ru.wikipedia.org/wiki/WebSocket), [CoAP](http://lib.tssonline.ru/articles2/internet-of-things/protokol-interneta-veschey-coap))
  • [Device management and provisioning](https://mainflux.readthedocs.io/en/latest/messaging/)
  • [Fine-grained access control](https://mainflux.readthedocs.io/en/latest/provisioning/)
  • [Platform logging and instrumentation support](https://mainflux.readthedocs.io/en/latest/storage/)
  • Container-based deployment using Docker [Docker](https://docs.docker.com/)
Components applied for the project.
  • users Manages platform's users and auth concerns
  • things Manages platform's things, channels and access policies
  • normalizer Normalizes SenML messages and generates the "processed" messages stream
  • http-adapter Provides an HTTP interface for accessing communication channels
  • mqtt-adapter Provides an MQTT interface for accessing communication channels
  • application
HTTP adapter

Representational State Transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Web services. Web services that conform to the REST architectural style, called RESTful Web services (RWS), provide interoperability between computer systems on the Internet. RESTful Web services allow the requesting systems to access and manipulate textual representations of Web resources by using a uniform and predefined set of stateless operations. Other kinds of Web services, such as SOAP Web services, expose their own arbitrary sets of operations.

"Web resources" were first defined on the World Wide Web as documents or files identified by their URLs. However, today they have a much more generic and abstract definition that encompasses every thing or entity that can be identified, named, addressed, or handled, in any way whatsoever, on the Web. In a RESTful Web service, requests made to a resource's URI will elicit a response with a payload formatted in HTML, XML, JSON, or some other format. The response can confirm that some alteration has been made to the stored resource, and the response can provide hypertext links to other related resources or collections of resources. When HTTP is used, as is most common, the operations (HTTP methods) available are GET, HEAD, POST, PUT, PATCH, DELETE, CONNECT, OPTIONS and TRACE.

MQTT Broker

The counterpart of the MQTT client is the MQTT broker. The broker is at the heart of any publish/subscribe protocol. Depending on the implementation, a broker can handle up to thousands of concurrently connected MQTT clients. The broker is responsible for receiving all messages, filtering the messages, determining who is subscribed to each message, and sending the message to these subscribed clients. The broker also holds the sessions of all persisted clients, including subscriptions and missed messages (more details). Another responsibility of the broker is the authentication and authorization of clients. Usually, the broker is extensible, which facilitates custom authentication, authorization, and integration into backend systems. Integration is particularly important because the broker is frequently the component that is directly exposed on the internet, handles a lot of clients, and needs to pass messages to downstream analyzing and processing systems.

MQTT adapter

To send and receive messages over MQTT you could use Mosquitto tools, or Paho if you want to use MQTT over WebSocket.

Bootstrap

Bootstrapping refers to a self-starting process that is supposed to proceed without external input. Mainflux platform supports bootstrapping process, but some of the preconditions need to be fulfilled in advance. The device can trigger a bootstrap when: - device contains only bootstrap credentials and no Mainflux credentials - device, for any reason, fails to start a communication with the configured Mainflux services (server not responding, authentication failure, etc..). - device, for any reason, wants to update its configuration

Bootstrapping and provisioning are two different procedures. Provisioning refers to entities management while bootstrapping is related to entity configuration.

Bootstrapping procedure is the following:

Configure device

  1. Configure device with Bootstrap service URL, an external key and external ID

Provision Mainflux channels Optionally create Mainflux channels if they don't exist

Provision Mainflux things Optionally create Mainflux thing if it doesn't exist

Upload configuration

  1. Upload configuration for the Mainflux thing

Bootstrap

  1. Bootstrap - send a request for the configuration

Update, enable/disable, remove

  1. Connect/disconnect thing from channels, update or remove configuration
Configuration

The configuration of Mainflux thing consists of three major parts:

  • The list of Mainflux channels the thing is connected to
  • Custom configuration related to the specific thing
  • Thing key and certificate data related to that thing

There are two more fields: external_id and external_key. External ID represents an ID of the device that corresponds to the given thing. For example, this can be a MAC address or the serial number of the device. The external key represents the device key. This is the secret key that's safely stored on the device and it is used to authorize the thing during the bootstrapping process. Please note that external ID and external key and Mainflux ID and Mainflux key are completely different concepts. External id and key are only used to authenticate a device that corresponds to the specific Mainflux thing during the bootstrapping procedure.

Provisioning

Provisioning is a process of configuration of an IoT platform in which system operator creates and sets-up different entities used in the platform - users, channels and things.

Access control
Provisioning things

Create/delete/change name and so on

Provisioning applications

Create/delete/change name and so on

NATS

NATS was built to meet the distributed computing needs of today and tomorrow. NATS is simple and secure messaging made for developers and operators who want to spend more time developing modern applications and services than worrying about a distributed communication system.

  • Easy to use for developers and operators
  • High-Performance
  • Always on and available
  • Extremely lightweight
  • At Most Once and At Least Once Delivery
  • Support for Observable and Scalable Services and Event/Data Streams
  • Client support for over 30 different programming languages
  • Cloud Native, a CNCF project with Kubernetes and Prometheus integrations
Influxdb

InfluxDB is the open source time series database that is part of the TICK (Telegraf, InfluxDB, Chronograf, Kapacitor) stack.

InfluxDB is a high-performance data store written specifically for time series data. It allows for high throughput ingest, compression and real-time querying. InfluxDB is written entirely in Go and compiles into a single binary with no external dependencies. It provides write and query capabilities with a command-line interface, a built-in HTTP API, a set of client libraries (e.g., Go, Java, and JavaScript) and plugins for common data formats such as Telegraf, Graphite, Collectd and OpenTSDB.

InfluxDB works with InfluxQL, a SQL-like query language for interacting with data. It has been lovingly crafted to feel familiar to those coming from other SQL or SQL-like environments while also providing features specific to storing and analyzing time series data. InfluxQL supports regular expressions, arithmetic expressions, and time series-specific functions to speed up data processing.

Faceplate

Faceplate is used to develop a human-machine interface, through which the operator controls the technological processes performing at the control object. The operator’s workplace can be a personal computer, a tablet or a smartphone. The systems for developing a human-machine interface are often called SCADA systems.

In general, the process of developing a ‘scada’ system using Faceplate, can be represented in the form of the following steps:

  • Creating a logical structure of the project, the definition of controlled points - tags. (see Tag editor ).
  • Creating mnemonics (see Graphic editor)
  • Creating connections to controllers and defining of the bindings (see Соnnections )
  • Configuring the messages system (see Messages system ).
  • Configuring the archiving system (see Archiving System ).

In systems where the object is controlled by more than one operator, which may have different levels of access to the object, the access rights of operators are set up (see User rights management ).

For systems where hot backup and/or participation of several servers is required, the servers connected to the system are configured, and functions are distributed between them (see Configuring servers ).

The reporting forms setting up that allow to aggregate the various activated information in an easy-to-read form, are performed using the Report Editor .

The development of additional software modules, executed by the server in runtime mode, is performed using the Script Editor .

Faceplate can be used to process in real-time mode the video streams, coming from video cameras. The subsystem allows to broadcast a video stream to mnemonic diagrams, as well as to determine the movement appearance and the reaction to it. See Working with video.

Support of multilingual interfaces is described in the section Development of multilanguage projects.

Tensorflow serving APP

TensorFlow Serving

TensorFlow Serving is a flexible, high-performance serving system for machine learning models, designed for production environments. TensorFlow Serving makes it easy to deploy new algorithms and experiments, while keeping the same server architecture and APIs. TensorFlow Serving provides out-of-the-box integration with TensorFlow models, but can be easily extended to serve other types of models and data.

Detailed developer documentation on TensorFlow Serving is available:

  • [Architecture Overview](https://www.tensorflow.org/tfx/serving/architecture)
  • [Server API](https://www.tensorflow.org/tfx/serving/api_docs/cc/)
  • [REST Client API](https://www.tensorflow.org/tfx/serving/api_rest)
Protobuf

Protocol Buffers (Protobuf) is a method of serializing structured data. It is useful in developing programs to communicate with each other over a wire or for storing data. The method involves an interface description language that describes the structure of some data and a program that generates source code from that description for generating or parsing a stream of bytes that represents the structured data.

Google developed Protocol Buffers for use internally and has provided a code generator for multiple languages under an open source license.

TFS MQTTT Agent

If I choose a second option, I need an additional component — Web server to host TensorFlow Serving client. I will use sample GAN model that hosted by a TensorFlow server in a Docker container as backend. I will create a simple Flask application with TensorFlow client and dockerize it. For convenience the application will provide Swagger documentation for our simple REST API. Our REST API will have a single resource prediction with a single operation POST on it. It expects an image as an input parameter and returns JSON object with 3 most probable digits and their probabilities for Street View House Numbers. Here I extracted a couple of images for tests.

We have created a Web application that provides public REST API for Street View House Numbers prediction. This is a Flask web application that is, effectively, an adapter of TensorFlow Serving capabilities. It hosts TensorFlow Serving client, transforms HTTP(S) REST requests into protobufs and forwards them to a TensorFlow Serving server via gRPC. TensorFlow server, in its turn, host a GAN model, which do, actually, a prediction job.

Introduced architecture benefits from using of an effective communication (gRPC + protobufs) between internal services and exposes a public REST API for external use.

Keycloak

Keycloak is an open source Identity and Access Management solution aimed at modern applications and services. It makes it easy to secure applications and services with little to no code.

This page gives a brief introduction to Keycloak and some of the features. For a full list of features refer to the documentation.

Trying Keycloak is quick and easy. Take a look at the Getting Started tutorial for details.

Users authenticate with Keycloak rather than individual applications. This means that your applications don't have to deal with login forms, authenticating users, and storing users. Once logged-in to Keycloak, users don't have to login again to access a different application.

Through the admin console administrators can centrally manage all aspects of the Keycloak server.

Chronograf

Chronograf is InfluxData’s open source web application. Use Chronograf with the other components of the TICK stack to visualize your monitoring data and easily create alerting and automation rules.

Key features
Infrastructure monitoring
  • View all hosts and their statuses in your infrastructure
  • View the configured applications on each host
  • Monitor your applications with Chronograf’s pre-created dashboards
Alert management

Chronograf offers a UI for Kapacitor, InfluxData’s data processing framework for creating alerts, running ETL jobs, and detecting anomalies in your data.

  • Generate threshold, relative, and deadman alerts on your data
  • Easily enable and disable existing alert rules
  • View all active alerts on an alert dashboard
  • Send alerts to the supported event handlers, including Slack, PagerDuty, HipChat, and more
Data visualization
  • Monitor your application data with Chronograf’s pre-created dashboards
  • Create your own customized dashboards complete with various graph types and template variables
  • Investigate your data with Chronograf’s data explorer and query templates
Database management
  • Create and delete databases and retention policies
  • View currently-running queries and stop inefficient queries from overloading your system
  • Create, delete, and assign permissions to users (Chronograf supports InfluxDB OSS and InfluxEnterprise user management)
Multi-organization and multi-user support
  • Create organizations and assign users to those organizations
  • Restrict access to administrative functions
  • Allow users to set up and maintain unique dashboards for their organizations

Mainflux Admin Panel

The administrative panel (AP) is designed for convenient management of Things, Channels and Users Mainflux. The AP is an interface and API (through which it interacts with Mainflux and Bootstrap). The main task of the AP is to configure for certain types of devices, for their further work with Bootstrap. The Mainflux Admin Panel will work with the OIDC Keycloak provider to distribute AP users by organization (only members of one organization can view the configuration for devices belonging to there organization).

Functional description

Tellen Edge can transmit and receive data from most of the industrial sources that include: sensors, Programmable Logic Controllers, SCADA/ICS systems, MES systems and corporate EAM (Enterprise Asset Management) systems. Depending on the configuration, data can be transmitted directly to Tellee or via Telle Edge.

Telle’s architecture is based on the microservices ideology that enables a secure and easily scalable environment for data processing and comprehensive analysis. One of Telle’s strongest assets is the proactive approach to emergencies and process alarms that’s in the core of the platform.

Generally, this is the sequence of the platform’s operation:

  • Edge Connection- connect industrial equipment and other data sources
  • Data processing- monitor data, visualize efficiency, analyze anomalies, perform predictive diagnostics
  • Analysis and following action- manage and optimize the production process, increase KPI and OEE
    • tellee1

      TELLEE EDGE

      Telle Edge receives and transmits data to Tellee and allows integration of trained machine learning models into local systems for analysis of source information. Telle Edge supports various platforms and operating systems. It can operate on both ARM and Intel processors. Security is ensured by data encryption and token-based system that issues unique tokens to each edge device. Support for industrial data protocols such as Modbus, Modbus TCP/IP, OPC DA, OPC UA. Telle edge is capable of buffering data and in case of a connection interruption, it will synchronize all the buffered data as soon as the connection is up again. A variable schema for storage of structured or unstructured data. Tools for creation and configuration of connections to the equipment. Role-based authentication configuration at the Edge level. User authentication at the Edge level uses 128-bit password hashing algorithm.

      tellee2

      TELLE λ (lambda) - Service

      Tellee is capable of forecasting equipment operation, providing all the necessary information regarding the technology process that is compiled from the PLC data.

      Main stages of machine learning models integration

      • Assigning the objectives and conditions for models of successful operation
      • Definition of metrics and criteria for conformance of models to real-life equipment
      • Rating of data accessibility, processing of data
      • Selection of type of models and methods of machine learning. Training and testing of models
      • Deployment, support, update and if necessary retraining of models

      tellee3

      reprocessing and trimmings of the data are crucial for the correct utilization of data for machine learning. Unprocessed data are often distorted and unreliable. Employing this kind of data during the building of models might lead to incorrect results. These steps are a part of the processing stage and often implicate the initial examination of data.

      Research of normal equipment operation patterns in comparison to abnormal operation and screening of features that define the model structure.

      Development of equipment operation model, design of infrastructure, classification of common factors, the combinations of various types of models, equipment failure probability forecasting. Research of possible way to deliver alarms that contain forecasted equipment failure possibility.

      Deployment of a trained model into production. Depending on a customer request, it can be deployed either in the cloud or at the edge device. Machine learning models are limited only to computational resources of a device they are deployed on and in some cases by the speed of data transfer.

      Flash, UX/UI

      Telle Flash user interface provides industry-ready IoT visualization that allows event management without the need for any additional software.

      Flash’s Integrated toolkit allows users to monitor equipment operation, analyze anomalies and events. Machine Learning analytics provide predictive alarms that can help operating staff take preventive action to minimize the effects of abnormality early on. Moreover, users can dissect the abnormality in order to get to the root of the problem.

      Criticality analysis enables users to set their priorities in relation to the importance of enterprise assets

      User interface elements are optimized for long hour shifts. Operators can switch between dark and light themes depending on their preferences. Color palette is adjusted in a way that minimizes eye strain but at the same time delivers information efficiently.

      FLash was developed based on the open source project Chronograf. Flash, is a visualization environment for data coming from the InfluxDB database from the Mainflux stack. For Single-Sign-On (SSO), authentication, and user authorization, OIDC Keycloak is integrated into Flash. The Flash graphical components are based on libraries:

      tellee4

      Bootstarping

      Bootstrapping refers to a self-starting process that is supposed to proceed without external input. Currently, the bootstrapping procedure is executed over the HTTP protocol. Bootstrapping is nothing else but fetching and applying the configuration that corresponds to the given Tellee things.

      The platform supports bootstrapping process, but some of the preconditions need to be fulfilled in advance. The device can trigger a bootstrap when:

      • the device contains only bootstrap credentials and no Tellee credentials
      • the device, for any reason, fails to start a communication with the configured services (server not responding, authentication failure, etc..).
      • the device, for any reason, wants to update its configuration

      tellee5

      Installation

      Deployment of Influx services based on docker containers. Detailed procedure to be provided

      Tellee start procedure Detailed procedure to be provided

Documentation

Overview

Package mainflux acts as an umbrella package containing multiple different microservices and defines all shared domain concepts.

Index

Constants

View Source
const OutputSenML = "out.senml"

OutputSenML represents subject SenML messages will be published to.

Variables

View Source
var (
	ErrInvalidLengthInternal = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowInternal   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthMessage = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMessage   = fmt.Errorf("proto: integer overflow")
)

Functions

func Env

func Env(key, fallback string) string

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

func RegisterThingsServiceServer

func RegisterThingsServiceServer(s *grpc.Server, srv ThingsServiceServer)

func RegisterUsersServiceServer

func RegisterUsersServiceServer(s *grpc.Server, srv UsersServiceServer)

func Version

func Version(service string) http.HandlerFunc

Version exposes an HTTP handler for retrieving service version.

Types

type AccessReq

type AccessReq struct {
	Token                string   `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	ChanID               string   `protobuf:"bytes,2,opt,name=chanID,proto3" json:"chanID,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AccessReq) Descriptor

func (*AccessReq) Descriptor() ([]byte, []int)

func (*AccessReq) GetChanID

func (m *AccessReq) GetChanID() string

func (*AccessReq) GetToken

func (m *AccessReq) GetToken() string

func (*AccessReq) Marshal

func (m *AccessReq) Marshal() (dAtA []byte, err error)

func (*AccessReq) MarshalTo

func (m *AccessReq) MarshalTo(dAtA []byte) (int, error)

func (*AccessReq) ProtoMessage

func (*AccessReq) ProtoMessage()

func (*AccessReq) Reset

func (m *AccessReq) Reset()

func (*AccessReq) Size

func (m *AccessReq) Size() (n int)

func (*AccessReq) String

func (m *AccessReq) String() string

func (*AccessReq) Unmarshal

func (m *AccessReq) Unmarshal(dAtA []byte) error

func (*AccessReq) XXX_DiscardUnknown

func (m *AccessReq) XXX_DiscardUnknown()

func (*AccessReq) XXX_Marshal

func (m *AccessReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AccessReq) XXX_Merge

func (m *AccessReq) XXX_Merge(src proto.Message)

func (*AccessReq) XXX_Size

func (m *AccessReq) XXX_Size() int

func (*AccessReq) XXX_Unmarshal

func (m *AccessReq) XXX_Unmarshal(b []byte) error

type Message

type Message struct {
	Channel   string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
	Subtopic  string `protobuf:"bytes,2,opt,name=subtopic,proto3" json:"subtopic,omitempty"`
	Publisher string `protobuf:"bytes,3,opt,name=publisher,proto3" json:"publisher,omitempty"`
	Protocol  string `protobuf:"bytes,4,opt,name=protocol,proto3" json:"protocol,omitempty"`
	Name      string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
	Unit      string `protobuf:"bytes,6,opt,name=unit,proto3" json:"unit,omitempty"`
	// Types that are valid to be assigned to Value:
	//	*Message_FloatValue
	//	*Message_StringValue
	//	*Message_BoolValue
	//	*Message_DataValue
	Value                isMessage_Value `protobuf_oneof:"value"`
	ValueSum             *SumValue       `protobuf:"bytes,11,opt,name=valueSum,proto3" json:"valueSum,omitempty"`
	Time                 float64         `protobuf:"fixed64,12,opt,name=time,proto3" json:"time,omitempty"`
	UpdateTime           float64         `protobuf:"fixed64,13,opt,name=updateTime,proto3" json:"updateTime,omitempty"`
	Link                 string          `protobuf:"bytes,14,opt,name=link,proto3" json:"link,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

Message represents a resolved (normalized) raw message.

func (*Message) Descriptor

func (*Message) Descriptor() ([]byte, []int)

func (*Message) GetBoolValue

func (m *Message) GetBoolValue() bool

func (*Message) GetChannel

func (m *Message) GetChannel() string

func (*Message) GetDataValue

func (m *Message) GetDataValue() string

func (*Message) GetFloatValue

func (m *Message) GetFloatValue() float64
func (m *Message) GetLink() string

func (*Message) GetName

func (m *Message) GetName() string

func (*Message) GetProtocol

func (m *Message) GetProtocol() string

func (*Message) GetPublisher

func (m *Message) GetPublisher() string

func (*Message) GetStringValue

func (m *Message) GetStringValue() string

func (*Message) GetSubtopic

func (m *Message) GetSubtopic() string

func (*Message) GetTime

func (m *Message) GetTime() float64

func (*Message) GetUnit

func (m *Message) GetUnit() string

func (*Message) GetUpdateTime

func (m *Message) GetUpdateTime() float64

func (*Message) GetValue

func (m *Message) GetValue() isMessage_Value

func (*Message) GetValueSum

func (m *Message) GetValueSum() *SumValue

func (*Message) Marshal

func (m *Message) Marshal() (dAtA []byte, err error)

func (Message) MarshalJSON

func (m Message) MarshalJSON() ([]byte, error)

MarshalJSON method is used by `json` package to serialize Message.

func (*Message) MarshalTo

func (m *Message) MarshalTo(dAtA []byte) (int, error)

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) Size

func (m *Message) Size() (n int)

func (*Message) String

func (m *Message) String() string

func (*Message) Unmarshal

func (m *Message) Unmarshal(dAtA []byte) error

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(data []byte) error

UnmarshalJSON method is used by `json` package to unmarshal data to Message.

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Message) XXX_Merge

func (m *Message) XXX_Merge(src proto.Message)

func (*Message) XXX_OneofFuncs

func (*Message) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

func (m *Message) XXX_Unmarshal(b []byte) error

type MessagePublisher

type MessagePublisher interface {
	// Publishes message to the stream. A non-nil error is returned to indicate
	// operation failure.
	Publish(RawMessage) error
}

MessagePublisher specifies a message publishing API.

type Message_BoolValue

type Message_BoolValue struct {
	BoolValue bool `protobuf:"varint,9,opt,name=boolValue,proto3,oneof"`
}

func (*Message_BoolValue) MarshalTo

func (m *Message_BoolValue) MarshalTo(dAtA []byte) (int, error)

func (*Message_BoolValue) Size

func (m *Message_BoolValue) Size() (n int)

type Message_DataValue

type Message_DataValue struct {
	DataValue string `protobuf:"bytes,10,opt,name=dataValue,proto3,oneof"`
}

func (*Message_DataValue) MarshalTo

func (m *Message_DataValue) MarshalTo(dAtA []byte) (int, error)

func (*Message_DataValue) Size

func (m *Message_DataValue) Size() (n int)

type Message_FloatValue

type Message_FloatValue struct {
	FloatValue float64 `protobuf:"fixed64,7,opt,name=floatValue,proto3,oneof"`
}

func (*Message_FloatValue) MarshalTo

func (m *Message_FloatValue) MarshalTo(dAtA []byte) (int, error)

func (*Message_FloatValue) Size

func (m *Message_FloatValue) Size() (n int)

type Message_StringValue

type Message_StringValue struct {
	StringValue string `protobuf:"bytes,8,opt,name=stringValue,proto3,oneof"`
}

func (*Message_StringValue) MarshalTo

func (m *Message_StringValue) MarshalTo(dAtA []byte) (int, error)

func (*Message_StringValue) Size

func (m *Message_StringValue) Size() (n int)

type RawMessage

type RawMessage struct {
	Channel              string   `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
	Subtopic             string   `protobuf:"bytes,2,opt,name=subtopic,proto3" json:"subtopic,omitempty"`
	Publisher            string   `protobuf:"bytes,3,opt,name=publisher,proto3" json:"publisher,omitempty"`
	Protocol             string   `protobuf:"bytes,4,opt,name=protocol,proto3" json:"protocol,omitempty"`
	ContentType          string   `protobuf:"bytes,5,opt,name=contentType,proto3" json:"contentType,omitempty"`
	Payload              []byte   `protobuf:"bytes,6,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

RawMessage represents a message emitted by the Mainflux adapters layer.

func (*RawMessage) Descriptor

func (*RawMessage) Descriptor() ([]byte, []int)

func (*RawMessage) GetChannel

func (m *RawMessage) GetChannel() string

func (*RawMessage) GetContentType

func (m *RawMessage) GetContentType() string

func (*RawMessage) GetPayload

func (m *RawMessage) GetPayload() []byte

func (*RawMessage) GetProtocol

func (m *RawMessage) GetProtocol() string

func (*RawMessage) GetPublisher

func (m *RawMessage) GetPublisher() string

func (*RawMessage) GetSubtopic

func (m *RawMessage) GetSubtopic() string

func (*RawMessage) Marshal

func (m *RawMessage) Marshal() (dAtA []byte, err error)

func (*RawMessage) MarshalTo

func (m *RawMessage) MarshalTo(dAtA []byte) (int, error)

func (*RawMessage) ProtoMessage

func (*RawMessage) ProtoMessage()

func (*RawMessage) Reset

func (m *RawMessage) Reset()

func (*RawMessage) Size

func (m *RawMessage) Size() (n int)

func (*RawMessage) String

func (m *RawMessage) String() string

func (*RawMessage) Unmarshal

func (m *RawMessage) Unmarshal(dAtA []byte) error

func (*RawMessage) XXX_DiscardUnknown

func (m *RawMessage) XXX_DiscardUnknown()

func (*RawMessage) XXX_Marshal

func (m *RawMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RawMessage) XXX_Merge

func (m *RawMessage) XXX_Merge(src proto.Message)

func (*RawMessage) XXX_Size

func (m *RawMessage) XXX_Size() int

func (*RawMessage) XXX_Unmarshal

func (m *RawMessage) XXX_Unmarshal(b []byte) error

type Response

type Response interface {
	// Code returns HTTP response code.
	Code() int

	// Headers returns map of HTTP headers with their values.
	Headers() map[string]string

	// Empty indicates if HTTP response has content.
	Empty() bool
}

Response contains HTTP response specific methods.

type SumValue

type SumValue struct {
	Value                float64  `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

SumValue is a simple wrapper around the double value.

func (*SumValue) Descriptor

func (*SumValue) Descriptor() ([]byte, []int)

func (*SumValue) GetValue

func (m *SumValue) GetValue() float64

func (*SumValue) Marshal

func (m *SumValue) Marshal() (dAtA []byte, err error)

func (*SumValue) MarshalTo

func (m *SumValue) MarshalTo(dAtA []byte) (int, error)

func (*SumValue) ProtoMessage

func (*SumValue) ProtoMessage()

func (*SumValue) Reset

func (m *SumValue) Reset()

func (*SumValue) Size

func (m *SumValue) Size() (n int)

func (*SumValue) String

func (m *SumValue) String() string

func (*SumValue) Unmarshal

func (m *SumValue) Unmarshal(dAtA []byte) error

func (*SumValue) XXX_DiscardUnknown

func (m *SumValue) XXX_DiscardUnknown()

func (*SumValue) XXX_Marshal

func (m *SumValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SumValue) XXX_Merge

func (m *SumValue) XXX_Merge(src proto.Message)

func (*SumValue) XXX_Size

func (m *SumValue) XXX_Size() int

func (*SumValue) XXX_Unmarshal

func (m *SumValue) XXX_Unmarshal(b []byte) error

type ThingID

type ThingID struct {
	Value                string   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ThingID) Descriptor

func (*ThingID) Descriptor() ([]byte, []int)

func (*ThingID) GetValue

func (m *ThingID) GetValue() string

func (*ThingID) Marshal

func (m *ThingID) Marshal() (dAtA []byte, err error)

func (*ThingID) MarshalTo

func (m *ThingID) MarshalTo(dAtA []byte) (int, error)

func (*ThingID) ProtoMessage

func (*ThingID) ProtoMessage()

func (*ThingID) Reset

func (m *ThingID) Reset()

func (*ThingID) Size

func (m *ThingID) Size() (n int)

func (*ThingID) String

func (m *ThingID) String() string

func (*ThingID) Unmarshal

func (m *ThingID) Unmarshal(dAtA []byte) error

func (*ThingID) XXX_DiscardUnknown

func (m *ThingID) XXX_DiscardUnknown()

func (*ThingID) XXX_Marshal

func (m *ThingID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ThingID) XXX_Merge

func (m *ThingID) XXX_Merge(src proto.Message)

func (*ThingID) XXX_Size

func (m *ThingID) XXX_Size() int

func (*ThingID) XXX_Unmarshal

func (m *ThingID) XXX_Unmarshal(b []byte) error

type ThingsServiceClient

type ThingsServiceClient interface {
	CanAccess(ctx context.Context, in *AccessReq, opts ...grpc.CallOption) (*ThingID, error)
	Identify(ctx context.Context, in *Token, opts ...grpc.CallOption) (*ThingID, error)
}

ThingsServiceClient is the client API for ThingsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewThingsServiceClient

func NewThingsServiceClient(cc *grpc.ClientConn) ThingsServiceClient

type ThingsServiceServer

type ThingsServiceServer interface {
	CanAccess(context.Context, *AccessReq) (*ThingID, error)
	Identify(context.Context, *Token) (*ThingID, error)
}

ThingsServiceServer is the server API for ThingsService service.

type Token

type Token struct {
	Value                string   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Token) Descriptor

func (*Token) Descriptor() ([]byte, []int)

func (*Token) GetValue

func (m *Token) GetValue() string

func (*Token) Marshal

func (m *Token) Marshal() (dAtA []byte, err error)

func (*Token) MarshalTo

func (m *Token) MarshalTo(dAtA []byte) (int, error)

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) Reset

func (m *Token) Reset()

func (*Token) Size

func (m *Token) Size() (n int)

func (*Token) String

func (m *Token) String() string

func (*Token) Unmarshal

func (m *Token) Unmarshal(dAtA []byte) error

func (*Token) XXX_DiscardUnknown

func (m *Token) XXX_DiscardUnknown()

func (*Token) XXX_Marshal

func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Token) XXX_Merge

func (m *Token) XXX_Merge(src proto.Message)

func (*Token) XXX_Size

func (m *Token) XXX_Size() int

func (*Token) XXX_Unmarshal

func (m *Token) XXX_Unmarshal(b []byte) error

type UserID

type UserID struct {
	Value                string   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UserID) Descriptor

func (*UserID) Descriptor() ([]byte, []int)

func (*UserID) GetValue

func (m *UserID) GetValue() string

func (*UserID) Marshal

func (m *UserID) Marshal() (dAtA []byte, err error)

func (*UserID) MarshalTo

func (m *UserID) MarshalTo(dAtA []byte) (int, error)

func (*UserID) ProtoMessage

func (*UserID) ProtoMessage()

func (*UserID) Reset

func (m *UserID) Reset()

func (*UserID) Size

func (m *UserID) Size() (n int)

func (*UserID) String

func (m *UserID) String() string

func (*UserID) Unmarshal

func (m *UserID) Unmarshal(dAtA []byte) error

func (*UserID) XXX_DiscardUnknown

func (m *UserID) XXX_DiscardUnknown()

func (*UserID) XXX_Marshal

func (m *UserID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UserID) XXX_Merge

func (m *UserID) XXX_Merge(src proto.Message)

func (*UserID) XXX_Size

func (m *UserID) XXX_Size() int

func (*UserID) XXX_Unmarshal

func (m *UserID) XXX_Unmarshal(b []byte) error

type UsersServiceClient

type UsersServiceClient interface {
	Identify(ctx context.Context, in *Token, opts ...grpc.CallOption) (*UserID, error)
}

UsersServiceClient is the client API for UsersService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewUsersServiceClient

func NewUsersServiceClient(cc *grpc.ClientConn) UsersServiceClient

type UsersServiceServer

type UsersServiceServer interface {
	Identify(context.Context, *Token) (*UserID, error)
}

UsersServiceServer is the server API for UsersService service.

type VersionInfo

type VersionInfo struct {
	Service string `json:"service"`
	Version string `json:"version"`
}

Directories

Path Synopsis
Package bootstrap contains the domain concept definitions needed to support Mainflux bootstrap service functionality.
Package bootstrap contains the domain concept definitions needed to support Mainflux bootstrap service functionality.
api
Package api contains implementation of bootstrap service HTTP API.
Package api contains implementation of bootstrap 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/consumer
Package consumer contains events consumer for events published by Things service.
Package consumer contains events consumer for events published by Things service.
redis/producer
Package producer contains the domain events needed to support event sourcing of Bootstrap service actions.
Package producer contains the domain events needed to support event sourcing of Bootstrap service actions.
cmd
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.
nats
Package nats contains NATS message publisher implementation.
Package nats contains NATS message publisher implementation.
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.
nats
Package nats contains NATS message publisher implementation.
Package nats contains NATS message publisher implementation.
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
nats
Package nats contains NATS message publisher implementation.
Package nats contains NATS message publisher implementation.
Package normalizer contains the domain concept definitions needed to support Mainflux normalizer service functionality.
Package normalizer contains the domain concept definitions needed to support Mainflux normalizer service functionality.
api
api
cassandra
Package cassandra contains Cassandra specific reader implementation.
Package cassandra contains Cassandra specific reader implementation.
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.
sdk
go
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.
uuid
Package uuid provides a UUID identity provider.
Package uuid provides a UUID identity provider.
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 users service gRPC API.
Package grpc contains implementation of users service gRPC API.
api/http
Package http contains implementation of users service HTTP API.
Package http contains implementation of users service HTTP API.
bcrypt
Package bcrypt provides a hasher implementation utilising bcrypt.
Package bcrypt provides a hasher implementation utilising bcrypt.
jwt
Package jwt provides a JWT identity provider.
Package jwt provides a JWT identity provider.
postgres
Package postgres contains repository implementations using PostgreSQL as the underlying database.
Package postgres contains repository implementations using PostgreSQL as the underlying database.
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.
cassandra
Package cassandra contains the domain concept definitions needed to support Mainflux Cassandra writer service.
Package cassandra contains the domain concept definitions needed to support Mainflux Cassandra writer service.
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.
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.
ws
Package ws contains the domain concept definitions needed to support Mainflux ws adapter service functionality.
Package ws contains the domain concept definitions needed to support Mainflux ws 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.
nats
Package nats contains NATS message publisher implementation.
Package nats contains NATS message publisher implementation.

Jump to

Keyboard shortcuts

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