clients

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: 17 Imported by: 0

README

Clients

Clients service provides an HTTP API for managing platform resources: clients and channels. Through this API clients are able to do the following actions:

  • provision new clients
  • create new channels
  • "connect" clients into the channels

For an in-depth explanation of the aforementioned scenarios, as well as thorough understanding of Magistrala, please check out the official documentation.

Configuration

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

Variable Description Default
MG_CLIENTS_LOG_LEVEL Log level for Clients (debug, info, warn, error) info
MG_CLIENTS_HTTP_HOST Clients service HTTP host localhost
MG_CLIENTS_HTTP_PORT Clients service HTTP port 9000
MG_CLIENTS_SERVER_CERT Path to the PEM encoded server certificate file ""
MG_CLIENTS_SERVER_KEY Path to the PEM encoded server key file ""
MG_CLIENTS_GRPC_HOST Clients service gRPC host localhost
MG_CLIENTS_GRPC_PORT Clients service gRPC port 7000
MG_CLIENTS_GRPC_SERVER_CERT Path to the PEM encoded server certificate file ""
MG_CLIENTS_GRPC_SERVER_KEY Path to the PEM encoded server key file ""
MG_CLIENTS_DB_HOST Database host address localhost
MG_CLIENTS_DB_PORT Database host port 5432
MG_CLIENTS_DB_USER Database user magistrala
MG_CLIENTS_DB_PASS Database password magistrala
MG_CLIENTS_DB_NAME Name of the database used by the service clients
MG_CLIENTS_DB_SSL_MODE Database connection SSL mode (disable, require, verify-ca, verify-full) disable
MG_CLIENTS_DB_SSL_CERT Path to the PEM encoded certificate file ""
MG_CLIENTS_DB_SSL_KEY Path to the PEM encoded key file ""
MG_CLIENTS_DB_SSL_ROOT_CERT Path to the PEM encoded root certificate file ""
MG_CLIENTS_CACHE_URL Cache database URL redis://localhost:6379/0
MG_CLIENTS_CACHE_KEY_DURATION Cache key duration in seconds 3600
MG_CLIENTS_ES_URL Event store URL localhost:6379
MG_CLIENTS_ES_PASS Event store password ""
MG_CLIENTS_ES_DB Event store instance name 0
MG_CLIENTS_STANDALONE_ID User ID for standalone mode (no gRPC communication with Auth) ""
MG_CLIENTS_STANDALONE_TOKEN User token for standalone mode that should be passed in auth header ""
MG_JAEGER_URL Jaeger server URL http://jaeger:4318/v1/traces
MG_AUTH_GRPC_URL Auth service gRPC URL localhost:7001
MG_AUTH_GRPC_TIMEOUT Auth service gRPC request timeout in seconds 1s
MG_AUTH_GRPC_CLIENT_TLS Enable TLS for gRPC client false
MG_AUTH_GRPC_CA_CERT Path to the CA certificate file ""
MG_SEND_TELEMETRY Send telemetry to magistrala call home server. true
Clients_INSTANCE_ID Clients instance ID ""

Note that if you want clients service to have only one user locally, you should use CLIENTS_STANDALONE env vars. By specifying these, you don't need auth service in your deployment for users' authorization.

Deployment

The service itself is distributed as Docker container. Check the clients service section in docker-compose file to see how service is deployed.

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

# download the latest version of the service
git clone https://github.com/absmach/magistrala

cd magistrala

# compile the clients
make clients

# copy binary to bin
make install

