Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type HandlePool ¶
HandlePool is used to contain a sequential list of integer handles. Storage is a bit set.
func NewHandlePool ¶
func NewHandlePool(size uint) *HandlePool
NewHandlePool returns a new handle pool with size entries available.
func (*HandlePool) Acquire ¶
func (handles *HandlePool) Acquire() (int, error)
Acquire returns the lowest available id in the pool, or error if exhausted.
func (*HandlePool) Release ¶
func (handles *HandlePool) Release(handle int)
Release returns the id back into the pool
type UUIDEncrypter ¶
type UUIDEncrypter struct {
// contains filtered or unexported fields
}
UUIDEncrypter allows binary data up to the block size (16 bytes) to be encoded and used as a key (uuid).
var Encrypter *UUIDEncrypter
func NewUUIDEncrypter ¶
func NewUUIDEncrypter() (*UUIDEncrypter, error)
func (*UUIDEncrypter) DecodePair ¶
func (u *UUIDEncrypter) DecodePair(uuid string) (int, int, error)
DecodePair takes a uuid string created by EncodePair and reverses that into the original pair of ints.
func (*UUIDEncrypter) EncodePair ¶
func (u *UUIDEncrypter) EncodePair(a, b int) string
EncodePair takes a pair of ints and encodes them cryptographically as a uuid string
Click to show internal directories.
Click to hide internal directories.