Documentation ¶
Index ¶
- type DBService
- func (ds *DBService) AddBuildDefinition(bd *entity.BuildDefinition) (uint, error)
- func (ds *DBService) AddBuildExecution(be *entity.BuildExecution) error
- func (ds *DBService) AddUser(user entity.User) (uint, error)
- func (ds *DBService) AddUserAction(action entity.UserAction) error
- func (ds *DBService) AddVariable(userVar entity.UserVariable) (uint, error)
- func (ds *DBService) AutoMigrate() error
- func (ds *DBService) DeleteBuildDefinition(bd *entity.BuildDefinition) error
- func (ds *DBService) DeleteUser(id uint) error
- func (ds *DBService) DeleteVariable(id uint) error
- func (ds *DBService) FindBuildDefinition(cond string, args ...interface{}) (entity.BuildDefinition, error)
- func (ds *DBService) FindBuildExecutions(query interface{}, args ...interface{}) ([]entity.BuildExecution, error)
- func (ds *DBService) FindUser(cond string, args ...interface{}) (entity.User, error)
- func (ds *DBService) FindVariable(cond string, args ...interface{}) (entity.UserVariable, error)
- func (ds *DBService) GetAllBuildDefinitions() ([]entity.BuildDefinition, error)
- func (ds *DBService) GetAllSettings() (map[string]string, error)
- func (ds *DBService) GetAllUsers() ([]entity.User, error)
- func (ds *DBService) GetAvailableVariablesForUser(userId uint) ([]entity.UserVariable, error)
- func (ds *DBService) GetBuildDefCaption(id uint) (string, error)
- func (ds *DBService) GetBuildDefinitionById(id uint) (entity.BuildDefinition, error)
- func (ds *DBService) GetBuildExecutionById(id int) (entity.BuildExecution, error)
- func (ds *DBService) GetNewestBuildDefinitions(limit int) ([]entity.BuildDefinition, error)
- func (ds *DBService) GetNewestBuildExecutions(limit int, query string, args ...interface{}) ([]entity.BuildExecution, error)
- func (ds *DBService) GetUserActionByToken(token string) (entity.UserAction, error)
- func (ds *DBService) GetUserByEmail(email string) (entity.User, error)
- func (ds *DBService) GetUserById(id uint) (entity.User, error)
- func (ds *DBService) GetUsernameById(id int) string
- func (ds *DBService) GetVariable(id int) (entity.UserVariable, error)
- func (ds *DBService) InsertUserAction(userId uint, purpose, token string, validity sql.NullTime) error
- func (ds *DBService) InvalidatePasswordResets(userId uint) error
- func (ds *DBService) Quit()
- func (ds *DBService) RowExists(query string, args ...interface{}) bool
- func (ds *DBService) SetSetting(name, value string) error
- func (ds *DBService) UpdateBuildDefinition(bd *entity.BuildDefinition) error
- func (ds *DBService) UpdateBuildExecution(be *entity.BuildExecution) error
- func (ds *DBService) UpdateUser(user entity.User) error
- func (ds *DBService) UpdateUserAction(userAction entity.UserAction) error
- func (ds *DBService) UpdateVariable(userVar entity.UserVariable) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBService ¶
type DBService struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg *configuration.AppConfig) *DBService
func (*DBService) AddBuildDefinition ¶
func (ds *DBService) AddBuildDefinition(bd *entity.BuildDefinition) (uint, error)
AddBuildDefinition adds a new build definition
func (*DBService) AddBuildExecution ¶
func (ds *DBService) AddBuildExecution(be *entity.BuildExecution) error
AddBuildExecution adds a new build execution
func (*DBService) AddUserAction ¶
func (ds *DBService) AddUserAction(action entity.UserAction) error
AddUserAction creates a given user action
func (*DBService) AddVariable ¶
func (ds *DBService) AddVariable(userVar entity.UserVariable) (uint, error)
func (*DBService) AutoMigrate ¶
AutoMigrate makes sure the database tables exist, corresponding to the supplied structs
func (*DBService) DeleteBuildDefinition ¶
func (ds *DBService) DeleteBuildDefinition(bd *entity.BuildDefinition) error
DeleteBuildDefinition removes a build definition
func (*DBService) DeleteUser ¶
DeleteUser removes a user by the given Id
func (*DBService) DeleteVariable ¶
func (*DBService) FindBuildDefinition ¶
func (ds *DBService) FindBuildDefinition(cond string, args ...interface{}) (entity.BuildDefinition, error)
FindBuildDefinition looks for a specific build definition
func (*DBService) FindBuildExecutions ¶
func (ds *DBService) FindBuildExecutions(query interface{}, args ...interface{}) ([]entity.BuildExecution, error)
FindBuildExecutions finds build executions by criteria
func (*DBService) FindVariable ¶
func (ds *DBService) FindVariable(cond string, args ...interface{}) (entity.UserVariable, error)
func (*DBService) GetAllBuildDefinitions ¶
func (ds *DBService) GetAllBuildDefinitions() ([]entity.BuildDefinition, error)
GetAllBuildDefinitions fetches all build definitions
func (*DBService) GetAllSettings ¶
GetAllSettings fetches all settings
func (*DBService) GetAllUsers ¶
GetAllUsers fetches a list of all users
func (*DBService) GetAvailableVariablesForUser ¶
func (ds *DBService) GetAvailableVariablesForUser(userId uint) ([]entity.UserVariable, error)
GetAvailableVariablesForUser determines all available variables for a user by the given Id
func (*DBService) GetBuildDefCaption ¶
GetBuildDefCaption fetches the caption of a given build definition id It is to be used in templates
func (*DBService) GetBuildDefinitionById ¶
func (ds *DBService) GetBuildDefinitionById(id uint) (entity.BuildDefinition, error)
GetBuildDefinitionById fetches a build definition by Id
func (*DBService) GetBuildExecutionById ¶
func (ds *DBService) GetBuildExecutionById(id int) (entity.BuildExecution, error)
GetBuildExecutionById fetches a specific build execution by id
func (*DBService) GetNewestBuildDefinitions ¶
func (ds *DBService) GetNewestBuildDefinitions(limit int) ([]entity.BuildDefinition, error)
GetNewestBuildDefinitions fetches the most recently edited or added build definitions
func (*DBService) GetNewestBuildExecutions ¶
func (ds *DBService) GetNewestBuildExecutions(limit int, query string, args ...interface{}) ([]entity.BuildExecution, error)
GetNewestBuildExecutions fetches the newest build executions
func (*DBService) GetUserActionByToken ¶
func (ds *DBService) GetUserActionByToken(token string) (entity.UserAction, error)
GetUserActionByToken retrieves a specific user action by token
func (*DBService) GetUserByEmail ¶
GetUserByEmail fetches a user by email address
func (*DBService) GetUserById ¶
GetUserById fetches a user by Id
func (*DBService) GetUsernameById ¶
GetUsernameById fetches a username by Id Supposed to be used in templates
func (*DBService) GetVariable ¶
func (ds *DBService) GetVariable(id int) (entity.UserVariable, error)
func (*DBService) InsertUserAction ¶
func (ds *DBService) InsertUserAction(userId uint, purpose, token string, validity sql.NullTime) error
InsertUserAction adds a new user action
func (*DBService) InvalidatePasswordResets ¶
InvalidatePasswordResets invalidates all user action of type 'password_reset'
func (*DBService) RowExists ¶
RowExists takes an SQL query and return true, if at least one entry exists for the given query
func (*DBService) SetSetting ¶
SetSetting sets a new value for a given setting
func (*DBService) UpdateBuildDefinition ¶
func (ds *DBService) UpdateBuildDefinition(bd *entity.BuildDefinition) error
UpdateBuildDefinition updates a build definition
func (*DBService) UpdateBuildExecution ¶
func (ds *DBService) UpdateBuildExecution(be *entity.BuildExecution) error
UpdateBuildExecution alters an existing user
func (*DBService) UpdateUser ¶
UpdateUser alters an existing user
func (*DBService) UpdateUserAction ¶
func (ds *DBService) UpdateUserAction(userAction entity.UserAction) error
UpdateUserAction updates a given user action
func (*DBService) UpdateVariable ¶
func (ds *DBService) UpdateVariable(userVar entity.UserVariable) error