package
0.0.0-20220824021342-5961e9c4d224
Repository: https://github.com/xiaodingding/iotfast.git
Documentation: pkg.go.dev

# README

admin

Admin plugin use grpc-gateway to provide both REST HTTP and GRPC APIs for integration with external systems.

API Doc

See swagger

Examples

List Clients

$ curl 127.0.0.1:8083/v1/clients

Response:

{
      "clients": [
          {
              "client_id": "ab",
              "username": "",
              "keep_alive": 60,
              "version": 4,
              "remote_addr": "127.0.0.1:51637",
              "local_addr": "127.0.0.1:1883",
              "connected_at": "2020-12-12T12:26:36Z",
              "disconnected_at": null,
              "session_expiry": 7200,
              "max_inflight": 100,
              "inflight_len": 0,
              "max_queue": 100,
              "queue_len": 0,
              "subscriptions_current": 0,
              "subscriptions_total": 0,
              "packets_received_bytes": "54",
              "packets_received_nums": "3",
              "packets_send_bytes": "8",
              "packets_send_nums": "2",
              "message_dropped": "0"
          }
      ],
      "total_count": 1
  }

Filter Subscriptions

$ curl 127.0.0.1:8083/v1/filter_subscriptions?filter_type=1,2,3&match_type=1&topic_name=/a

This curl is able to filter the subscription that the topic name is equal to "/a".

Response:

{
    "subscriptions": [
        {
            "topic_name": "/a",
            "id": 0,
            "qos": 1,
            "no_local": false,
            "retain_as_published": false,
            "retain_handling": 0,
            "client_id": "ab"
        }
    ]
}

Publish Message

$ curl -X POST 127.0.0.1:8083/v1/publish -d '{"topic_name":"a","payload":"test","qos":1}'

This curl will publish the message to the broker.The broker will check if there are matched topics and send the message to the subscribers, just like received a message from a MQTT client.

# Functions

ErrInvalidArgument is a wrapper function for easier invalid argument error handling.
No description provided by the author
GetPage gets page and pageSize from request params.
No description provided by the author
No description provided by the author
NewIndexer is the constructor of Indexer.
No description provided by the author
No description provided by the author
RegisterClientServiceHandler registers the http handlers for service ClientService to "mux".
RegisterClientServiceHandlerClient registers the http handlers for service ClientService to "mux".
RegisterClientServiceHandlerFromEndpoint is same as RegisterClientServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
RegisterClientServiceHandlerServer registers the http handlers for service ClientService to "mux".
No description provided by the author
RegisterPublishServiceHandler registers the http handlers for service PublishService to "mux".
RegisterPublishServiceHandlerClient registers the http handlers for service PublishService to "mux".
RegisterPublishServiceHandlerFromEndpoint is same as RegisterPublishServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
RegisterPublishServiceHandlerServer registers the http handlers for service PublishService to "mux".
No description provided by the author
RegisterSubscriptionServiceHandler registers the http handlers for service SubscriptionService to "mux".
RegisterSubscriptionServiceHandlerClient registers the http handlers for service SubscriptionService to "mux".
RegisterSubscriptionServiceHandlerFromEndpoint is same as RegisterSubscriptionServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
RegisterSubscriptionServiceHandlerServer registers the http handlers for service SubscriptionService to "mux".
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

DefaultConfig is the default configuration.
ErrNotFound represents a not found error.
No description provided by the author
No description provided by the author
No description provided by the author
Enum value maps for SubFilterType.
Enum value maps for SubFilterType.
Enum value maps for SubMatchType.
Enum value maps for SubMatchType.

# Structs

Admin providers gRPC and HTTP API that enables the external system to interact with the broker.
No description provided by the author
Config is the configuration for the admin plugin.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GRPCConfig is the configuration for gRPC endpoint.
HTTPConfig is the configuration for http endpoint.
Indexer provides a index for a ordered list that supports queries in O(1).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UnimplementedClientServiceServer must be embedded to have forward compatible implementations.
UnimplementedPublishServiceServer must be embedded to have forward compatible implementations.
UnimplementedSubscriptionServiceServer must be embedded to have forward compatible implementations.
No description provided by the author
No description provided by the author

# Interfaces

ClientServiceClient is the client API for ClientService service.
ClientServiceServer is the server API for ClientService service.
PublishServiceClient is the client API for PublishService service.
PublishServiceServer is the server API for PublishService service.
SubscriptionServiceClient is the client API for SubscriptionService service.
SubscriptionServiceServer is the server API for SubscriptionService service.
UnsafeClientServiceServer may be embedded to opt out of forward compatibility for this service.
UnsafePublishServiceServer may be embedded to opt out of forward compatibility for this service.
UnsafeSubscriptionServiceServer may be embedded to opt out of forward compatibility for this service.

# Type aliases

No description provided by the author
No description provided by the author