metathings_moqusitto_plugin_storage

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownStorageDriver = errors.New(" unknown storage driver")
)

Functions

This section is empty.

Types

type MongoStorage

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

func (*MongoStorage) AddPermission

func (s *MongoStorage) AddPermission(u string, p *Permission) error

func (*MongoStorage) AddUser

func (s *MongoStorage) AddUser(u *User) error

func (*MongoStorage) ExistUser

func (s *MongoStorage) ExistUser(u string) (bool, error)

func (*MongoStorage) GetUser

func (s *MongoStorage) GetUser(u string) (*User, error)

func (*MongoStorage) RemovePermission

func (s *MongoStorage) RemovePermission(u string, t string) error

func (*MongoStorage) RemoveUser

func (s *MongoStorage) RemoveUser(u string) error

type MongoStorageFactory

type MongoStorageFactory struct{}

func (*MongoStorageFactory) New

func (*MongoStorageFactory) New(args ...interface{}) (Storage, error)

type MongoStorageOption

type MongoStorageOption struct {
	Mongo struct {
		Uri        string
		Database   string
		Collection string
	}
	Pool struct {
		Initial int
		Max     int
	}
}

type Permission

type Permission struct {
	Topic *string
	Mask  *string
}

type Storage

type Storage interface {
	AddUser(*User) error
	RemoveUser(string) error
	AddPermission(string, *Permission) error
	RemovePermission(username string, topic string) error
	GetUser(string) (*User, error)
	ExistUser(string) (bool, error)
}

func NewStorage

func NewStorage(name string, args ...interface{}) (Storage, error)

type StorageFactory

type StorageFactory interface {
	New(...interface{}) (Storage, error)
}

type User

type User struct {
	Username    *string
	Password    *string
	Superuser   *bool
	Permissions []*Permission
}

Jump to

Keyboard shortcuts

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