# set the environment variables and run the service
Clients_LOG_LEVEL=[Clients log level] \
Clients_STANDALONE_ID=[User ID for standalone mode (no gRPC communication with auth)] \
Clients_STANDALONE_TOKEN=[User token for standalone mode that should be passed in auth header] \
Clients_CACHE_KEY_DURATION=[Cache key duration in seconds] \
Clients_HTTP_HOST=[Clients service HTTP host] \
Clients_HTTP_PORT=[Clients service HTTP port] \
Clients_HTTP_SERVER_CERT=[Path to server certificate in pem format] \
Clients_HTTP_SERVER_KEY=[Path to server key in pem format] \
Clients_AUTH_GRPC_HOST=[Clients service gRPC host] \
Clients_AUTH_GRPC_PORT=[Clients service gRPC port] \
Clients_AUTH_GRPC_SERVER_CERT=[Path to server certificate in pem format] \
Clients_AUTH_GRPC_SERVER_KEY=[Path to server key in pem format] \
Clients_DB_HOST=[Database host address] \
Clients_DB_PORT=[Database host port] \
Clients_DB_USER=[Database user] \
Clients_DB_PASS=[Database password] \
Clients_DB_NAME=[Name of the database used by the service] \
Clients_DB_SSL_MODE=[SSL mode to connect to the database with] \
Clients_DB_SSL_CERT=[Path to the PEM encoded certificate file] \
Clients_DB_SSL_KEY=[Path to the PEM encoded key file] \
Clients_DB_SSL_ROOT_CERT=[Path to the PEM encoded root certificate file] \
Clients_CACHE_URL=[Cache database URL] \
Clients_ES_URL=[Event store URL] \
Clients_ES_PASS=[Event store password] \
Clients_ES_DB=[Event store instance name] \
MG_AUTH_GRPC_URL=[Auth service gRPC URL] \
MG_AUTH_GRPC_TIMEOUT=[Auth service gRPC request timeout in seconds] \
MG_AUTH_GRPC_CLIENT_TLS=[Enable TLS for gRPC client] \
MG_AUTH_GRPC_CA_CERT=[Path to trusted CA certificate file] \
MG_JAEGER_URL=[Jaeger server URL] \
MG_SEND_TELEMETRY=[Send telemetry to magistrala call home server] \
Clients_INSTANCE_ID=[Clients instance ID] \
$GOBIN/magistrala-clients

Setting Clients_CA_CERTS expects a file in PEM format of trusted CAs. This will enable TLS against the Auth gRPC endpoint trusting only those CAs that are provided.

In constrained environments, sometimes it makes sense to run Clients service as a standalone to reduce network traffic and simplify deployment. This means that Clients service operates only using a single user and is able to authorize it without gRPC communication with Auth service. To run service in a standalone mode, set Clients_STANDALONE_EMAIL and Clients_STANDALONE_TOKEN.

Usage

Magistrala supports the following operations for Clients:

Operation Description
create Create a new client
get Retrieve a single client or list all clients
update Update a client’s name and metadata
delete Permanently delete a client
enable Enable a previously disabled client
disable Disable an active client
setClientParentGroup Add a Parent Group to a client
removeClientParentGroup Remove a Parent Group from a client
API Examples
Create a Client
curl -X POST http://localhost:9006/<domainID>/clients \
  -H "Authorization: Bearer <your_access_token>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "clientName",
  "tags": [
    "tag1",
    "tag2"
  ],
  "credentials": {
    "identity": "clientIDentity",
    "secret": "bb7edb32-2eac-4aad-aebe-ed96fe073879"
  },
  "metadata": {
    "model": "example"
  },
  "status": "enabled"
}'

The expected response should be:

{
  "id": "bb7edb32-2eac-4aad-aebe-ed96fe073879",
  "name": "clientName",
  "tags": [
    "tag1",
    "tag2"
  ],
  "domain_id": "bb7edb32-2eac-4aad-aebe-ed96fe073879",
  "credentials": {
    "identity": "clientIDentity",
    "secret": "bb7edb32-2eac-4aad-aebe-ed96fe073879"
  },
  "metadata": {
    "model": "example"
  },
  "status": "enabled",
  "created_at": "2019-11-26 13:31:52",
  "updated_at": "2019-11-26 13:31:52"
}
Get Clients

List all clients:

curl -X GET "http://localhost:9006/<domainID>/clients?limit=10" \
  -H "Authorization: Bearer <your_access_token>"

List a singular client:

curl -X GET http://localhost:9006/<domainID>/clients/<clientID> \
  -H "Authorization: Bearer <your_access_token>"
Update a Client

Update is performed by replacing the current resource data with values provided in a request payload. Note that the client's type and ID cannot be changed.

curl -X PATCH http://localhost:9006/<domainID>/clients/<clientID> \
  -H "Authorization: Bearer <your_access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "clientName",
    "metadata": {"role": "general"}
  }'

The expected response is

{
  "id": "bb7edb32-2eac-4aad-aebe-ed96fe073879",
  "name": "clientName",
  "tags": [
    "tag1",
    "tag2"
  ],
  "domain_id": "bb7edb32-2eac-4aad-aebe-ed96fe073879",
  "credentials": {
    "identity": "clientIDentity",
    "secret": "bb7edb32-2eac-4aad-aebe-ed96fe073879"
  },
  "metadata": { "model": "example" },
  "status": "enabled",
  "created_at": "2019-11-26 13:31:52",
  "updated_at": "2019-11-26 13:31:52"
}
Delete a Client

