Documentation ¶
Index ¶
- Constants
- func Register(name string, provider Provider) error
- func UnRegister(name string)
- type AccessType
- type Error
- type Manager
- func (m *Manager) ACL(clientID, user, topic string, access AccessType) Status
- func (m *Manager) AddUser(param *UserParam) error
- func (m *Manager) DelUser(user string) error
- func (m *Manager) ListUsers(handle func(string, string, string, string, string)) error
- func (m *Manager) Password(user, password string) Status
- type Provider
- type SessionPermissions
- type Status
- type UserParam
Constants ¶
View Source
const ( AccessTypeRead AccessType = 0x1 AccessTypeWrite = 0x2 AccessTypeAll = 0x3 AccessTypeNone = 0x4 )
nolint: golint
View Source
const ( StatusAllow Status = 0 StatusDeny = 1 StatusNone = 2 )
nolint: golint
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessType ¶
type AccessType int
AccessType acl type
func (AccessType) Type ¶
func (t AccessType) Type() string
Type return string representation of the type
type Error ¶
type Error int
Error auth provider errors
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager auth
func (*Manager) ACL ¶
func (m *Manager) ACL(clientID, user, topic string, access AccessType) Status
ACL check permissions
type Provider ¶
type Provider interface { // Password try authenticate with username and password Password(string, string) Status // ACL check access type for client id with username ACL(id string, username string, topic string, accessType AccessType) Status ListUsers(handle func(string, string, string, string, string)) error AddUser(param *UserParam) error DelUser(user string) error }
Provider interface
type SessionPermissions ¶
type SessionPermissions interface {
ACL(id string, username string, topic string, accessType AccessType) Status
}
SessionPermissions check session permissions
Click to show internal directories.
Click to hide internal directories.