acl

package
v0.0.0-...-778f14e Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TopicAlwaysVerifyType = "topicAlwaysVerify"
	TopicNumAuthType      = "topicNumAuth"
	TopicSetAuthType      = "topicSetAuth"
)

Variables

This section is empty.

Functions

func Register

func Register(name string, provider Authenticator)

func SetLogger

func SetLogger(l *zap.Logger)

func UnRegister

func UnRegister(name string)

Types

type Authenticator

type Authenticator interface {
	CheckPub(clientInfo *ClientInfo, topic string) bool
	CheckSub(clientInfo *ClientInfo, topic string) bool
	ProcessUnSub(clientInfo *ClientInfo, topic string)
	SetAuthFunc(f GetAuthFunc)
}

sdk-lang=python3.6|sdk-version=3.0.0.96|sdk-arch=64|sdk-os=win-amd64

type ClientInfo

type ClientInfo struct {
	GmToken        string // mqtt password
	GmUserName     string
	GmUserId       string
	GmSdkInfo      map[string]string //from mqtt userName
	ConnectMessage *message.ConnectMessage
	SubTopicLimit  int
}

type GetAuthFunc

type GetAuthFunc func(clientInfo *ClientInfo, topic string) interface{}

type TopicAclManger

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

func NewTopicAclManger

func NewTopicAclManger(providerName string, f GetAuthFunc) (*TopicAclManger, error)

func (*TopicAclManger) CheckPub

func (this *TopicAclManger) CheckPub(clientInfo *ClientInfo, topic string) bool

func (*TopicAclManger) CheckSub

func (this *TopicAclManger) CheckSub(clientInfo *ClientInfo, topic string) bool

func (*TopicAclManger) ProcessUnSub

func (this *TopicAclManger) ProcessUnSub(clientInfo *ClientInfo, topic string)

func (*TopicAclManger) SetAuthFunc

func (this *TopicAclManger) SetAuthFunc(f GetAuthFunc)

Jump to

Keyboard shortcuts

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