Delete client removes a client with the given id from repo and removes all the policies related to this client.

curl -X DELETE http://localhost:9006/<domainID>/clients/<clientID> \
  -H "Authorization: Bearer <your_access_token>"
Disable a Client

Disables a specific client that is identified by the client ID.

curl -X POST http://localhost:9006/<domainID>/clients/<clientID>/disable \
  -H "Authorization: Bearer <your_access_token>"
Enable a Client

Enable logically enables the client identified with the provided ID

curl -X POST http://localhost:9006/<domainID>/clients/<clientID>/enable \
  -H "Authorization: Bearer <your_access_token>"

Roles Management for Clients

In addition to standard client lifecycle operations (create, get, update, delete, enable, disable), the Clients service supports robust role‑based operations for managing permissions and associations for each client.

Supported Role Operations
Operation Description
create-role Create a new role for a client
list-roles List all roles assigned to a client
get-role Retrieve details for a specific client role
update-role Update a specific client role
delete-role Delete a specific client role
add-role-action Add one or more actions (permissions) to a client role
list-role-actions List all actions associated with a client role
delete-role-action Remove a specific action from a client role
delete-all-role-actions Remove all actions from a client role
add-role-member Associate one or more users or entities to a client role
list-role-members List all members of a client role
delete-role-member Remove one or more members from a client role
delete-all-role-members Remove all members from a client role
list-available-actions Retrieve the global list of available actions key for role creation
Example: Create a Client Role
curl -X POST http://localhost:9006/<domainID>/clients/<clientID>/roles \
  -H "Authorization: Bearer <your_access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "publisher",
    "actions": ["publish"],
    "members": []
  }'

Implementation Details

Clients in Magistrala are persisted in PostgreSQL using a schema optimized for identity management, authorization, and relationship tracking (channels, groups, and users).

Clients Table Structure

The main clients table tracks all metadata, identity, and lifecycle information for each client:

Column Type Description
id VARCHAR(36) UUID of the client (primary key).
name VARCHAR(1024) Human‑readable name.
domain_id VARCHAR(36) Domain to which the client belongs.
parent_group_id VARCHAR(36) Optional group parent (for inheritance/scoping).
identity VARCHAR(254) Login identity (often an email or unique ID).
secret VARCHAR(4096) Hashed authentication secret.
tags TEXT[] Arbitrary list of client tags.
metadata JSONB Free‑form structured metadata.
created_at TIMESTAMPTZ Timestamp when the client was created.
updated_at TIMESTAMPTZ Timestamp when the client was last updated.
updated_by VARCHAR(254) Identifier of the actor who performed the last update.
status SMALLINT 0 = enabled, 1 = disabled.
Connections Table Structure

Client ↔ Channel relationships are stored in the connections table:

Column Type Description
channel_id VARCHAR(36) Channel UUID.
domain_id VARCHAR(36) Domain of the client & channel.
client_id VARCHAR(36) Client UUID.
type SMALLINT Connection type: 1 = Publish, 2 = Subscribe.

This guarantees that when a client is deleted, all channel connections are automatically removed.

Best Practices

To ensure robust and secure usage of the Clients service, consider the following recommendations:

  • Use metadata and tags meaningfully: Store useful attributes like model, location, environment (e.g., production, test) to filter and manage clients efficiently.
  • Keep credentials secure: Rotate client secrets periodically. Avoid using guessable strings.
  • Disable unused clients: Use the disable operation to revoke access instead of deleting clients when deactivation is preferred.
  • Audit regularly: Periodically list client roles and connections to ensure expected configuration.
  • Prefer standalone mode for edge deployments: Use environment variables to configure standalone mode in isolated environments without needing the Auth service.

Versioning and Health Check

The Clients service exposes a /health endpoint to verify operational status and version information.

Health Check Request
curl -X 'GET' \
  'http://localhost:9006/health' \
  -H 'accept: application/health+json'

The expected response is:

{
  "status": "pass",
  "version": "0.14.0",
  "commit": "7d6f4dc4f7f0c1fa3dc24eddfb18bb5073ff4f62",
  "description": "clients service",
  "build_time": "1970-01-01_00:00:00"
}

This endpoint can be used for monitoring, CI/CD readiness checks, or basic diagnostics.

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

