Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateKey(contract uint32, topic []byte, permissions uint32) (string, error)
- type Key
- func (k Key) Encode() string
- func (k Key) HasPermission(flag uint32) bool
- func (k Key) IsEmpty() bool
- func (k Key) Permissions() uint32
- func (k Key) SetPermissions(value uint32)
- func (k Key) SetTarget(contract uint32, topic []byte) error
- func (k Key) ValidateTopic(contract uint32, topic []byte) (ok bool, wildcard bool)
- type Topic
Constants ¶
View Source
const ( AllowNone = uint32(0) // Key has no privileges. AllowRead = uint32(1 << 1) // Key should be allowed to subscribe to the topic. AllowWrite = uint32(1 << 2) // Key should be allowed to publish to the topic. AllowReadWrite = AllowRead | AllowWrite // Key should be allowed to read and write to the topic. // Topic types TopicInvalid = uint8(iota) TopicStatic TopicWildcard TopicKeySeparator = '/' TopicSeparator = '.' // The separator character. )
Access types for a security key.
Variables ¶
View Source
var (
ErrTargetTooLong = errors.New("topic can not have more than 23 parts")
)
Key errors
Functions ¶
Types ¶
type Key ¶
type Key []byte
Key represents a security key.
func (Key) HasPermission ¶
HasPermission check whether the key provides some permission.
func (Key) SetPermissions ¶
SetPermissions sets the permission flags.
Click to show internal directories.
Click to hide internal directories.