user

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2015 License: MIT Imports: 8 Imported by: 0

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