pkg

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

README

Standalone packages

The pkg directory (the current directory) contains a set of standalone packages that can be imported and used by external applications. The packages are specifically meant for the development of Magistrala based back-end applications and implement common tasks needed by the programmatic operation of the Magistrala platform.

Using the packages

Fetch any package directly from the module:

go get github.com/absmach/magistrala/pkg/authn

Then import it in your code:

import "github.com/absmach/magistrala/pkg/authn"

Package map (selected)

Package Purpose
authn, authz, oauth2, policies Authentication and authorization helpers, middleware, and policy utilities.
grpcclient TLS-aware gRPC client setup with health checks and timeouts.
server HTTP, gRPC, and COAP server bootstrap utilities (TLS, graceful shutdown).
postgres PostgreSQL connector with migrations helpers.
events Event store client abstractions and subscriber utilities.
prometheus Metrics collectors for request counts/latency.
jaeger, tracing OpenTelemetry tracing configuration and instrumentation helpers.
channels, clients, groups, domains, roles Shared types and helpers for core Magistrala domain services.
messaging, connections, callout Messaging DTOs, connection types, and outbound callout helpers.
sdk Go SDK for interacting with Magistrala services.
errors Error wrappers with consistent error typing.
uuid, ulid, sid ID generators.
transformers, svcutil Generic data transformation and service utilities.

For detailed package-level docs, run go doc on the desired package or browse the source here.

Documentation

Overview

Package pkg contains library packages used by Magistrala services and external services that integrate with Magistrala.

Directories

Path Synopsis
channels
events
Package events provides the events sourcing of channels to provide replication in other service and definitions needed to support it
Package events provides the events sourcing of channels to provide replication in other service and definitions needed to support it
events/consumer
Package consumer contains events consumer for events published by channels service.
Package consumer contains events consumer for events published by channels service.
clients
events
Package events provides the events sourcing of clients to provide replication in other service and definitions needed to support it
Package events provides the events sourcing of clients to provide replication in other service and definitions needed to support it
events/consumer
Package consumer contains events consumer for events published by clients service.
Package consumer contains events consumer for events published by clients service.
Package errors contains Magistrala errors definitions.
Package errors contains Magistrala errors definitions.
nats
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
redis
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
events
Package events provides the events sourcing of groups to provide listing in clients and channels concept definitions needed to support
Package events provides the events sourcing of groups to provide listing in clients and channels concept definitions needed to support
events/consumer
Package consumer contains events consumer for events published by Bootstrap service.
Package consumer contains events consumer for events published by Bootstrap service.
Package auth contains the domain concept definitions needed to support Magistrala auth functionality.
Package auth contains the domain concept definitions needed to support Magistrala auth functionality.
Package jaeger contains the domain concept definitions needed to support Magistrala Jaeger tracing functionality.
Package jaeger contains the domain concept definitions needed to support Magistrala Jaeger tracing functionality.
mqtt
Package mqtt hold the implementation of the Publisher and PubSub interfaces for the MQTT messaging system, the internal messaging broker of the Magistrala IoT platform.
Package mqtt hold the implementation of the Publisher and PubSub interfaces for the MQTT messaging system, the internal messaging broker of the Magistrala IoT platform.
nats
Package nats hold the implementation of the Publisher and PubSub interfaces for the NATS messaging system, the internal messaging broker of the Magistrala IoT platform.
Package nats hold the implementation of the Publisher and PubSub interfaces for the NATS messaging system, the internal messaging broker of the Magistrala IoT platform.
nats/tracing
Package tracing provides tracing instrumentation for Magistrala clients policies service.
Package tracing provides tracing instrumentation for Magistrala clients policies service.
tracing
Package tracing provides tracing instrumentation for Magistrala clients policies service.
Package tracing provides tracing instrumentation for Magistrala clients policies service.
Package oauth2 contains the domain concept definitions needed to support Magistrala ui service OAuth2 functionality.
Package oauth2 contains the domain concept definitions needed to support Magistrala ui service OAuth2 functionality.
google
Package google contains the domain concept definitions needed to support Magistrala services for Google OAuth2 functionality.
Package google contains the domain concept definitions needed to support Magistrala services for Google OAuth2 functionality.
Package policies contains Magistrala policy definitions.
Package policies contains Magistrala policy definitions.
spicedb
Package server contains the HTTP, gRPC and CoAP server implementation.
Package server contains the HTTP, gRPC and CoAP server implementation.
Package postgres contains the domain concept definitions needed to support Magistrala PostgreSQL database functionality.
Package postgres contains the domain concept definitions needed to support Magistrala PostgreSQL database functionality.
Package prometheus provides a framework for defining and collecting metrics for prometheus.
Package prometheus provides a framework for defining and collecting metrics for prometheus.
re
events/consumer
Package consumer contains events consumer for events published by the Rules Engine service.
Package consumer contains events consumer for events published by the Rules Engine service.
rolemanager/events
Package events provides the domain concept definitions needed to support Magistrala auth service functionality.
Package events provides the domain concept definitions needed to support Magistrala auth service functionality.
rolemanager/middleware
Package middleware provides authorization, logging, metrics and tracing middleware for Magistrala RoleManager service.
Package middleware provides authorization, logging, metrics and tracing middleware for Magistrala RoleManager service.
sdk
Package sdk contains Magistrala SDK.
Package sdk contains Magistrala SDK.
Package server contains the HTTP, gRPC and CoAP server implementation.
Package server contains the HTTP, gRPC and CoAP server implementation.
coap
Package coap contains the CoAP server implementation.
Package coap contains the CoAP server implementation.
grpc
Package grpc contains the gRPC server implementation.
Package grpc contains the gRPC server implementation.
http
Package http contains the HTTP server implementation.
Package http contains the HTTP server implementation.
Package ulid contains ULID generator.
Package ulid contains ULID generator.
Package transformers contains the domain concept definitions needed to support Magistrala transformer services functionality.
Package transformers contains the domain concept definitions needed to support Magistrala transformer services functionality.
json
Package json contains JSON transformer.
Package json contains JSON transformer.
senml
Package senml contains SenML transformer.
Package senml contains SenML transformer.
Package ulid contains ULID generator.
Package ulid contains ULID generator.
Package uuid contains UUID generator.
Package uuid contains UUID generator.

Jump to

Keyboard shortcuts

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