Documentation
¶
Index ¶
- Variables
- func NewUserObject(userService UserService, email string) (*UserObject, *DBError)
- func PrintQuery(query string, args ...interface{})
- func PrintResult(i interface{})
- type DBError
- type DBResult
- type DBService
- func (u DBService) Del(i interface{}) *DBError
- func (u DBService) Delete(sql string, id int64) *DBError
- func (u DBService) FindByID(tableName string, id int64, i interface{}) (interface{}, *DBError)
- func (u DBService) FindByName(tableName string, name string, i interface{}) (interface{}, *DBError)
- func (u DBService) Insert(tableName string, i interface{}) (sql.Result, *DBError)
- func (u DBService) List(tableName string, dest interface{}) *DBError
- func (u DBService) ListBy(tableName string, dest interface{}, where string, args ...interface{}) *DBError
- func (u DBService) MustExec(sql string, args ...interface{}) *DBError
- func (u DBService) NamedExec(sql string, obj interface{}) (sql.Result, *DBError)
- func (u DBService) PrepareNamed(sql string, arg interface{}) (sql.Result, *DBError)
- func (u DBService) Save(i interface{}) *DBError
- func (u DBService) Select(dest interface{}, query string, args ...interface{}) (interface{}, *DBError)
- type IDE
- type IDERepo
- type IDERuntimeInstall
- type Mappable
- type MappingConfig
- type RuntimeInstall
- type User
- type UserIDE
- type UserObject
- func (uo *UserObject) DoesUserHaveIDE(ideName string) (bool, *DBError)
- func (uo *UserObject) DoesUserHaveRuntimeInstallFor(ide IDE, runtimeInstallName string) (bool, *DBError)
- func (uo *UserObject) GetIDE(ideName string) (*IDE, *DBError)
- func (uo *UserObject) IDEs() ([]IDE, *DBError)
- func (uo *UserObject) RuntimeInstallsFor(ide IDE) ([]RuntimeInstall, *DBError)
- func (uo *UserObject) UserIDE(ide IDE) (UserIDE, *DBError)
- type UserRepo
- type UserService
- func (u UserService) DeleteALLIDEReposForUser(userID int64) *DBError
- func (u UserService) DeleteALLIDERuntimeInstallsForUser(userID int64) *DBError
- func (u UserService) DeleteALLUserIDEsForUser(userID int64) *DBError
- func (u UserService) DeleteALLUserReposForUser(userID int64) *DBError
- func (u UserService) FindBy(i interface{}, where string, args ...interface{}) *DBError
- func (u UserService) FindUserByGoogleID(googleIDHashed string) (User, *DBError)
- func (u UserService) FindUserIDERepoURIsByUserAndIDE(username string, ide string) (*[]string, *DBError)
- func (u UserService) FindUserIDERuntimeInstallsByUsernameAndIDE(dest interface{}, username string, ide string) *DBError
- func (u UserService) FindUserIDEsByUserID(userID int64) (*[]string, *DBError)
- func (u UserService) UpdateGoogleID(user User) (sql.Result, *DBError)
- func (u UserService) UpdateProfile(user User) (sql.Result, *DBError)
Constants ¶
This section is empty.
Variables ¶
var CreateSchema = `` /* 3228-byte string literal not displayed */
CreateSchema SQL script for creating the schema
var DropSchema = `` /* 292-byte string literal not displayed */
DropSchema SQL script for dropping the schema
Functions ¶
func NewUserObject ¶ added in v0.1.15
func NewUserObject(userService UserService, email string) (*UserObject, *DBError)
func PrintQuery ¶ added in v0.2.1
func PrintQuery(query string, args ...interface{})
func PrintResult ¶ added in v0.2.1
func PrintResult(i interface{})
Types ¶
type DBError ¶
DBError database error
type DBResult ¶
type DBResult struct {
// contains filtered or unexported fields
}
DBResult for capturing result information for inserts
func (DBResult) LastInsertId ¶
LastInsertId last inserted id
func (DBResult) RowsAffected ¶
RowsAffected number of rows affected
type DBService ¶
DBService db service
func NewDBService ¶
NewDBService instantiates new db service
func (DBService) FindByName ¶ added in v0.2.0
FindByName finds by name
func (DBService) ListBy ¶ added in v0.2.0
func (u DBService) ListBy(tableName string, dest interface{}, where string, args ...interface{}) *DBError
ListBy lists all rows of given entity with where clause
func (DBService) PrepareNamed ¶
PrepareNamed wrapper for sqlx.PrepareNamed. However, it handles retrieval of new id
type IDE ¶
IDE ide
func (*IDE) Meta ¶ added in v0.2.0
func (ur *IDE) Meta() MappingConfig
Meta provides mapping config specific to user
func (*IDE) PrimaryKey ¶ added in v0.2.0
PrimaryKey returns primary key
func (*IDE) SetPrimaryKey ¶ added in v0.2.0
SetPrimaryKey updates the primary key value after insert
type IDERepo ¶
IDERepo ide repo
func (*IDERepo) Meta ¶ added in v0.2.0
func (ur *IDERepo) Meta() MappingConfig
Meta provides mapping config specific to ide repo
func (*IDERepo) PrimaryKey ¶ added in v0.2.0
PrimaryKey returns primary key
func (*IDERepo) SetPrimaryKey ¶ added in v0.2.0
SetPrimaryKey updates the primary key value after insert
type IDERuntimeInstall ¶
type IDERuntimeInstall struct { ID int64 `db:"id"` UserIDEID int64 `db:"user_ide_id"` RuntimeInstallID int64 `db:"runtime_install_id"` }
IDERuntimeInstall ide runtime install
func (*IDERuntimeInstall) Meta ¶ added in v0.2.0
func (ur *IDERuntimeInstall) Meta() MappingConfig
Meta provides mapping config specific to ide runtime install
func (*IDERuntimeInstall) PrimaryKey ¶ added in v0.2.0
func (ur *IDERuntimeInstall) PrimaryKey() int64
PrimaryKey returns primary key
func (*IDERuntimeInstall) SetPrimaryKey ¶ added in v0.2.0
func (ur *IDERuntimeInstall) SetPrimaryKey(id int64)
SetPrimaryKey updates the primary key value after insert
func (IDERuntimeInstall) String ¶ added in v0.2.1
func (u IDERuntimeInstall) String() string
type Mappable ¶ added in v0.2.0
type Mappable interface { Meta() MappingConfig PrimaryKey() int64 SetPrimaryKey(int64) }
Mappable structs returns sql specific meta data
type MappingConfig ¶ added in v0.2.0
type MappingConfig struct {
TableName string
}
MappingConfig provides addtional hints to DBService
func GetMappingConfigFromSlicePointer ¶ added in v0.2.0
func GetMappingConfigFromSlicePointer(dest interface{}) *MappingConfig
type RuntimeInstall ¶
type RuntimeInstall struct { ID int64 `db:"id"` Name string `db:"name"` ScriptBody string `db:"script_body"` }
RuntimeInstall runtime install
func (*RuntimeInstall) Meta ¶ added in v0.2.0
func (ur *RuntimeInstall) Meta() MappingConfig
Meta provides mapping config specific to runtime install
func (*RuntimeInstall) PrimaryKey ¶ added in v0.2.0
func (ur *RuntimeInstall) PrimaryKey() int64
PrimaryKey returns primary key
func (*RuntimeInstall) SetPrimaryKey ¶ added in v0.2.0
func (ur *RuntimeInstall) SetPrimaryKey(id int64)
SetPrimaryKey updates the primary key value after insert
type User ¶
type User struct { ID int64 `db:"id"` GoogleID string `db:"google_id"` Username string `db:"username"` Password string `db:"password"` Email string `db:"email"` HashedEmail string `db:"hashed_email"` IsActive bool `db:"is_active"` PrivateKey string `db:"private_key"` PublicKey string `db:"public_key"` PublicKeyID int64 `db:"public_key_id"` DockerTag string IDEs []IDE RuntimeInstalls []string Repos []string PostgresUsername string PGHost string PGDBName string }
User user
func (*User) Meta ¶ added in v0.2.0
func (u *User) Meta() MappingConfig
Meta provides mapping config specific to user
func (*User) PrimaryKey ¶ added in v0.2.0
PrimaryKey returns primary key
func (*User) SetPrimaryKey ¶ added in v0.2.0
SetPrimaryKey updates the primary key value after insert
type UserIDE ¶
UserIDE user ide
func (*UserIDE) Meta ¶ added in v0.2.0
func (ur *UserIDE) Meta() MappingConfig
Meta provides mapping config specific to user ide
func (*UserIDE) PrimaryKey ¶ added in v0.2.0
PrimaryKey returns primary key
func (*UserIDE) SetPrimaryKey ¶ added in v0.2.0
SetPrimaryKey updates the primary key value after insert
type UserObject ¶ added in v0.1.15
type UserObject struct { User UserService UserService }
func (*UserObject) DoesUserHaveIDE ¶ added in v0.1.15
func (uo *UserObject) DoesUserHaveIDE(ideName string) (bool, *DBError)
func (*UserObject) DoesUserHaveRuntimeInstallFor ¶ added in v0.1.15
func (uo *UserObject) DoesUserHaveRuntimeInstallFor(ide IDE, runtimeInstallName string) (bool, *DBError)
func (*UserObject) GetIDE ¶ added in v0.1.15
func (uo *UserObject) GetIDE(ideName string) (*IDE, *DBError)
func (*UserObject) IDEs ¶ added in v0.1.15
func (uo *UserObject) IDEs() ([]IDE, *DBError)
func (*UserObject) RuntimeInstallsFor ¶ added in v0.1.15
func (uo *UserObject) RuntimeInstallsFor(ide IDE) ([]RuntimeInstall, *DBError)
type UserRepo ¶
UserRepo user repo
func NewUserRepo ¶ added in v0.2.0
NewUserRepo returns new instance of user repo
func (*UserRepo) Meta ¶ added in v0.2.0
func (ur *UserRepo) Meta() MappingConfig
Meta provides mapping config specific to user
func (*UserRepo) PrimaryKey ¶ added in v0.2.0
PrimaryKey returns primary key
func (*UserRepo) SetPrimaryKey ¶ added in v0.2.0
SetPrimaryKey updates the primary key value after insert
type UserService ¶
type UserService struct {
*DBService
}
UserService manages user data
func NewUserService ¶
func NewUserService(db *sqlx.DB) UserService
NewUserService instantiates new user service
func (UserService) DeleteALLIDEReposForUser ¶
func (u UserService) DeleteALLIDEReposForUser(userID int64) *DBError
DeleteALLIDEReposForUser deletes all ide repos for given user
func (UserService) DeleteALLIDERuntimeInstallsForUser ¶
func (u UserService) DeleteALLIDERuntimeInstallsForUser(userID int64) *DBError
DeleteALLIDERuntimeInstallsForUser deletes all ide runtime installs for given user
func (UserService) DeleteALLUserIDEsForUser ¶
func (u UserService) DeleteALLUserIDEsForUser(userID int64) *DBError
DeleteALLUserIDEsForUser deletes all user ides for given user
func (UserService) DeleteALLUserReposForUser ¶
func (u UserService) DeleteALLUserReposForUser(userID int64) *DBError
DeleteALLUserReposForUser deletes all user repos for given user
func (UserService) FindBy ¶ added in v0.2.0
func (u UserService) FindBy(i interface{}, where string, args ...interface{}) *DBError
FindBy finds ide by given where clause
func (UserService) FindUserByGoogleID ¶
func (u UserService) FindUserByGoogleID(googleIDHashed string) (User, *DBError)
FindUserByGoogleID finds user by google id
func (UserService) FindUserIDERepoURIsByUserAndIDE ¶ added in v0.2.0
func (u UserService) FindUserIDERepoURIsByUserAndIDE(username string, ide string) (*[]string, *DBError)
FindUserIDERepoURIsByUserAndIDE finds user ide repos by user and ide
func (UserService) FindUserIDERuntimeInstallsByUsernameAndIDE ¶ added in v0.2.0
func (u UserService) FindUserIDERuntimeInstallsByUsernameAndIDE(dest interface{}, username string, ide string) *DBError
FindUserIDERuntimeInstallsByUsernameAndIDE finds user installs by user and ide
func (UserService) FindUserIDEsByUserID ¶
func (u UserService) FindUserIDEsByUserID(userID int64) (*[]string, *DBError)
FindUserIDEsByUserID find user ides by user id
func (UserService) UpdateGoogleID ¶
func (u UserService) UpdateGoogleID(user User) (sql.Result, *DBError)
UpdateGoogleID updates user google id
func (UserService) UpdateProfile ¶
func (u UserService) UpdateProfile(user User) (sql.Result, *DBError)
UpdateProfile updates user profile