Documentation

Overview

Copyright (c) Abstract Machines SPDX-License-Identifier: Apache-2.0

Package clients contains the domain concept definitions needed to support Magistrala clients service functionality.

This package defines the core domain concepts and types necessary to handle clients in the context of a Magistrala clients service. It abstracts the underlying complexities of user management and provides a structured approach to working with clients.

Copyright (c) Abstract Machines SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	Admin = "admin"
	User  = "user"
)

String representation of the possible role values.

View Source
const (
	Disabled = "disabled"
	Enabled  = "enabled"
	Deleted  = "deleted"
	All      = "all"
	Unknown  = "unknown"
)

String representation of the possible status values.

View Source
const BuiltInRoleAdmin roles.BuiltInRoleName = "admin"

Variables

View Source
var (
	// ErrEnableClient indicates error in enabling client.
	ErrEnableClient = errors.New("failed to enable client")

	// ErrDisableClient indicates error in disabling client.
	ErrDisableClient = errors.New("failed to disable client")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// Save stores pair client secret, client id.
	Save(ctx context.Context, clientSecret, clientID string) error

	// ID returns client ID for given client secret.
	ID(ctx context.Context, clientSecret string) (string, error)

	// Removes client from cache.
	Remove(ctx context.Context, clientID string) error
}

Cache contains client caching interface.

type Client

type Client struct {
	ID              string      `json:"id"`
	Name            string      `json:"name,omitempty"`
	Tags            []string    `json:"tags,omitempty"`
	Domain          string      `json:"domain_id,omitempty"`
	ParentGroup     string      `json:"parent_group_id,omitempty"`
	Credentials     Credentials `json:"credentials,omitempty"`
	Metadata        Metadata    `json:"metadata,omitempty"`
	PrivateMetadata Metadata    `json:"private_metadata,omitempty"`
	CreatedAt       time.Time   `json:"created_at,omitempty"`
	UpdatedAt       time.Time   `json:"updated_at,omitempty"`
	UpdatedBy       string      `json:"updated_by,omitempty"`
	Status          Status      `json:"status,omitempty"` // 1 for enabled, 0 for disabled
	Identity        string      `json:"identity,omitempty"`
	// Extended
	ParentGroupPath           string                    `json:"parent_group_path,omitempty"`
	RoleID                    string                    `json:"role_id,omitempty"`
	RoleName                  string                    `json:"role_name,omitempty"`
	Actions                   []string                  `json:"actions,omitempty"`
	AccessType                string                    `json:"access_type,omitempty"`
	AccessProviderId          string                    `json:"access_provider_id,omitempty"`
	AccessProviderRoleId      string                    `json:"access_provider_role_id,omitempty"`
	AccessProviderRoleName    string                    `json:"access_provider_role_name,omitempty"`
	AccessProviderRoleActions []string                  `json:"access_provider_role_actions,omitempty"`
	ConnectionTypes           []connections.ConnType    `json:"connection_types,omitempty"`
	MemberId                  string                    `json:"member_id,omitempty"`
	Roles                     []roles.MemberRoleActions `json:"roles,omitempty"`
}

func (Client) MarshalJSON

func (client Client) MarshalJSON() ([]byte, error)

type ClientRepository

type ClientRepository struct {
	DB postgres.Database
}

type ClientsPage

type ClientsPage struct {
	Page
	Clients []Client
}

ClientsPage contains page related metadata as well as list.

type Connection

type Connection struct {
	ClientID  string
	ChannelID string
	DomainID  string
	Type      connections.ConnType
}

type Credentials

type Credentials struct {
	Identity string `json:"identity,omitempty"` // username or generated login ID
	Secret   string `json:"secret,omitempty"`   // password or token
}

Credentials represent client credentials: its "identity" which can be a username, email, generated name; and "secret" which can be a password or access token.

type MembersPage

type MembersPage struct {
	Page
	Members []Client
}

type Metadata

type Metadata map[string]any

Metadata represents arbitrary JSON.

type Operator

type Operator uint8
const (
	OrOp Operator = iota
	AndOp
)

type Page

