Documentation ¶
Overview ¶
Package mainflux acts as an umbrella package containing multiple different microservices and defines all shared domain concepts.
Index ¶
- Variables
- func Env(key, fallback string) string
- func LoadEnvFile(envfilepath string) error
- func RegisterAuthNServiceServer(s *grpc.Server, srv AuthNServiceServer)
- func RegisterThingsServiceServer(s *grpc.Server, srv ThingsServiceServer)
- func Version(service string) http.HandlerFunc
- type AccessByIThingsServiceClientDReq
- type AccessByKeyReq
- func (*AccessByKeyReq) Descriptor() ([]byte, []int)
- func (m *AccessByKeyReq) GetChanID() string
- func (m *AccessByKeyReq) GetToken() string
- func (m *AccessByKeyReq) Marshal() (dAtA []byte, err error)
- func (m *AccessByKeyReq) MarshalTo(dAtA []byte) (int, error)
- func (m *AccessByKeyReq) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*AccessByKeyReq) ProtoMessage()
- func (m *AccessByKeyReq) Reset()
- func (m *AccessByKeyReq) Size() (n int)
- func (m *AccessByKeyReq) String() string
- func (m *AccessByKeyReq) Unmarshal(dAtA []byte) error
- func (m *AccessByKeyReq) XXX_DiscardUnknown()
- func (m *AccessByKeyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AccessByKeyReq) XXX_Merge(src proto.Message)
- func (m *AccessByKeyReq) XXX_Size() int
- func (m *AccessByKeyReq) XXX_Unmarshal(b []byte) error
- type AuthNServiceClient
- type AuthNServiceServer
- type IssueReq
- func (*IssueReq) Descriptor() ([]byte, []int)
- func (m *IssueReq) GetIssuer() string
- func (m *IssueReq) GetType() uint32
- func (m *IssueReq) Marshal() (dAtA []byte, err error)
- func (m *IssueReq) MarshalTo(dAtA []byte) (int, error)
- func (m *IssueReq) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*IssueReq) ProtoMessage()
- func (m *IssueReq) Reset()
- func (m *IssueReq) Size() (n int)
- func (m *IssueReq) String() string
- func (m *IssueReq) Unmarshal(dAtA []byte) error
- func (m *IssueReq) XXX_DiscardUnknown()
- func (m *IssueReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *IssueReq) XXX_Merge(src proto.Message)
- func (m *IssueReq) XXX_Size() int
- func (m *IssueReq) XXX_Unmarshal(b []byte) error
- type Response
- type ThingID
- func (*ThingID) Descriptor() ([]byte, []int)
- func (m *ThingID) GetValue() string
- func (m *ThingID) Marshal() (dAtA []byte, err error)
- func (m *ThingID) MarshalTo(dAtA []byte) (int, error)
- func (m *ThingID) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ThingID) ProtoMessage()
- func (m *ThingID) Reset()
- func (m *ThingID) Size() (n int)
- func (m *ThingID) String() string
- func (m *ThingID) Unmarshal(dAtA []byte) error
- func (m *ThingID) XXX_DiscardUnknown()
- func (m *ThingID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ThingID) XXX_Merge(src proto.Message)
- func (m *ThingID) XXX_Size() int
- func (m *ThingID) XXX_Unmarshal(b []byte) error
- type ThingsServiceClient
- type ThingsServiceServer
- type Token
- func (*Token) Descriptor() ([]byte, []int)
- func (m *Token) GetValue() string
- func (m *Token) Marshal() (dAtA []byte, err error)
- func (m *Token) MarshalTo(dAtA []byte) (int, error)
- func (m *Token) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Token) ProtoMessage()
- func (m *Token) Reset()
- func (m *Token) Size() (n int)
- func (m *Token) String() string
- func (m *Token) Unmarshal(dAtA []byte) error
- func (m *Token) XXX_DiscardUnknown()
- func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Token) XXX_Merge(src proto.Message)
- func (m *Token) XXX_Size() int
- func (m *Token) XXX_Unmarshal(b []byte) error
- type UUIDProvider
- type UnimplementedAuthNServiceServer
- type UnimplementedThingsServiceServer
- func (*UnimplementedThingsServiceServer) CanAccessByID(ctx context.Context, req *AccessByIDReq) (*empty.Empty, error)
- func (*UnimplementedThingsServiceServer) CanAccessByKey(ctx context.Context, req *AccessByKeyReq) (*ThingID, error)
- func (*UnimplementedThingsServiceServer) Identify(ctx context.Context, req *Token) (*ThingID, error)
- type UserID
- func (*UserID) Descriptor() ([]byte, []int)
- func (m *UserID) GetValue() string
- func (m *UserID) Marshal() (dAtA []byte, err error)
- func (m *UserID) MarshalTo(dAtA []byte) (int, error)
- func (m *UserID) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*UserID) ProtoMessage()
- func (m *UserID) Reset()
- func (m *UserID) Size() (n int)
- func (m *UserID) String() string
- func (m *UserID) Unmarshal(dAtA []byte) error
- func (m *UserID) XXX_DiscardUnknown()
- func (m *UserID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UserID) XXX_Merge(src proto.Message)
- func (m *UserID) XXX_Size() int
- func (m *UserID) XXX_Unmarshal(b []byte) error
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Env ¶
Env reads specified environment variable. If no value has been found, fallback is returned.
func LoadEnvFile ¶
LoadEnvFile loads environment variables defined in an .env formatted file.
func RegisterAuthNServiceServer ¶
func RegisterAuthNServiceServer(s *grpc.Server, srv AuthNServiceServer)
func RegisterThingsServiceServer ¶
func RegisterThingsServiceServer(s *grpc.Server, srv ThingsServiceServer)
func Version ¶
func Version(service string) http.HandlerFunc
Version exposes an HTTP handler for retrieving service version.
Types ¶
type AccessByIThingsServiceClientDReq ¶
type AccessByIThingsServiceClientDReq struct { ThingID string `protobuf:"bytes,1,opt,name=thingID,proto3" json:"thingID,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:"-"` }
type AccessByKeyReq ¶
type AccessByKeyReq 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 (*AccessByKeyReq) Descriptor ¶
func (*AccessByKeyReq) Descriptor() ([]byte, []int)
func (*AccessByKeyReq) GetChanID ¶
func (m *AccessByKeyReq) GetChanID() string
func (*AccessByKeyReq) GetToken ¶
func (m *AccessByKeyReq) GetToken() string
func (*AccessByKeyReq) Marshal ¶
func (m *AccessByKeyReq) Marshal() (dAtA []byte, err error)
func (*AccessByKeyReq) MarshalToSizedBuffer ¶
func (m *AccessByKeyReq) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*AccessByKeyReq) ProtoMessage ¶
func (*AccessByKeyReq) ProtoMessage()
func (*AccessByKeyReq) Reset ¶
func (m *AccessByKeyReq) Reset()
func (*AccessByKeyReq) Size ¶
func (m *AccessByKeyReq) Size() (n int)
func (*AccessByKeyReq) String ¶
func (m *AccessByKeyReq) String() string
func (*AccessByKeyReq) Unmarshal ¶
func (m *AccessByKeyReq) Unmarshal(dAtA []byte) error
func (*AccessByKeyReq) XXX_DiscardUnknown ¶
func (m *AccessByKeyReq) XXX_DiscardUnknown()
func (*AccessByKeyReq) XXX_Marshal ¶
func (m *AccessByKeyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AccessByKeyReq) XXX_Merge ¶
func (m *AccessByKeyReq) XXX_Merge(src proto.Message)
func (*AccessByKeyReq) XXX_Size ¶
func (m *AccessByKeyReq) XXX_Size() int
func (*AccessByKeyReq) XXX_Unmarshal ¶
func (m *AccessByKeyReq) XXX_Unmarshal(b []byte) error
type AuthNServiceClient ¶
type AuthNServiceClient interface { Issue(ctx context.Context, in *IssueReq, opts ...grpc.CallOption) (*Token, error) Identify(ctx context.Context, in *Token, opts ...grpc.CallOption) (*UserID, error) }
AuthNServiceClient is the client API for AuthNService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewAuthNServiceClient ¶
func NewAuthNServiceClient(cc *grpc.ClientConn) AuthNServiceClient
type AuthNServiceServer ¶
type AuthNServiceServer interface { Issue(context.Context, *IssueReq) (*Token, error) Identify(context.Context, *Token) (*UserID, error) }
AuthNServiceServer is the server API for AuthNService service.
type IssueReq ¶
type IssueReq struct { Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` Type uint32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*IssueReq) Descriptor ¶
func (*IssueReq) MarshalToSizedBuffer ¶
func (*IssueReq) ProtoMessage ¶
func (*IssueReq) ProtoMessage()
func (*IssueReq) XXX_DiscardUnknown ¶
func (m *IssueReq) XXX_DiscardUnknown()
func (*IssueReq) XXX_Marshal ¶
func (*IssueReq) XXX_Unmarshal ¶
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 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) MarshalToSizedBuffer ¶
func (*ThingID) ProtoMessage ¶
func (*ThingID) ProtoMessage()
func (*ThingID) XXX_DiscardUnknown ¶
func (m *ThingID) XXX_DiscardUnknown()
func (*ThingID) XXX_Marshal ¶
func (*ThingID) XXX_Unmarshal ¶
type ThingsServiceClient ¶
type ThingsServiceClient interface { CanAccessByKey(ctx context.Context, in *AccessByKeyReq, opts ...grpc.CallOption) (*ThingID, error) CanAccessByID(ctx context.Context, in *AccessByIDReq, opts ...grpc.CallOption) (*empty.Empty, 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 { CanAccessByKey(context.Context, *AccessByKeyReq) (*ThingID, error) CanAccessByID(context.Context, *AccessByIDReq) (*empty.Empty, 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:"-"` }
If a token is not carrying any information itself, the type field can be used to determine how to validate the token. Also, different tokens can be encoded in different ways.
func (*Token) Descriptor ¶
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) XXX_DiscardUnknown ¶
func (m *Token) XXX_DiscardUnknown()
func (*Token) XXX_Marshal ¶
func (*Token) XXX_Unmarshal ¶
type UUIDProvider ¶
UUIDProvider specifies an API for generating unique identifiers.
type UnimplementedAuthNServiceServer ¶
type UnimplementedAuthNServiceServer struct { }
UnimplementedAuthNServiceServer can be embedded to have forward compatible implementations.
type UnimplementedThingsServiceServer ¶
type UnimplementedThingsServiceServer struct { }
UnimplementedThingsServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedThingsServiceServer) CanAccessByID ¶
func (*UnimplementedThingsServiceServer) CanAccessByKey ¶
func (*UnimplementedThingsServiceServer) CanAccessByKey(ctx context.Context, req *AccessByKeyReq) (*ThingID, 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) MarshalToSizedBuffer ¶
func (*UserID) ProtoMessage ¶
func (*UserID) ProtoMessage()
func (*UserID) XXX_DiscardUnknown ¶
func (m *UserID) XXX_DiscardUnknown()
func (*UserID) XXX_Marshal ¶
func (*UserID) XXX_Unmarshal ¶
type VersionInfo ¶
type VersionInfo struct { // Service contains service name. Service string `json:"service"` // Version contains service current version value. Version string `json:"version"` }
VersionInfo contains version endpoint response.
Directories ¶
Path | Synopsis |
---|---|
api
Package api contains implementation of AuthN service HTTP API.
|
Package api contains implementation of AuthN service HTTP API. |
api/grpc
Package grpc contains implementation of AuthN service gRPC API.
|
Package grpc contains implementation of AuthN service gRPC API. |
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 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. |
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
|
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 |
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 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. |
internal
|
|
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. |
redis
Package redis contains cache implementations using Redis as the underlying database.
|
Package redis contains cache implementations using Redis as the underlying database. |
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/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. |
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. |
uuid
Package uuid provides a UUID identity provider.
|
Package uuid provides a UUID identity provider. |
Package provision contains domain concept definitions needed to support Provision service feature, i.e.
|
Package provision contains domain concept definitions needed to support Provision service feature, i.e. |
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. |
postgres
Package postgres contains repository implementations using Postgres as the underlying database.
|
Package postgres contains repository implementations using Postgres 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/auth/grpc
Package grpc contains implementation of things service gRPC API.
|
Package grpc contains implementation of things service gRPC API. |
api/auth/http
Package http contains implementation of things auth service HTTP API.
|
Package http contains implementation of things auth service HTTP API. |
api/things/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. |
tracing
Package tracing contains middlewares that will add spans to existing traces.
|
Package tracing contains middlewares that will add spans to existing traces. |
users
Package users contains implementation for users service in single user scenario.
|
Package users contains implementation for users service in single user scenario. |
tools
|
|
Package twins contains the domain concept definitions needed to support Mainflux twins service functionality.
|
Package twins contains the domain concept definitions needed to support Mainflux twins 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/http
Package http contains implementation of kit service HTTP API.
|
Package http contains implementation of kit service HTTP API. |
mongodb
Package mongodb contains repository implementations using MongoDB as the underlying database.
|
Package mongodb contains repository implementations using MongoDB 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 users service HTTP API.
|
Package http contains implementation of users service HTTP API. |
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. |
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. |
postgres
Package postgres contains repository implementations using Postgres as the underlying database.
|
Package postgres contains repository implementations using Postgres as the underlying database. |