skydbtest

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapConn

type MapConn struct {
	UserMap map[string]skydb.UserInfo
	// contains filtered or unexported fields
}

MapConn is a naive memory implementation of skydb.Conn

func NewMapConn

func NewMapConn() *MapConn

NewMapConn returns a new MapConn.

func (*MapConn) AddRelation

func (conn *MapConn) AddRelation(user string, name string, targetUser string) error

AddRelation is not implemented.

func (*MapConn) Close

func (conn *MapConn) Close() error

Close does nothing.

func (*MapConn) CreateUser

func (conn *MapConn) CreateUser(userinfo *skydb.UserInfo) error

CreateUser creates a UserInfo in UserMap.

func (*MapConn) DeleteDevice

func (conn *MapConn) DeleteDevice(id string) error

DeleteDevice is not implemented.

func (*MapConn) DeleteDeviceByToken

func (conn *MapConn) DeleteDeviceByToken(token string, t time.Time) error

DeleteDeviceByToken is not implemented.

func (*MapConn) DeleteEmptyDevicesByTime

func (conn *MapConn) DeleteEmptyDevicesByTime(t time.Time) error

DeleteEmptyDevicesByTime is not implemented.

func (*MapConn) DeleteUser

func (conn *MapConn) DeleteUser(id string) error

DeleteUser remove an existing in UserMap.

func (*MapConn) GetAsset

func (conn *MapConn) GetAsset(name string, asset *skydb.Asset) error

GetAsset is not implemented.

func (*MapConn) GetDevice

func (conn *MapConn) GetDevice(id string, device *skydb.Device) error

GetDevice is not implemented.

func (*MapConn) GetUser

func (conn *MapConn) GetUser(id string, userinfo *skydb.UserInfo) error

GetUser returns a UserInfo in UserMap.

func (*MapConn) GetUserByPrincipalID

func (conn *MapConn) GetUserByPrincipalID(principalID string, userinfo *skydb.UserInfo) error

GetUserByPrincipalID returns a UserInfo by its principalID.

func (*MapConn) GetUserByUsernameEmail

func (conn *MapConn) GetUserByUsernameEmail(username string, email string, userinfo *skydb.UserInfo) error

GetUserByUsernameEmail returns a UserInfo in UserMap by email address.

func (*MapConn) PrivateDB

func (conn *MapConn) PrivateDB(userKey string) skydb.Database

PrivateDB is not implemented.

func (*MapConn) PublicDB

func (conn *MapConn) PublicDB() skydb.Database

PublicDB is not implemented.

func (*MapConn) QueryDevicesByUser

func (conn *MapConn) QueryDevicesByUser(user string) ([]skydb.Device, error)

QueryDevicesByUser is not implemented.

func (*MapConn) QueryRelation

func (conn *MapConn) QueryRelation(user string, name string, direction string, config skydb.QueryConfig) []skydb.UserInfo

QueryRelation is not implemented.

func (*MapConn) QueryRelationCount

func (conn *MapConn) QueryRelationCount(user string, name string, direction string) (uint64, error)

QueryRelationCount is not implemented.

func (*MapConn) QueryUser

func (conn *MapConn) QueryUser(emails []string) ([]skydb.UserInfo, error)

QueryUser is not implemented.

func (*MapConn) RemoveRelation

func (conn *MapConn) RemoveRelation(user string, name string, targetUser string) error

RemoveRelation is not implemented.

func (*MapConn) SaveAsset

func (conn *MapConn) SaveAsset(asset *skydb.Asset) error

SaveAsset is not implemented.

func (*MapConn) SaveDevice

func (conn *MapConn) SaveDevice(device *skydb.Device) error

SaveDevice is not implemented.

func (*MapConn) Subscribe

func (conn *MapConn) Subscribe(recordEventChan chan skydb.RecordEvent) error

Subscribe is not implemented.

func (*MapConn) UpdateUser

func (conn *MapConn) UpdateUser(userinfo *skydb.UserInfo) error

UpdateUser updates an existing UserInfo in UserMap.

type MapDB

type MapDB struct {
	RecordMap       RecordMap
	SubscriptionMap SubscriptionMap
	skydb.Database
}

MapDB is a naive memory implementation of skydb.Database.

func NewMapDB

func NewMapDB() *MapDB

NewMapDB returns a new MapDB ready for use.

func (*MapDB) Delete

func (db *MapDB) Delete(id skydb.RecordID) error

Delete remove the specified key from RecordMap.

func (*MapDB) DeleteSubscription

func (db *MapDB) DeleteSubscription(name string, deviceID string) error

DeleteSubscription deletes the specified key from SubscriptionMap.

func (*MapDB) Extend

func (db *MapDB) Extend(recordType string, schema skydb.RecordSchema) error

Extend does nothing.

func (*MapDB) Get

func (db *MapDB) Get(id skydb.RecordID, record *skydb.Record) error

Get returns a Record from RecordMap.

func (*MapDB) GetSubscription

func (db *MapDB) GetSubscription(name string, deviceID string, subscription *skydb.Subscription) error

GetSubscription return a Subscription from SubscriptionMap.

func (*MapDB) ID

func (db *MapDB) ID() string

ID returns a mock Database ID.

func (*MapDB) Query

func (db *MapDB) Query(query *skydb.Query) (*skydb.Rows, error)

Query is not implemented.

func (*MapDB) Save

func (db *MapDB) Save(record *skydb.Record) error

Save assigns Record to RecordMap.

func (*MapDB) SaveSubscription

func (db *MapDB) SaveSubscription(subscription *skydb.Subscription) error

SaveSubscription assigns to SubscriptionMap.

type RecordMap

type RecordMap map[string]skydb.Record

RecordMap is a string=>Record map

type SubscriptionMap

type SubscriptionMap map[string]skydb.Subscription

SubscriptionMap is a string=>Subscription map

Jump to

Keyboard shortcuts

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