type Page struct {
	Total          uint64    `json:"total"`
	Offset         uint64    `json:"offset"`
	Limit          uint64    `json:"limit"`
	OnlyTotal      bool      `json:"only_total"`
	Order          string    `json:"order,omitempty"`
	Dir            string    `json:"dir,omitempty"`
	ID             string    `json:"id,omitempty"`
	Name           string    `json:"name,omitempty"`
	Metadata       Metadata  `json:"metadata,omitempty"`
	Domain         string    `json:"domain,omitempty"`
	Tags           TagsQuery `json:"tags,omitempty"`
	Status         Status    `json:"status,omitempty"`
	Identity       string    `json:"identity,omitempty"`
	Group          *string   `json:"group,omitempty"`
	Channel        string    `json:"channel,omitempty"`
	ConnectionType string    `json:"connection_type,omitempty"`
	RoleName       string    `json:"role_name,omitempty"`
	RoleID         string    `json:"role_id,omitempty"`
	Actions        []string  `json:"actions,omitempty"`
	AccessType     string    `json:"access_type,omitempty"`
	IDs            []string  `json:"-"`
	CreatedFrom    time.Time `json:"created_from,omitempty"`
	CreatedTo      time.Time `json:"created_to,omitempty"`
}

type Repository

type Repository interface {
	// RetrieveByID retrieves client by its unique ID.
	RetrieveByID(ctx context.Context, id string) (Client, error)

	// RetrieveByIDWithRoles retrieves client by its unique ID along with member roles.
	RetrieveByIDWithRoles(ctx context.Context, id, memberID string) (Client, error)

	// RetrieveAll retrieves all clients.
	RetrieveAll(ctx context.Context, pm Page) (ClientsPage, error)

	// RetrieveUserClients retrieve all clients of a given user id.
	RetrieveUserClients(ctx context.Context, domainID, userID string, pm Page) (ClientsPage, error)

	// SearchClients retrieves clients based on search criteria.
	SearchClients(ctx context.Context, pm Page) (ClientsPage, error)

	// RetrieveByIds
	RetrieveByIds(ctx context.Context, ids []string) (ClientsPage, error)

	// Update updates the client name and metadata.
	Update(ctx context.Context, client Client) (Client, error)

	// UpdateTags updates the client tags.
	UpdateTags(ctx context.Context, client Client) (Client, error)

	// UpdateIdentity updates identity for client with given id.
	UpdateIdentity(ctx context.Context, client Client) (Client, error)

	// UpdateSecret updates secret for client with given identity.
	UpdateSecret(ctx context.Context, client Client) (Client, error)

	// ChangeStatus changes client status to enabled or disabled
	ChangeStatus(ctx context.Context, client Client) (Client, error)

	// Delete deletes client with given id
	Delete(ctx context.Context, clientIDs ...string) error

	// Save persists the client account. A non-nil error is returned to indicate
	// operation failure.
	Save(ctx context.Context, client ...Client) ([]Client, error)

	// RetrieveBySecret retrieves a client based on the secret (key) and domainID.
	// Domain ID is required because the key is not globally unique,
	// but unique on the level of Domain.
	RetrieveBySecret(ctx context.Context, key, id string, prefix authn.AuthPrefix) (Client, error)

	AddConnections(ctx context.Context, conns []Connection) error

	RemoveConnections(ctx context.Context, conns []Connection) error

	ClientConnectionsCount(ctx context.Context, id string) (uint64, error)

	DoesClientHaveConnections(ctx context.Context, id string) (bool, error)

	RemoveChannelConnections(ctx context.Context, channelID string) error

	RemoveClientConnections(ctx context.Context, clientID string) error

	// SetParentGroup set parent group id to a given channel id
	SetParentGroup(ctx context.Context, cli Client) error

	// RemoveParentGroup remove parent group id fr given chanel id
	RemoveParentGroup(ctx context.Context, cli Client) error

	RetrieveParentGroupClients(ctx context.Context, parentGroupID string) ([]Client, error)

	UnsetParentGroupFromClient(ctx context.Context, parentGroupID string) error

	roles.Repository
}

Repository is the interface that wraps the basic methods for a client repository.

type Role

type Role uint8

Role represents Client role.

const (
	UserRole Role = iota
	AdminRole

	// AllRole is used for querying purposes to list clients irrespective
	// of their role - both admin and user. It is never stored in the
	// database as the actual Client role and should always be the largest
	// value in this enumeration.
	AllRole
)

Possible Client role values.

func ToRole

func ToRole(status string) (Role, error)

ToRole converts string value to a valid Client role.

func (Role) MarshalJSON

func (r Role) MarshalJSON() ([]byte, error)

func (Role) String

func (cs Role) String() string

