dynsecgo

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 5 Imported by: 0

README

dynsecgo

Mosquitto Dynamic Security Plugin Golang

Go Reference

Documentation

Index

Constants

View Source
const (

	////// acltypes
	PubSend      = "publishClientSend"
	PubReceive   = "publishClientReceive"
	SubPattern   = "subscribePattern"
	SubLiteral   = "subscribeLiteral"
	UnsubPattern = "unsubscribePattern"
	UnsubLiteral = "unsubscribeLiteral"
)

Variables

View Source
var AclType = struct {
	PublishClientSend    string
	PublishClientReceive string
	SubscribeLiteral     string
	SubscribePattern     string
	UnsubscribeLiteral   string
	UnsubscribePattern   string
}{
	PublishClientSend:    "publishClientSend",
	PublishClientReceive: "publishClientReceive",
	SubscribeLiteral:     "subscribeLiteral",
	SubscribePattern:     "subscribePattern",
	UnsubscribeLiteral:   "unsubscribeLiteral",
	UnsubscribePattern:   "unsubscribePattern",
}

Functions

This section is empty.

Types

type Acl added in v0.0.4

type Acl struct {
	Acltype  string `json:"acltype"`
	Topic    string `json:"topic"`
	Priority int    `json:"priority"`
	Allow    bool   `json:"allow"`
}

type Client added in v0.0.3

type Client struct {
	UserName        string  `json:"username"`
	Textname        string  `json:"textname,omitempty" example:"1"`
	Textdescription string  `json:"textdescription,omitempty" example:"2"`
	Disabled        bool    `json:"disabled"`
	Roles           []role  `json:"roles,omitempty"`
	Groups          []group `json:"groups,omitempty"`
}

type DynSec

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

func NewDynSecClient added in v0.0.4

func NewDynSecClient(user, password, clientID, host string, port int, runAlways bool) *DynSec

NewDynSecClient

func (*DynSec) AddBaseClient added in v0.0.3

func (ds *DynSec) AddBaseClient(clientName, password, clientId string) error

AddBaseClient

func (*DynSec) AddBaseGroup added in v0.0.4

func (ds *DynSec) AddBaseGroup(groupName string) error

AddBaseGroup

func (*DynSec) AddClient

func (ds *DynSec) AddClient(clientName, password, clientID, textName, textdescription string, roleName []string, rolePriority []int, groupName []string, groupPriority []int) error

AddClient

func (*DynSec) AddGroup

func (ds *DynSec) AddGroup(groupName string, roleName []string, rolePriority []int) error

AddGroup

func (*DynSec) AddRole

func (ds *DynSec) AddRole(roleName, textName, textdescription string, aclType []string, topic []string, priority []int, allow []bool) error

AddRole

func (*DynSec) DeleteClient added in v0.0.3

func (ds *DynSec) DeleteClient(clientName string) error

DeleteClient

func (*DynSec) DeleteGroup added in v0.0.4

func (ds *DynSec) DeleteGroup(groupName string) error

DeleteGroup

func (*DynSec) DeleteRole added in v0.0.6

func (ds *DynSec) DeleteRole(roleName string) error

DeleteRole

func (*DynSec) DisableClient added in v0.0.3

func (ds *DynSec) DisableClient(clientName string) error

DisableClient

func (*DynSec) EnableClient added in v0.0.3

func (ds *DynSec) EnableClient(clientName string) error

EnableClient

func (*DynSec) ExistClient

func (ds *DynSec) ExistClient(clientName string) (bool, error)

ExistClient

func (*DynSec) ExistGroup

func (ds *DynSec) ExistGroup(groupName string) (bool, error)

ExistGroup

func (*DynSec) ExistRole

func (ds *DynSec) ExistRole(roleName string) (bool, error)

ExistRole

func (*DynSec) GetClient

func (ds *DynSec) GetClient(clientName string) (Client, error)

GetClient

func (*DynSec) GetClientJson added in v0.0.3

func (ds *DynSec) GetClientJson(clientName string) (string, error)

GetClientJson

func (*DynSec) GetRoleJson added in v0.0.4

func (ds *DynSec) GetRoleJson(roleName string) ([]byte, error)

GetRole

func (*DynSec) SetTimeout added in v0.0.3

func (ds *DynSec) SetTimeout(timeout time.Duration)

SetTimeout Millisecond

type DynSecCommand added in v0.0.5

type DynSecCommand struct {
}

func NewDynSecCommand added in v0.0.3

func NewDynSecCommand() *DynSecCommand

NewDynSecCommand

func (*DynSecCommand) Acl added in v0.0.5

func (dsc *DynSecCommand) Acl(aclType, topic string, priority int, allow bool) Acl

Acls

func (*DynSecCommand) AddClient added in v0.0.5

func (dsc *DynSecCommand) AddClient(clientName, password, clientID, textName, textdescription string, roleName []string, rolePriority []int, groupName []string, groupPriority []int) ([]byte, error)

AddClient

func (*DynSecCommand) AddGroup added in v0.0.5

func (dsc *DynSecCommand) AddGroup(groupName string, roleName []string, rolePriority []int) ([]byte, error)

AddGroup

func (*DynSecCommand) AddRole added in v0.0.5

func (dsc *DynSecCommand) AddRole(roleName, textName, textdescription string, acls []Acl) ([]byte, error)

AddRole

func (*DynSecCommand) DeleteClient added in v0.0.5

func (dsc *DynSecCommand) DeleteClient(clientName string) ([]byte, error)

DeleteClient command

func (*DynSecCommand) DeleteGroup added in v0.0.5

func (dsc *DynSecCommand) DeleteGroup(groupName string) ([]byte, error)

DeleteGroup command

func (*DynSecCommand) DeleteRole added in v0.0.6

func (dsc *DynSecCommand) DeleteRole(roleName string) ([]byte, error)

DeleteRole command

func (*DynSecCommand) DisableClient added in v0.0.5

func (dsc *DynSecCommand) DisableClient(clientName string) ([]byte, error)

DisableClient

func (*DynSecCommand) EnableClient added in v0.0.5

func (dsc *DynSecCommand) EnableClient(clientName string) ([]byte, error)

EnableClient

func (*DynSecCommand) GetClient added in v0.0.5

func (dsc *DynSecCommand) GetClient(clientName string) ([]byte, error)

GetClient command

func (*DynSecCommand) GetGroup added in v0.0.5

func (dsc *DynSecCommand) GetGroup(groupName string) ([]byte, error)

GetGroup

func (*DynSecCommand) GetRole added in v0.0.5

func (dsc *DynSecCommand) GetRole(roleName string) ([]byte, error)

GetRole

Jump to

Keyboard shortcuts

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