Documentation ¶
Index ¶
- Variables
- type AppspaceMetaDB
- type DbConn
- type InfoModel
- type UsersV0
- func (u *UsersV0) Create(appspaceID domain.AppspaceID, authType string, authID string) (domain.ProxyID, error)
- func (u *UsersV0) Delete(appspaceID domain.AppspaceID, proxyID domain.ProxyID) error
- func (u *UsersV0) Get(appspaceID domain.AppspaceID, proxyID domain.ProxyID) (domain.AppspaceUser, error)
- func (u *UsersV0) GetAll(appspaceID domain.AppspaceID) ([]domain.AppspaceUser, error)
- func (u *UsersV0) GetByDropID(appspaceID domain.AppspaceID, dropID string) (domain.AppspaceUser, error)
- func (u *UsersV0) UpdateAuth(appspaceID domain.AppspaceID, proxyID domain.ProxyID, authType string, ...) error
- func (u *UsersV0) UpdateMeta(appspaceID domain.AppspaceID, proxyID domain.ProxyID, displayName string, ...) error
Constants ¶
This section is empty.
Variables ¶
var ErrAuthIDExists = errors.New("auth ID (email or dropid) not unique in this appspace")
ErrAuthIDExists is returned when the appspace already has a user with that auth_id string
Functions ¶
This section is empty.
Types ¶
type AppspaceMetaDB ¶
type AppspaceMetaDB struct { Config *domain.RuntimeConfig `checkinject:"required"` //Validator domain.Validator AppspaceModel interface { GetFromID(domain.AppspaceID) (*domain.Appspace, error) } `checkinject:"required"` AppspaceStatus interface { IsLockedClosed(domain.AppspaceID) bool } `checkinject:"required"` // contains filtered or unexported fields }
AppspaceMetaDB opens and tracks connections to appspace meta DBs
func (*AppspaceMetaDB) CloseConn ¶
func (mdb *AppspaceMetaDB) CloseConn(appspaceID domain.AppspaceID) error
CloseConn closes the db file and removes connection from conns The expectation is that this is called after the appspace has been confirmed stopped
func (*AppspaceMetaDB) Create ¶
func (mdb *AppspaceMetaDB) Create(appspaceID domain.AppspaceID, dsAPIVersion int) error
Create an apspace meta DB file for an appspace. Should specify schema version or DS API version, and branch accordingly.
func (*AppspaceMetaDB) GetHandle ¶
func (mdb *AppspaceMetaDB) GetHandle(appspaceID domain.AppspaceID) (*sqlx.DB, error)
GetHandle returns the db handle for the appspace
func (*AppspaceMetaDB) Init ¶
func (mdb *AppspaceMetaDB) Init()
Init initializes data structures as needed
type DbConn ¶
type DbConn struct {
// contains filtered or unexported fields
}
DbConn holds the db handle and relevant request data
type InfoModel ¶
type InfoModel struct { AppspaceMetaDB interface { GetHandle(domain.AppspaceID) (*sqlx.DB, error) } `checkinject:"required"` }
InfoModel interacts with the info table of appspace meata db
func (*InfoModel) GetAppspaceMetaInfo ¶
func (m *InfoModel) GetAppspaceMetaInfo(dataPath string) (domain.AppspaceMetaInfo, error)
GetAppspaceMetaInfo returns the schema as stored in the appspace meta db at path But this should really return all basic metadata info about the appspace app, version, domain, etc... Or you could return api version (which should also be stored with appspace presumably) .. and then get versioned structs with all info.
type UsersV0 ¶
type UsersV0 struct { AppspaceMetaDB interface { GetHandle(domain.AppspaceID) (*sqlx.DB, error) } }
UsersV0 stores the user's DropIDs
func (*UsersV0) Create ¶
func (u *UsersV0) Create(appspaceID domain.AppspaceID, authType string, authID string) (domain.ProxyID, error)
Create an appspace user with provided auth.
func (*UsersV0) Delete ¶
Delete the appspace user Note: need more thought on what it measn to "delete": What happens with the user's data on the appspace?
func (*UsersV0) Get ¶
func (u *UsersV0) Get(appspaceID domain.AppspaceID, proxyID domain.ProxyID) (domain.AppspaceUser, error)
Get returns an AppspaceUser
func (*UsersV0) GetAll ¶
func (u *UsersV0) GetAll(appspaceID domain.AppspaceID) ([]domain.AppspaceUser, error)
GetAll returns an appspace's list of users.
func (*UsersV0) GetByDropID ¶
func (u *UsersV0) GetByDropID(appspaceID domain.AppspaceID, dropID string) (domain.AppspaceUser, error)
GetByDropID returns an appspace that matches the dropid string It returns sql.ErrNoRows if not found