Documentation ¶
Overview ¶
Package store holds everything that has to do with persistence and manages stored data.
Index ¶
- func InitializeDatabase()
- func InitializeTestDatabase()
- type ActivitySQL
- type AssignmentSQL
- type CasesSQL
- func (csSQL CasesSQL) Add(testCase *test.Case) error
- func (csSQL CasesSQL) Delete(testCase *test.Case) error
- func (csSQL CasesSQL) Exists(tID id.TestID) (bool, error)
- func (csSQL CasesSQL) Get(tID id.TestID) (*test.Case, bool, error)
- func (csSQL CasesSQL) List(pID id.ProjectID) ([]*test.Case, error)
- func (csSQL CasesSQL) Rename(old, new id.TestID) error
- type CommentsSQL
- func (commentsSql CommentsSQL) DeleteCommentsForTest(testObject interface{}) error
- func (commentsSql CommentsSQL) GetComment(commentId int64, project *project.Project) (*comment.Comment, error)
- func (commentsSql CommentsSQL) GetCommentsForTest(testObject interface{}, project *project.Project, requester *user.User) ([]*comment.Comment, error)
- func (commentsSql CommentsSQL) InsertComment(comment *comment.Comment, testObject interface{}, user *user.User) error
- func (commentsSql CommentsSQL) UpdateComment(comment *comment.Comment) error
- type GroupSQL
- type LabelsSQL
- func (labelsSql LabelsSQL) DeleteLabel(labelId int64) error
- func (labelsSql LabelsSQL) DeleteTestLabel(labelId int64, testId int64, projectId int64, isCase bool) error
- func (labelsSql LabelsSQL) GetAllTestLabels() ([]*project.TestLabel, error)
- func (labelsSql LabelsSQL) GetLabelsForProject(testProject *project.Project) ([]*project.Label, error)
- func (labelsSql LabelsSQL) GetLabelsForTest(testObject interface{}, projectId int64) ([]*project.Label, error)
- func (labelsSql LabelsSQL) InsertTestLabel(labelId int64, testId int64, projectId int64, isCase bool) error
- func (labelsSql LabelsSQL) UpdateLabelForProject(label *project.Label, projectId int64) (int64, error)
- type OwnersSQL
- type ProjectsSQL
- func (psSQL ProjectsSQL) Add(p *project.Project) error
- func (psSQL ProjectsSQL) AddIssue(issue integration.GitLabIssue) error
- func (psSQL ProjectsSQL) Delete(pID id.ProjectID) error
- func (psSQL ProjectsSQL) Exists(pID id.ProjectID) (bool, error)
- func (psSQL ProjectsSQL) Get(pID id.ProjectID) (*project.Project, bool, error)
- func (psSQL ProjectsSQL) GetIssue(testCaseID id.TestID, version string, variant string) (*integration.GitLabIssue, error)
- func (psSQL ProjectsSQL) ListAll() ([]*project.Project, error)
- func (psSQL ProjectsSQL) ListForActor(actor id.ActorID) ([]*project.Project, error)
- func (psSQL ProjectsSQL) ListForMember(member id.ActorID) ([]*project.Project, error)
- func (psSQL ProjectsSQL) ListForOwner(owner id.ActorID) ([]*project.Project, error)
- func (psSQL ProjectsSQL) ListInternal() ([]*project.Project, error)
- func (psSQL ProjectsSQL) ListPrivate(actor id.ActorID) ([]*project.Project, error)
- func (psSQL ProjectsSQL) ListPublic() ([]*project.Project, error)
- func (psSQL ProjectsSQL) RenameProjectVariant(p *project.Project, version, oldVariantName, newVariantName string) error
- func (psSQL ProjectsSQL) RenameProjectVersion(p *project.Project, oldVersionName, newVersionName string) error
- type ProtocolsSQL
- func (prSQL ProtocolsSQL) AddCaseProtocol(caseExecProtocol *test.CaseExecutionProtocol, testCaseVersion test.CaseVersion) (err error)
- func (prSQL ProtocolsSQL) AddSequenceProtocol(r *test.SequenceExecutionProtocol, sequenceVersion test.SequenceVersion) (err error)
- func (prSQL ProtocolsSQL) GetCaseExecutionProtocol(protocolID id.ProtocolID) (test.CaseExecutionProtocol, error)
- func (prSQL ProtocolsSQL) GetCaseExecutionProtocols(testcaseID id.TestID) ([]test.CaseExecutionProtocol, error)
- func (prSQL ProtocolsSQL) GetCaseExecutionProtocolsForProject(projectID id.ProjectID) ([]test.CaseExecutionProtocol, error)
- func (protocolsSQL ProtocolsSQL) GetPartiallyLoadedCaseExecutionProtocol(caseExecutionProtocolId int64) (*test.CaseExecutionProtocol, error)
- func (protocolsSQL ProtocolsSQL) GetPartiallyLoadedSequenceExecutionProtocol(sequenceExecutionProtocolId int64) (*test.SequenceExecutionProtocol, error)
- func (protocolsSQL ProtocolsSQL) GetSequenceExecutionProtocol(protocolID id.ProtocolID) (test.SequenceExecutionProtocol, error)
- func (prSQL ProtocolsSQL) GetSequenceExecutionProtocols(testID id.TestID) ([]test.SequenceExecutionProtocol, error)
- func (prSQL ProtocolsSQL) GetSequenceExecutionProtocolsForProject(projectID id.ProjectID) ([]test.SequenceExecutionProtocol, error)
- func (prSQL ProtocolsSQL) GetTestVersionProtocols(testVersionID id.TestVersionID) ([]id.ProtocolID, error)
- type SequencesSQL
- func (s SequencesSQL) Add(ts *test.Sequence) error
- func (s SequencesSQL) Delete(testSequence *test.Sequence) error
- func (s SequencesSQL) Exists(tID id.TestID) (bool, error)
- func (s SequencesSQL) Get(tID id.TestID) (*test.Sequence, bool, error)
- func (s SequencesSQL) List(pID id.ProjectID) ([]*test.Sequence, error)
- func (s SequencesSQL) Rename(old, new id.TestID) error
- type SystemSettingsSQL
- func (SystemSettingsSQL SystemSettingsSQL) GetSystemSettings() (*system.SystemSettings, error)
- func (SystemSettingsSQL SystemSettingsSQL) InsertSystemSettings(systemSettings *system.SystemSettings) error
- func (SystemSettingsSQL SystemSettingsSQL) UpdateSystemSettings(systemSettings *system.SystemSettings) error
- type TaskSQL
- type TestCreationSQL
- type TestProtocolSQL
- type UsersSQL
- func (us UsersSQL) Add(u *user.PasswordUser) error
- func (us UsersSQL) Get(uID id.ActorID) (*user.User, bool, error)
- func (us UsersSQL) GetByMail(mail string) (*user.User, bool, error)
- func (us UsersSQL) List() ([]*user.User, error)
- func (us UsersSQL) Update(u *user.User) error
- func (us UsersSQL) Validate(identifier, password string) (*user.User, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeDatabase ¶
func InitializeDatabase()
InitializeDatabase initializes the database connection and makes sure the database schema is up to date
func InitializeTestDatabase ¶ added in v1.7.0
func InitializeTestDatabase()
InitializeTestDatabase initializes an empty database for tests
Types ¶
type ActivitySQL ¶
type ActivitySQL struct {
// contains filtered or unexported fields
}
func GetActivityStore ¶
func GetActivityStore() ActivitySQL
func (ActivitySQL) GetActivitiesForProjectLimitFromOffset ¶
func (activitySQL ActivitySQL) GetActivitiesForProjectLimitFromOffset(projectId int64, limit int, offset int) ([]*activity.Activity, error)
* Gets 20 activities from the database.
func (ActivitySQL) LogActivity ¶
func (activitySql ActivitySQL) LogActivity(activityType int, entities *activity.ActivityEntities, request *http.Request) error
type AssignmentSQL ¶
type AssignmentSQL struct {
// contains filtered or unexported fields
}
func (AssignmentSQL) Create ¶
func (assignmentSQL AssignmentSQL) Create(session *xorm.Session, activityType int, activityEntities *activity.ActivityEntities, request *http.Request) (int64, error)
func (AssignmentSQL) GetLazyLoadedActivityItem ¶
func (assignmentSQL AssignmentSQL) GetLazyLoadedActivityItem(activity *activity.Activity) (activity.ActivityItem, error)
type CasesSQL ¶ added in v1.7.0
type CasesSQL struct {
// contains filtered or unexported fields
}
type CommentsSQL ¶ added in v1.7.0
type CommentsSQL struct {
// contains filtered or unexported fields
}
func GetCommentStore ¶ added in v1.7.0
func GetCommentStore() CommentsSQL
func (CommentsSQL) DeleteCommentsForTest ¶ added in v1.7.0
func (commentsSql CommentsSQL) DeleteCommentsForTest(testObject interface{}) error
func (CommentsSQL) GetComment ¶ added in v1.7.0
func (CommentsSQL) GetCommentsForTest ¶ added in v1.7.0
func (commentsSql CommentsSQL) GetCommentsForTest(testObject interface{}, project *project.Project, requester *user.User) ([]*comment.Comment, error)
Gets comments for a testObject and fills them with users. CAUTION: YOU MAY NOT PASS POINTERS TO CASES/SEQUENCES. DEREFERENCE THEM WITH *
func (CommentsSQL) InsertComment ¶ added in v1.7.0
func (commentsSql CommentsSQL) InsertComment(comment *comment.Comment, testObject interface{}, user *user.User) error
Generates foreign keys for a comment and inserts it into the db. CAUTION: YOU MAY NOT PASS POINTERS TO CASES/SEQUENCES. DEREFERENCE THEM WITH *
func (CommentsSQL) UpdateComment ¶ added in v1.7.0
func (commentsSql CommentsSQL) UpdateComment(comment *comment.Comment) error
type GroupSQL ¶ added in v1.7.0
type GroupSQL struct {
// contains filtered or unexported fields
}
type LabelsSQL ¶
type LabelsSQL struct {
// contains filtered or unexported fields
}
func GetLabelStore ¶
func GetLabelStore() LabelsSQL
func (LabelsSQL) DeleteLabel ¶
Permanently deletes a label
func (LabelsSQL) DeleteTestLabel ¶
func (labelsSql LabelsSQL) DeleteTestLabel(labelId int64, testId int64, projectId int64, isCase bool) error
Permanently deletes a test label
func (LabelsSQL) GetAllTestLabels ¶
func (LabelsSQL) GetLabelsForProject ¶
func (labelsSql LabelsSQL) GetLabelsForProject(testProject *project.Project) ([]*project.Label, error)
PROJECT ------------------------------------------------------------------------------------------------------------|
func (LabelsSQL) GetLabelsForTest ¶
func (LabelsSQL) InsertTestLabel ¶
type OwnersSQL ¶ added in v1.7.0
type OwnersSQL struct {
// contains filtered or unexported fields
}
func GetActorExistenceChecker ¶
func GetActorExistenceChecker() OwnersSQL
GetActorExistenceChecker returns the implementation to use for ActorExistenceChecker
type ProjectsSQL ¶ added in v1.7.0
type ProjectsSQL struct {
// contains filtered or unexported fields
}
func GetProjectStore ¶
func GetProjectStore() ProjectsSQL
GetProjectStore returns a store for projects
func (ProjectsSQL) AddIssue ¶
func (psSQL ProjectsSQL) AddIssue(issue integration.GitLabIssue) error
func (ProjectsSQL) Exists ¶ added in v1.7.0
func (psSQL ProjectsSQL) Exists(pID id.ProjectID) (bool, error)
func (ProjectsSQL) GetIssue ¶
func (psSQL ProjectsSQL) GetIssue(testCaseID id.TestID, version string, variant string) (*integration.GitLabIssue, error)
func (ProjectsSQL) ListAll ¶ added in v1.7.0
func (psSQL ProjectsSQL) ListAll() ([]*project.Project, error)
ListAll lists all projects in the system
func (ProjectsSQL) ListForActor ¶ added in v1.7.0
ListForActor returns all projects the actor has access to
func (ProjectsSQL) ListForMember ¶ added in v1.7.0
ListForMember returns all projects where the given actor is a member
func (ProjectsSQL) ListForOwner ¶ added in v1.7.0
ListForOwner lists all projects where the given actor is the owner
func (ProjectsSQL) ListInternal ¶ added in v1.7.0
func (psSQL ProjectsSQL) ListInternal() ([]*project.Project, error)
ListInternal lists all internal projects
func (ProjectsSQL) ListPrivate ¶ added in v1.7.0
ListPrivate lists all private projects where the given actor is the owner
func (ProjectsSQL) ListPublic ¶ added in v1.7.0
func (psSQL ProjectsSQL) ListPublic() ([]*project.Project, error)
ListPublic lists all public projects
func (ProjectsSQL) RenameProjectVariant ¶
func (psSQL ProjectsSQL) RenameProjectVariant(p *project.Project, version, oldVariantName, newVariantName string) error
func (ProjectsSQL) RenameProjectVersion ¶
func (psSQL ProjectsSQL) RenameProjectVersion(p *project.Project, oldVersionName, newVersionName string) error
type ProtocolsSQL ¶ added in v1.7.0
type ProtocolsSQL struct {
// contains filtered or unexported fields
}
func GetProtocolStore ¶ added in v1.1.0
func GetProtocolStore() ProtocolsSQL
GetProtocolStore returns a store for protocols
func (ProtocolsSQL) AddCaseProtocol ¶ added in v1.7.0
func (prSQL ProtocolsSQL) AddCaseProtocol(caseExecProtocol *test.CaseExecutionProtocol, testCaseVersion test.CaseVersion) (err error)
AddCaseProtocol stores a test.CaseExecutionProtocol
func (ProtocolsSQL) AddSequenceProtocol ¶ added in v1.7.0
func (prSQL ProtocolsSQL) AddSequenceProtocol(r *test.SequenceExecutionProtocol, sequenceVersion test.SequenceVersion) (err error)
AddSequenceProtocol stores a test.SequenceExecutionProtocol in the database
func (ProtocolsSQL) GetCaseExecutionProtocol ¶ added in v1.7.0
func (prSQL ProtocolsSQL) GetCaseExecutionProtocol(protocolID id.ProtocolID) (test.CaseExecutionProtocol, error)
func (ProtocolsSQL) GetCaseExecutionProtocols ¶ added in v1.7.0
func (prSQL ProtocolsSQL) GetCaseExecutionProtocols(testcaseID id.TestID) ([]test.CaseExecutionProtocol, error)
GetCaseExecutionProtocols returns a slice of all CaseExecutionProtocols that belong to the given test case.
func (ProtocolsSQL) GetCaseExecutionProtocolsForProject ¶ added in v1.7.0
func (prSQL ProtocolsSQL) GetCaseExecutionProtocolsForProject(projectID id.ProjectID) ([]test.CaseExecutionProtocol, error)
GetCaseExecutionProtocolsForProject returns a slice of all CaseExecutionProtocols, that belongs to the given project.
func (ProtocolsSQL) GetPartiallyLoadedCaseExecutionProtocol ¶
func (protocolsSQL ProtocolsSQL) GetPartiallyLoadedCaseExecutionProtocol(caseExecutionProtocolId int64) (*test.CaseExecutionProtocol, error)
func (ProtocolsSQL) GetPartiallyLoadedSequenceExecutionProtocol ¶
func (protocolsSQL ProtocolsSQL) GetPartiallyLoadedSequenceExecutionProtocol(sequenceExecutionProtocolId int64) (*test.SequenceExecutionProtocol, error)
func (ProtocolsSQL) GetSequenceExecutionProtocol ¶ added in v1.7.0
func (protocolsSQL ProtocolsSQL) GetSequenceExecutionProtocol(protocolID id.ProtocolID) (test.SequenceExecutionProtocol, error)
func (ProtocolsSQL) GetSequenceExecutionProtocols ¶ added in v1.7.0
func (prSQL ProtocolsSQL) GetSequenceExecutionProtocols(testID id.TestID) ([]test.SequenceExecutionProtocol, error)
GetSequenceExecutionProtocols returns a slice of all SequenceExecutionProtocol that belong to a given sequence, identified by the id.TestID
func (ProtocolsSQL) GetSequenceExecutionProtocolsForProject ¶ added in v1.7.0
func (prSQL ProtocolsSQL) GetSequenceExecutionProtocolsForProject(projectID id.ProjectID) ([]test.SequenceExecutionProtocol, error)
GetSequenceExecutionProtocolsForProject returns a slice of SequenceExecutionProtocols related to a given id.ProjectID
func (ProtocolsSQL) GetTestVersionProtocols ¶ added in v1.7.0
func (prSQL ProtocolsSQL) GetTestVersionProtocols(testVersionID id.TestVersionID) ([]id.ProtocolID, error)
GetTestVersionProtocols returns a slice of all execution protocols ids for a testVersion
type SequencesSQL ¶ added in v1.7.0
type SequencesSQL struct {
// contains filtered or unexported fields
}
func GetSequenceStore ¶
func GetSequenceStore() SequencesSQL
GetSequenceStore returns a store for test sequences
func (SequencesSQL) Delete ¶ added in v1.7.0
func (s SequencesSQL) Delete(testSequence *test.Sequence) error
func (SequencesSQL) Exists ¶ added in v1.7.0
func (s SequencesSQL) Exists(tID id.TestID) (bool, error)
type SystemSettingsSQL ¶ added in v1.7.0
type SystemSettingsSQL struct {
// contains filtered or unexported fields
}
func GetSystemSettingsStore ¶ added in v1.7.0
func GetSystemSettingsStore() SystemSettingsSQL
func (SystemSettingsSQL) GetSystemSettings ¶ added in v1.7.0
func (SystemSettingsSQL SystemSettingsSQL) GetSystemSettings() (*system.SystemSettings, error)
func (SystemSettingsSQL) InsertSystemSettings ¶ added in v1.7.0
func (SystemSettingsSQL SystemSettingsSQL) InsertSystemSettings(systemSettings *system.SystemSettings) error
func (SystemSettingsSQL) UpdateSystemSettings ¶ added in v1.7.0
func (SystemSettingsSQL SystemSettingsSQL) UpdateSystemSettings(systemSettings *system.SystemSettings) error
type TaskSQL ¶ added in v1.7.0
type TaskSQL struct {
// contains filtered or unexported fields
}
func GetTaskStore ¶ added in v1.7.0
func GetTaskStore() TaskSQL
GetTaskStore returns a store for Tasks
type TestCreationSQL ¶
type TestCreationSQL struct {
// contains filtered or unexported fields
}
func (TestCreationSQL) Create ¶
func (testCreationSQL TestCreationSQL) Create(session *xorm.Session, activityType int, activityEntities *activity.ActivityEntities, request *http.Request) (int64, error)
func (TestCreationSQL) GetLazyLoadedActivityItem ¶
func (testCreationSQL TestCreationSQL) GetLazyLoadedActivityItem(activity *activity.Activity) (activity.ActivityItem, error)
type TestProtocolSQL ¶
type TestProtocolSQL struct {
// contains filtered or unexported fields
}
func (TestProtocolSQL) Create ¶
func (testProtocolSQL TestProtocolSQL) Create(session *xorm.Session, activityType int, activityEntities *activity.ActivityEntities, request *http.Request) (int64, error)
func (TestProtocolSQL) GetLazyLoadedActivityItem ¶
func (testProtocolSQL TestProtocolSQL) GetLazyLoadedActivityItem(activity *activity.Activity) (activity.ActivityItem, error)
Source Files ¶
- activity_sql.go
- assignment_sql.go
- case_sql.go
- case_version_sql.go
- case_version_sut_variant_sql.go
- case_version_sut_version_sql.go
- comment_sql.go
- common_sql.go
- doc.go
- group_sql.go
- integration_sql.go
- label_sql.go
- owner_sql.go
- preconditions_sql.go
- project_member_sql.go
- project_role_sql.go
- project_sql.go
- protocol_sql.go
- sequence_sql.go
- sequence_version_case_sql.go
- sequence_version_sql.go
- step_sql.go
- sut_variant_sql.go
- sut_version_sql.go
- system_settings_sql.go
- testcreation_sql.go
- testprotocol_sql.go
- todo_sql.go
- user_sql.go