user

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2015 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	IDBytesLen = 16
)

Variables

This section is empty.

Functions

func GenerateRandomInt64InRange

func GenerateRandomInt64InRange(base int64, delta int) int64

func Int64Hash

func Int64Hash(value int64) []byte

func UUIDToID

func UUIDToID(uuid string) (v [IDBytesLen]byte, err error)

TODO: leverage a full functional UUID library

Types

type CounterHash

type CounterHash interface {
	Hash(key []byte, counter int64) []byte
}

func NewTimeHash

func NewTimeHash(baseHash StringHash) CounterHash

type HMACHash

type HMACHash struct {
}

func (HMACHash) Hash

func (h HMACHash) Hash(key []byte, data []byte) []byte

type ID

type ID struct {
	String string
	Bytes  [IDBytesLen]byte
	// contains filtered or unexported fields
}

The ID of en entity, in the form of an UUID.

func NewID

func NewID(id string) (ID, error)

func (ID) CmdKey

func (v ID) CmdKey() []byte

type RandomInt64InRange

type RandomInt64InRange func(base int64, delta int) int64

type StringHash

type StringHash interface {
	Hash(key []byte, data []byte) []byte
}

type TimeHash

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

func (TimeHash) Hash

func (h TimeHash) Hash(key []byte, counter int64) []byte

type TimedUserSet

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

func (*TimedUserSet) AddUser

func (us *TimedUserSet) AddUser(user User) error

func (TimedUserSet) GetUser

func (us TimedUserSet) GetUser(userHash []byte) (*ID, int64, bool)

type User

type User struct {
	Id ID `json:"id"` // The ID of this User.
}

User is the user account that is used for connection to a Point

type UserSet

type UserSet interface {
	AddUser(user User) error
	GetUser(timeHash []byte) (*ID, int64, bool)
}

func NewTimedUserSet

func NewTimedUserSet() UserSet

Jump to

Keyboard shortcuts

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