String converts client role to string literal.

func (*Role) UnmarshalJSON

func (r *Role) UnmarshalJSON(data []byte) error

type Service

type Service interface {
	// CreateClients creates new client. In case of the failed registration, a
	// non-nil error value is returned.
	CreateClients(ctx context.Context, session authn.Session, client ...Client) ([]Client, []roles.RoleProvision, error)

	// View retrieves client info for a given client ID and an authorized token.
	View(ctx context.Context, session authn.Session, id string, withRoles bool) (Client, error)

	// ListClients retrieves clients list for given page query.
	ListClients(ctx context.Context, session authn.Session, pm Page) (ClientsPage, error)

	// ListUserClients retrieves clients list for a given user id and page query.
	ListUserClients(ctx context.Context, session authn.Session, userID string, pm Page) (ClientsPage, error)

	// Update updates the client's name and metadata.
	Update(ctx context.Context, session authn.Session, client Client) (Client, error)

	// UpdateTags updates the client's tags.
	UpdateTags(ctx context.Context, session authn.Session, client Client) (Client, error)

	// UpdateSecret updates the client's secret
	UpdateSecret(ctx context.Context, session authn.Session, id, key string) (Client, error)

	// Enable logically enableds the client identified with the provided ID
	Enable(ctx context.Context, session authn.Session, id string) (Client, error)

	// Disable logically disables the client identified with the provided ID
	Disable(ctx context.Context, session authn.Session, id string) (Client, error)

	// Delete deletes client with given ID.
	Delete(ctx context.Context, session authn.Session, id string) error

	SetParentGroup(ctx context.Context, session authn.Session, parentGroupID string, id string) error

	RemoveParentGroup(ctx context.Context, session authn.Session, id string) error

	roles.RoleManager
}

Service specifies an API that must be fulfilled by the domain service implementation, and all of its decorators (e.g. logging & metrics).

func NewService

func NewService(repo Repository, policy policies.Service, cache Cache, channels grpcChannelsV1.ChannelsServiceClient, groups grpcGroupsV1.GroupsServiceClient, idProvider mg.IDProvider, sIDProvider mg.IDProvider, availableActions []roles.Action, builtInRoles map[roles.BuiltInRoleName][]roles.Action) (Service, error)

NewService returns a new Clients service implementation.

type Status

type Status uint8

Status represents Client status.

const (
	// EnabledStatus represents enabled Client.
	EnabledStatus Status = iota
	// DisabledStatus represents disabled Client.
	DisabledStatus
	// DeletedStatus represents a client that will be deleted.
	DeletedStatus

	// AllStatus is used for querying purposes to list clients irrespective
	// of their status - both enabled and disabled. It is never stored in the
	// database as the actual Client status and should always be the largest
	// value in this enumeration.
	AllStatus
)

Possible Client status values.

func ToStatus

func ToStatus(status string) (Status, error)

ToStatus converts string value to a valid Client status.

func (Status) MarshalJSON

func (s Status) MarshalJSON() ([]byte, error)

Custom Marshaller for Client.

func (Status) String

func (s Status) String() string

String converts client/group status to string literal.

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(data []byte) error

Custom Unmarshaler for Client.

type TagsQuery

type TagsQuery struct {
	Elements []string
	Operator Operator
}

func ToTagsQuery

func ToTagsQuery(s string) TagsQuery

Directories

Path Synopsis
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.
grpc
Package grpc contains implementation of Auth service gRPC API.
Package grpc contains implementation of Auth service gRPC API.
Package cache contains the domain concept definitions needed to support Magistrala clients cache service functionality.
Package cache contains the domain concept definitions needed to support Magistrala clients cache service functionality.
Package events provides the domain concept definitions needed to support clients events functionality.
Package events provides the domain concept definitions needed to support clients events functionality.
Package middleware provides authorization, logging, metrics and tracing middleware for Magistrala Clients Service.
Package middleware provides authorization, logging, metrics and tracing middleware for Magistrala Clients Service.
Package mocks contains mocks for testing purposes.
Package mocks contains mocks for testing purposes.
Package postgres contains the database implementation of clients repository layer.
Package postgres contains the database implementation of clients repository layer.
Private package is a service wrapper around the underlying Repository.
Private package is a service wrapper around the underlying Repository.
Package standalone contains implementation for auth service in single-user scenario.
Package standalone contains implementation for auth service in single-user scenario.

Jump to

Keyboard shortcuts

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