Documentation ¶
Overview ¶
Package store holds everything that has to do with persistence and manages stored data.
Index ¶
- func InitializeDatabase()
- func InitializeTestDatabase()
- 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 OwnersSQL
- type ProjectsSQL
- func (psSQL ProjectsSQL) Add(p *project.Project) 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) 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) RenameProjectLabel(p *project.Project, old project.Label, new project.Label) 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 (prSQL 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 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) 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 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 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) Exists ¶ added in v1.7.0
func (psSQL ProjectsSQL) Exists(pID id.ProjectID) (bool, 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) RenameProjectLabel ¶ added in v1.7.0
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) GetSequenceExecutionProtocol ¶ added in v1.7.0
func (prSQL 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
Source Files ¶
- case_labels_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
- owner_sql.go
- preconditions_sql.go
- project_labels_sql.go
- project_member_sql.go
- project_role_sql.go
- project_sql.go
- protocol_sql.go
- sequence_labels_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
- todo_sql.go
- user_sql.go