connectcontrol

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package connectcontrol implements filter for controlling connections of MQTT clients

Index

Constants

View Source
const (
	// Kind is the kind of ConnectControl
	Kind = "ConnectControl"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectControl

type ConnectControl struct {
	// contains filtered or unexported fields
}

ConnectControl is used to control MQTT clients connect status, if MQTTContext ClientID in bannedClients, the connection will be closed, if MQTTContext publish topic in bannedTopics, the connection will be closed.

func (*ConnectControl) Close

func (cc *ConnectControl) Close()

Close close ConnectControl gracefully

func (*ConnectControl) Handle

func (cc *ConnectControl) Handle(ctx *context.Context) string

Handle handles context.

func (*ConnectControl) Inherit

func (cc *ConnectControl) Inherit(previousGeneration filters.Filter)

Inherit init ConnectControl with previous generation

func (*ConnectControl) Init

func (cc *ConnectControl) Init()

Init init ConnectControl with pipeline filter spec

func (*ConnectControl) Kind

func (cc *ConnectControl) Kind() *filters.Kind

Kind return kind of ConnectControl

func (*ConnectControl) Name

func (cc *ConnectControl) Name() string

Name returns the name of the ConnectControl filter instance.

func (*ConnectControl) Spec

func (cc *ConnectControl) Spec() filters.Spec

Spec returns the spec used by the ConnectControl

func (*ConnectControl) Status

func (cc *ConnectControl) Status() interface{}

Status return status of ConnectControl

type Spec

type Spec struct {
	filters.BaseSpec `json:",inline"`

	BannedClientRe string   `json:"bannedClientRe,omitempty"`
	BannedClients  []string `json:"bannedClients,omitempty"`
	BannedTopicRe  string   `json:"bannedTopicRe,omitempty"`
	BannedTopics   []string `json:"bannedTopics,omitempty"`
}

Spec describes the ConnectControl

type Status

type Status struct {
	BannedClientRe  string `json:"bannedClientRe,omitempty"`
	BannedClientNum int    `json:"bannedClientNum,omitempty"`
	BannedTopicRe   string `json:"bannedTopicRe,omitempty"`
	BannedTopicNum  int    `json:"bannedTopicNum,omitempty"`
}

Status is ConnectControl filter status

Jump to

Keyboard shortcuts

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