Documentation ¶
Index ¶
- type MapConn
- func (conn *MapConn) AddRelation(user string, name string, targetUser string) error
- func (conn *MapConn) Close() error
- func (conn *MapConn) CreateUser(userinfo *skydb.UserInfo) error
- func (conn *MapConn) DeleteDevice(id string) error
- func (conn *MapConn) DeleteDevicesByToken(token string, t time.Time) error
- func (conn *MapConn) DeleteEmptyDevicesByTime(t time.Time) error
- func (conn *MapConn) DeleteUser(id string) error
- func (conn *MapConn) GetAdminRoles() ([]string, error)
- func (conn *MapConn) GetAsset(name string, asset *skydb.Asset) error
- func (conn *MapConn) GetDefaultRoles() ([]string, error)
- func (conn *MapConn) GetDevice(id string, device *skydb.Device) error
- func (conn *MapConn) GetRecordAccess(recordType string) (skydb.RecordACL, error)
- func (conn *MapConn) GetUser(id string, userinfo *skydb.UserInfo) error
- func (conn *MapConn) GetUserByPrincipalID(principalID string, userinfo *skydb.UserInfo) error
- func (conn *MapConn) GetUserByUsernameEmail(username string, email string, userinfo *skydb.UserInfo) error
- func (conn *MapConn) PrivateDB(userKey string) skydb.Database
- func (conn *MapConn) PublicDB() skydb.Database
- func (conn *MapConn) QueryDevicesByUser(user string) ([]skydb.Device, error)
- func (conn *MapConn) QueryRelation(user string, name string, direction string, config skydb.QueryConfig) []skydb.UserInfo
- func (conn *MapConn) QueryRelationCount(user string, name string, direction string) (uint64, error)
- func (conn *MapConn) QueryUser(emails []string, usernames []string) ([]skydb.UserInfo, error)
- func (conn *MapConn) RemoveRelation(user string, name string, targetUser string) error
- func (conn *MapConn) SaveAsset(asset *skydb.Asset) error
- func (conn *MapConn) SaveDevice(device *skydb.Device) error
- func (conn *MapConn) SetAdminRoles(roles []string) error
- func (conn *MapConn) SetDefaultRoles(roles []string) error
- func (conn *MapConn) SetRecordAccess(recordType string, acl skydb.RecordACL) error
- func (conn *MapConn) Subscribe(recordEventChan chan skydb.RecordEvent) error
- func (conn *MapConn) UpdateUser(userinfo *skydb.UserInfo) error
- type MapDB
- func (db *MapDB) DatabaseType() skydb.DatabaseType
- func (db *MapDB) Delete(id skydb.RecordID) error
- func (db *MapDB) DeleteSchema(recordType, columnName string) error
- func (db *MapDB) DeleteSubscription(name string, deviceID string) error
- func (db *MapDB) Extend(recordType string, schema skydb.RecordSchema) (bool, error)
- func (db *MapDB) Get(id skydb.RecordID, record *skydb.Record) error
- func (db *MapDB) GetRecordSchemas() (map[string]skydb.RecordSchema, error)
- func (db *MapDB) GetSchema(recordType string) (skydb.RecordSchema, error)
- func (db *MapDB) GetSubscription(name string, deviceID string, subscription *skydb.Subscription) error
- func (db *MapDB) ID() string
- func (db *MapDB) IsReadOnly() bool
- func (db *MapDB) Query(query *skydb.Query) (*skydb.Rows, error)
- func (db *MapDB) RenameSchema(recordType, oldColumnName, newColumnName string) error
- func (db *MapDB) Save(record *skydb.Record) error
- func (db *MapDB) SaveSubscription(subscription *skydb.Subscription) error
- func (db *MapDB) UserRecordType() string
- type MockTxDatabase
- type RecordMap
- type RecordSchemaMap
- type SubscriptionMap
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 skydb.Conn // contains filtered or unexported fields }
MapConn is a naive memory implementation of skydb.Conn
func (*MapConn) AddRelation ¶
AddRelation is not implemented.
func (*MapConn) CreateUser ¶
CreateUser creates a UserInfo in UserMap.
func (*MapConn) DeleteDevice ¶
DeleteDevice is not implemented.
func (*MapConn) DeleteDevicesByToken ¶
DeleteDevicesByToken is not implemented.
func (*MapConn) DeleteEmptyDevicesByTime ¶
DeleteEmptyDevicesByTime is not implemented.
func (*MapConn) DeleteUser ¶
DeleteUser remove an existing in UserMap.
func (*MapConn) GetAdminRoles ¶
GetAdminRoles is not implemented.
func (*MapConn) GetDefaultRoles ¶
GetDefaultRoles always return user for testing
func (*MapConn) GetRecordAccess ¶
GetRecordAccess returns record creation access of a specific type
func (*MapConn) GetUserByPrincipalID ¶
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) QueryDevicesByUser ¶
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 ¶
QueryRelationCount is not implemented.
func (*MapConn) RemoveRelation ¶
RemoveRelation is not implemented.
func (*MapConn) SaveDevice ¶
SaveDevice is not implemented.
func (*MapConn) SetAdminRoles ¶
SetAdminRoles is not implemented.
func (*MapConn) SetDefaultRoles ¶
SetDefaultRoles is not implemented.
func (*MapConn) SetRecordAccess ¶
SetRecordAccess sets record creation access
type MapDB ¶
type MapDB struct { RecordMap RecordMap SubscriptionMap SubscriptionMap RecordSchemaMap RecordSchemaMap DBConn skydb.Conn skydb.Database }
MapDB is a naive memory implementation of skydb.Database.
func (*MapDB) DatabaseType ¶
func (db *MapDB) DatabaseType() skydb.DatabaseType
func (*MapDB) DeleteSchema ¶
func (*MapDB) DeleteSubscription ¶
DeleteSubscription deletes the specified key from SubscriptionMap.
func (*MapDB) GetRecordSchemas ¶
func (db *MapDB) GetRecordSchemas() (map[string]skydb.RecordSchema, error)
GetRecordSchemas returns a list of all existing record type
func (*MapDB) GetSchema ¶
func (db *MapDB) GetSchema(recordType string) (skydb.RecordSchema, error)
GetSchema returns the record schema of a record type
func (*MapDB) GetSubscription ¶
func (db *MapDB) GetSubscription(name string, deviceID string, subscription *skydb.Subscription) error
GetSubscription return a Subscription from SubscriptionMap.
func (*MapDB) IsReadOnly ¶
func (*MapDB) RenameSchema ¶
func (*MapDB) SaveSubscription ¶
func (db *MapDB) SaveSubscription(subscription *skydb.Subscription) error
SaveSubscription assigns to SubscriptionMap.
func (*MapDB) UserRecordType ¶
type MockTxDatabase ¶
MockTxDatabase implements and records TxDatabase's methods and delegates other calls to underlying Database
func NewMockTxDatabase ¶
func NewMockTxDatabase(backingDB skydb.Database) *MockTxDatabase
func (*MockTxDatabase) Begin ¶
func (db *MockTxDatabase) Begin() error
func (*MockTxDatabase) Commit ¶
func (db *MockTxDatabase) Commit() error
func (*MockTxDatabase) Rollback ¶
func (db *MockTxDatabase) Rollback() error
type RecordSchemaMap ¶
type RecordSchemaMap map[string]skydb.RecordSchema
RecordSchemaMap is a string=>RecordSchema map
type SubscriptionMap ¶
type SubscriptionMap map[string]skydb.Subscription
SubscriptionMap is a string=>Subscription map