handler

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2018 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestCases     = "testcases"
	TestSequences = "testsequences"
)

The const contains the tabs that can be selected in a project

Variables

This section is empty.

Functions

func AboutHandler

func AboutHandler(w http.ResponseWriter, r *http.Request)

AboutHandler is a handler for showing the about screen

func BriefID added in v0.8.0

func BriefID() errors.HandlerError

BriefID returns an ErrorMessage describing a situation where a given name would return an ID with less then four characters.

func DefaultRedirect added in v0.8.0

func DefaultRedirect(url string) http.HandlerFunc

DefaultRedirect returns a simple handler that just redirects to given url using 303 as status.

func DuplicateID

func DuplicateID() errors.HandlerError

DuplicateID returns an ErrorMessage detailing that a given name is already used elsewhere.

func ExploreGroupsHandler added in v0.8.0

func ExploreGroupsHandler(g GroupLister) http.HandlerFunc

ExploreGroupsHandler serves the page that is used to explore groups.

func ExploreProjectsHandler added in v0.8.0

func ExploreProjectsHandler(p ProjectLister) http.HandlerFunc

ExploreProjectsHandler serves the page that is used to explore projects.

func ExploreUsersHandler added in v0.8.0

func ExploreUsersHandler(u UserLister) http.HandlerFunc

ExploreUsersHandler shows the list of users

func GetAboutTree

func GetAboutTree() *template.Template

GetAboutTree returns the about screen template with all parent templates

func GetExploreGroupsTree

func GetExploreGroupsTree() *template.Template

GetExploreGroupsTree returns the list groups template with all parent templates

func GetExploreProjectsTree

func GetExploreProjectsTree() *template.Template

GetExploreProjectsTree returns the list projects template with all parent templates

func GetExploreUsersTree

func GetExploreUsersTree() *template.Template

GetExploreUsersTree returns the list users template with all parent templates

func GetNewGroupTree

func GetNewGroupTree() *template.Template

GetNewGroupTree returns the new group template with all parent templates

func GetNewProjectTree

func GetNewProjectTree() *template.Template

GetNewProjectTree returns the new project template with all parent templates

func GetNewUserTree

func GetNewUserTree() *template.Template

GetNewUserTree returns the register template with all parent templates

func GetTabPrintProtocolsListFragment added in v0.9.0

func GetTabPrintProtocolsListFragment() *template.Template

GetTabPrintProtocolsListFragment returns only the print protocol list tab template

func GetTabPrintProtocolsListTree added in v0.9.0

func GetTabPrintProtocolsListTree() *template.Template

GetTabPrintProtocolsListTree returns the print protocol list tab template with all parent templates

func GetTabProtocolsListFragment

func GetTabProtocolsListFragment() *template.Template

GetTabProtocolsListFragment returns only the protocol list tab template

func GetTabProtocolsListTree

func GetTabProtocolsListTree() *template.Template

GetTabProtocolsListTree returns the protocol list tab template with all parent templates

func GetTabProtocolsPrintTestCaseFragment added in v0.9.0

func GetTabProtocolsPrintTestCaseFragment() *template.Template

GetTabProtocolsPrintTestCaseFragment returns only the protocol show test case tab template

func GetTabProtocolsPrintTestCaseTree added in v0.9.0

func GetTabProtocolsPrintTestCaseTree() *template.Template

GetTabProtocolsPrintTestCaseTree returns the protocol show test case tab template with all parent templates

func GetTabProtocolsPrintTestSequenceFragment added in v0.9.0

func GetTabProtocolsPrintTestSequenceFragment() *template.Template

GetTabProtocolsPrintTestSequenceFragment returns only the protocol show test sequence tab template

func GetTabProtocolsPrintTestSequenceTree added in v0.9.0

func GetTabProtocolsPrintTestSequenceTree() *template.Template

GetTabProtocolsPrintTestSequenceTree returns the protocol show test sequence tab template with all parent templates

func GetTabProtocolsShowTestCaseFragment

func GetTabProtocolsShowTestCaseFragment() *template.Template

GetTabProtocolsShowTestCaseFragment returns only the protocol show test case tab template

func GetTabProtocolsShowTestCaseTree

func GetTabProtocolsShowTestCaseTree() *template.Template

GetTabProtocolsShowTestCaseTree returns the protocol show test case tab template with all parent templates

func GetTabProtocolsShowTestSequenceFragment

func GetTabProtocolsShowTestSequenceFragment() *template.Template

GetTabProtocolsShowTestCaseFragment returns only the protocol show test sequence tab template

func GetTabProtocolsShowTestSequenceTree

func GetTabProtocolsShowTestSequenceTree() *template.Template

GetTabProtocolsShowTestSequenceTree returns the protocol show test sequence tab template with all parent templates

func GetTabTestCasesEditFragment

func GetTabTestCasesEditFragment() *template.Template

GetTabTestCasesEditFragment returns only the test case edit template

func GetTabTestCasesEditTree

func GetTabTestCasesEditTree() *template.Template

GetTabTestCasesEditTree returns the test case edit tab template with all parent templates

func GetTabTestCasesHistoryFragment

func GetTabTestCasesHistoryFragment() *template.Template

GetTabTestCasesHistoryFragment returns only the test case history template

func GetTabTestCasesHistoryTree

func GetTabTestCasesHistoryTree() *template.Template

GetTabTestCasesHistoryTree returns the test case history tab template with all parent templates

func GetTabTestCasesListFragment

func GetTabTestCasesListFragment() *template.Template

GetTabTestCasesListFragment returns only the test case list tab template

func GetTabTestCasesListTree

func GetTabTestCasesListTree() *template.Template

GetTabTestCasesListTree returns the test case list tab template with all parent templates

func GetTabTestCasesNewFragment

func GetTabTestCasesNewFragment() *template.Template

GetTabTestCasesNewFragment returns only the new test case tab template

func GetTabTestCasesNewTree

func GetTabTestCasesNewTree() *template.Template

GetTabTestCasesNewTree returns the new test case tab template with all parent templates

func GetTabTestCasesShowFragment

func GetTabTestCasesShowFragment() *template.Template

GetTabTestCasesShowFragment returns only the test case show tab template

func GetTabTestCasesShowTree

func GetTabTestCasesShowTree() *template.Template

GetTabTestCasesShowTree returns the test case show tab template with all parent templates

func GetTabTestSequencesEditFragment

func GetTabTestSequencesEditFragment() *template.Template

GetTabTestSequencesEditFragment returns only the test sequence edit template

func GetTabTestSequencesEditTree

func GetTabTestSequencesEditTree() *template.Template

GetTabTestSequencesEditTree returns the test sequence edit tab template with all parent templates

func GetTabTestSequencesHistoryFragment

func GetTabTestSequencesHistoryFragment() *template.Template

GetTabTestSequencesHistoryFragment returns only the test sequence history template

func GetTabTestSequencesHistoryTree

func GetTabTestSequencesHistoryTree() *template.Template

GetTabTestSequencesHistoryTree returns the test sequence history tab template with all parent templates

func GetTabTestSequencesListFragment

func GetTabTestSequencesListFragment() *template.Template

GetTabTestSequencesListFragment returns only the test sequence list tab template

func GetTabTestSequencesListTree

func GetTabTestSequencesListTree() *template.Template

GetTabTestSequencesListTree returns the test sequence list tab template with all parent templates

func GetTabTestSequencesNewFragment

func GetTabTestSequencesNewFragment() *template.Template

GetTabTestSequencesNewFragment returns only the new test sequence tab template

func GetTabTestSequencesNewTree

func GetTabTestSequencesNewTree() *template.Template

GetTabTestSequencesNewTree returns the new test sequence tab template with all parent templates

func GetTabTestSequencesShowFragment

func GetTabTestSequencesShowFragment() *template.Template

GetTabTestSequencesShowFragment returns only the test sequence show template

func GetTabTestSequencesShowTree

func GetTabTestSequencesShowTree() *template.Template

GetTabTestSequencesShowTree returns the test sequence show tab template with all parent templates

func InvalidTCVersion

func InvalidTCVersion() errors.HandlerError

InvalidTCVersion returns an ErrorMessage describing that the test case version is not valid

func InvalidTSVersion

func InvalidTSVersion() errors.HandlerError

InvalidTSVersion returns an ErrorMessage describing that the test seqeuence version is not valid

func InvalidTestDuration

func InvalidTestDuration() errors.HandlerError

InvalidTestDuration returns an ErrorMessage describing that the test duration is invalid

func InvalidVisibility

func InvalidVisibility() errors.HandlerError

InvalidVisibility returns an ErrorMessage describing that a value is not valid.

func MarshallerError added in v0.8.0

func MarshallerError() errors.HandlerError

MarshallerError returns an ErrorMessage describing that an Error occured while encoding a message

func MethodNotAllowed added in v0.8.0

func MethodNotAllowed(w http.ResponseWriter, r *http.Request,
	methods map[string]httptreemux.HandlerFunc)

MethodNotAllowed responds with a method not allowed page on every request. noinspection GoUnusedParameter

func NewGroupHandler

func NewGroupHandler(u UserLister) http.HandlerFunc

NewGroupHandler is a handler for creating a group

func NewProjectGet added in v0.8.0

func NewProjectGet(w http.ResponseWriter, r *http.Request)

NewProjectGet is a handler for showing the screen for creating a new project

func NewRegisterHandler

func NewRegisterHandler(server UserServer) http.Handler

NewRegisterHandler creates a new signout handler that handles signout requests from the client.

func NewSigninHandler added in v0.9.0

func NewSigninHandler(handler SessionHandler, auth UserAuth) http.Handler

NewSigninHandler creates a new signin handler that handles signin requests from the client.

func NewSignoutHandler added in v0.9.0

func NewSignoutHandler(handler SessionHandler) http.Handler

NewSignoutHandler creates a new signout handler that handles signout requests from the client.

func NotFound added in v0.8.0

func NotFound(w http.ResponseWriter, r *http.Request)

NotFound responds with a not found page on every request.

func Panic added in v0.8.0

func Panic(w http.ResponseWriter, r *http.Request, v interface{})

Panic is used to handle panic while routing.

func PrintProtocolsList added in v0.9.0

func PrintProtocolsList(tcl TestCaseLister, tsl TestSequenceLister) http.HandlerFunc

PrintProtocolsList serves the page that display the print screen for a list of protocols

func PrintTestCaseProtocols added in v0.9.0

func PrintTestCaseProtocols(w http.ResponseWriter, r *http.Request)

func PrintTestSequenceProtocols added in v0.9.0

func PrintTestSequenceProtocols(w http.ResponseWriter, r *http.Request)

PrintTestSequenceProtocols serves the page for printing testsequence protocols.

func ProjectLabelsGet added in v0.9.0

func ProjectLabelsGet(w http.ResponseWriter, r *http.Request)

ProjectLabelsGet returns the labels of a project as JSON

func ProjectLabelsPost added in v0.9.0

func ProjectLabelsPost(w http.ResponseWriter, r *http.Request)

ProjectLabelsPost handles the request to update the labels of a project

func ProjectSettingsDelete added in v0.10.0

func ProjectSettingsDelete(pd ProjectDeleter) http.HandlerFunc

ProjectSettingsDelete is used to delete a project in the system

func ProjectSettingsGet added in v0.10.0

func ProjectSettingsGet(w http.ResponseWriter, r *http.Request)

ProjectSettingsGet is a handler for showing the settings page of a project

func ProjectSettingsPost added in v0.10.0

func ProjectSettingsPost(pa ProjectAdder, pec id.ProjectExistenceChecker) http.HandlerFunc

ProjectSettingsPost is used to update an existing project

func ProjectVariantsGet added in v0.8.0

func ProjectVariantsGet(w http.ResponseWriter, r *http.Request)

ProjectVariantsGet simply serves the variants of a project as json.

func ProjectVariantsPost added in v0.8.0

func ProjectVariantsPost(w http.ResponseWriter, r *http.Request)

ProjectVariantsPost handles request that demand changes to the existing set of variants.

func ProtocolsGet added in v0.8.0

func ProtocolsGet(tcl TestCaseLister, tsl TestSequenceLister) http.HandlerFunc

ProtocolsGet serves the page that displays the list of protocols

func Redirect added in v0.8.0

func Redirect(url string, status int) http.HandlerFunc

Redirect returns a simple handler that just redirects to given url using given status.

func RegisterUserGet added in v0.8.0

func RegisterUserGet(w http.ResponseWriter, r *http.Request)

RegisterUserGet is the handler that displays the registration site.

func SaveGroupHandler

func SaveGroupHandler(ga GroupAdder, groupChecker id.ActorExistenceChecker) http.HandlerFunc

SaveGroupHandler is a handler for saving a group

func SaveProjectPost added in v0.8.0

func SaveProjectPost(pa ProjectAdder, projectChecker id.ProjectExistenceChecker) http.HandlerFunc

SaveProjectPost is used to save a new project in the system

func TestCaseCommentPut added in v0.10.0

func TestCaseCommentPut(ca CommentAdder) http.HandlerFunc

TestCaseCommentPut returns a function, which processes a comment posted to a test case

func TestCaseDelete added in v0.8.0

func TestCaseDelete(tcd TestCaseDeleter) http.HandlerFunc

TestCaseDelete handles deletion requests by the client regarding testcases.

func TestCaseDuplicatePost added in v0.8.0

func TestCaseDuplicatePost(ta TestCaseAdder, caseChecker id.TestExistenceChecker) http.HandlerFunc

TestCaseDuplicatePost handles requests for duplicating testcases.

func TestCaseEditGet added in v0.8.0

func TestCaseEditGet(w http.ResponseWriter, r *http.Request)

TestCaseEditGet simply serves the edit page for editing testcases.

func TestCaseExecutionGet added in v0.8.0

func TestCaseExecutionGet(cs CaseSession, ss SequenceSessionGetter) http.HandlerFunc

TestCaseExecutionGet serves the start page for testcase executions.

func TestCaseExecutionPost added in v0.8.0

func TestCaseExecutionPost(protocolLister test.ProtocolLister, store CaseProtocolStore, cs CaseSession, ss SequenceSessionGetter) http.Handler

TestCaseExecutionPost handles all post requests during a testcase execution. It is a meta handler that further calls it's sub handlers.

func TestCaseGet added in v0.8.0

func TestCaseGet(w http.ResponseWriter, r *http.Request)

TestCaseGet simply serves the page that displays a testcase.

func TestCaseHistoryGet added in v0.8.0

func TestCaseHistoryGet(w http.ResponseWriter, r *http.Request)

TestCaseHistoryGet just serves the history page showing the history of a testcase.

func TestCaseJSONGet added in v0.8.0

func TestCaseJSONGet(w http.ResponseWriter, r *http.Request)

TestCaseJSONGet serves a requested testcase as json.

func TestCaseLabelsGet added in v0.9.0

func TestCaseLabelsGet(w http.ResponseWriter, r *http.Request)

TestCaseLabelsGet returns the labels of a test case as JSON

func TestCaseLabelsPost added in v0.9.0

func TestCaseLabelsPost(w http.ResponseWriter, r *http.Request)

TestCaseLabelsPost handles the request to update the labels of a test case

func TestCaseNewGet added in v0.8.0

func TestCaseNewGet(w http.ResponseWriter, r *http.Request)

TestCaseNewGet simply serves the site that is used to create new testcases.

func TestCaseNewPost added in v0.8.0

func TestCaseNewPost(ta TestCaseAdder, caseChecker id.TestExistenceChecker) http.HandlerFunc

TestCaseNewPost handles requests from the user, that involve creating new testcases.

func TestCasePrint added in v0.9.0

func TestCasePrint(w http.ResponseWriter, r *http.Request)

TestCasesPrint handles the showing of the template to print all test cases

func TestCaseProtocolsGet added in v0.8.0

func TestCaseProtocolsGet(w http.ResponseWriter, r *http.Request)

TestCaseProtocolsGet serves the page displaying testcase protocols.

func TestCaseProtocolsGetJSON added in v0.10.0

func TestCaseProtocolsGetJSON(l TestCaseProtocolLister) http.HandlerFunc

TestCaseProtocolsGetJSON serves testcase protocols as json.

func TestCaseUpdatePut added in v0.8.0

func TestCaseUpdatePut(t TestCaseUpdater, caseChecker id.TestExistenceChecker) http.HandlerFunc

TestCaseUpdatePut handles put requests that update existing testcases.

func TestCasesGet added in v0.8.0

func TestCasesGet(lister TestCaseLister) http.HandlerFunc

TestCasesGet simply serves a page that is used to list testcases,

func TestCasesJSONGet added in v0.8.0

func TestCasesJSONGet(tcl TestCaseLister) http.HandlerFunc

TestCasesJSONGet serves all testcase for a requested project as json.

func TestCasesListPrint added in v0.9.0

func TestCasesListPrint(lister TestCaseLister) http.HandlerFunc

TestCasesListPrint handles the showing of the template to print all test cases

func TestSequenceCommentPut added in v0.10.0

func TestSequenceCommentPut(ca CommentAdder) http.HandlerFunc

TestSequenceCommentPut returns a function, which processes a comment posted to a test sequence

func TestSequenceDelete added in v0.8.0

func TestSequenceDelete(tsd TestSequenceDeleter) http.HandlerFunc

TestSequenceDelete handles requests that demand the deletion of a testsequence.

func TestSequenceEditGet added in v0.8.0

func TestSequenceEditGet(t TestCaseLister) http.HandlerFunc

TestSequenceEditGet serves the page used to edit a testsequence.

func TestSequenceExecuteGet added in v0.8.0

func TestSequenceExecuteGet(time TimeSession, caseGetter CaseProtocolGetter,
	getter SequenceSessionGetter) http.HandlerFunc

TestSequenceExecuteGet serves the start page for a testsequence execution.

func TestSequenceExecutePost added in v0.8.0

func TestSequenceExecutePost(caseProtocolLister, seqenceProtocolLister test.ProtocolLister, caseStore CaseProtocolStore, sequenceStore SequenceProtocolAdder,
	caseSession CaseSession, sequenceSession SequenceSession) http.Handler

TestSequenceExecutePost returns a handler capable of handling every request during the execution of a testsequence.

func TestSequenceGet added in v0.8.0

func TestSequenceGet(w http.ResponseWriter, r *http.Request)

TestSequenceGet serves the page showing a testsequence.

func TestSequenceGetHistory added in v0.8.0

func TestSequenceGetHistory(w http.ResponseWriter, r *http.Request)

TestSequenceGetHistory serves the page showing the history of a testsequence.

func TestSequenceGetJSON added in v0.8.0

func TestSequenceGetJSON(w http.ResponseWriter, r *http.Request)

TestSequenceGetJSON serves a single testsequence as json.

func TestSequenceInfoGet added in v0.8.0

func TestSequenceInfoGet(tg TestCaseGetter) http.HandlerFunc

TestSequenceInfoGet serves detailed information about a testsequence as json.

func TestSequenceLabelsGet added in v0.9.0

func TestSequenceLabelsGet(w http.ResponseWriter, r *http.Request)

TestSequenceLabelsGet returns the labels of a test sequence as JSON

func TestSequenceLabelsPost added in v0.9.0

func TestSequenceLabelsPost(w http.ResponseWriter, r *http.Request)

TestSequenceLabelsPost handles the request to update the labels of a test sequence

func TestSequenceNewGet added in v0.8.0

func TestSequenceNewGet(lister TestCaseLister) http.HandlerFunc

TestSequenceNewGet serves the page used to create a new testsequence.

func TestSequenceNewPost added in v0.8.0

func TestSequenceNewPost(t TestCaseGetter, tsa TestSequenceAdder, sequenceChecker id.TestExistenceChecker) http.HandlerFunc

TestSequenceNewPost handles requests that demand the creation of a new testsequence.

func TestSequencePrint added in v0.9.0

func TestSequencePrint(w http.ResponseWriter, r *http.Request)

TestSequenceGet serves the page for printing a testsequence.

func TestSequenceProtocolsGet added in v0.8.0

func TestSequenceProtocolsGet(w http.ResponseWriter, r *http.Request)

TestSequenceProtocolsGet serves the page displaying testsequence protocols.

func TestSequenceProtocolsGetJSON added in v0.10.0

func TestSequenceProtocolsGetJSON(l TestSequenceProtocolLister) http.HandlerFunc

TestSequenceProtocolsGetJSON serves testsequence protocols as json.

func TestSequenceUpdatePut added in v0.8.0

func TestSequenceUpdatePut(t TestCaseGetter, tsu TestSequenceUpdater, sequenceChecker id.TestExistenceChecker) http.HandlerFunc

TestSequenceUpdatePut handles requests that demand to update a testsequence

func TestSequencesGet added in v0.8.0

func TestSequencesGet(lister TestSequenceLister) http.HandlerFunc

TestSequencesGet simply serves the page that lists testsequences.

func TestSequencesGetJSON added in v0.8.0

func TestSequencesGetJSON(t TestSequenceLister) http.HandlerFunc

TestSequencesGetJSON simply serves all testsequences of a project as json.

func TestSequencesListPrint added in v0.9.0

func TestSequencesListPrint(lister TestSequenceLister) http.HandlerFunc

TestSequencesPrint handles the showing of the template to print all test cases

Types

type CaseProtocolAdder added in v0.10.0

type CaseProtocolAdder interface {
	// AddCaseProtocol adds the given protocol to the store
	AddCaseProtocol(r *test.CaseExecutionProtocol) (err error)
}

CaseProtocolAdder is used to add new testcase protocols to the store.

type CaseProtocolCleaner added in v0.10.0

type CaseProtocolCleaner interface {
	CaseSessionGetter
	//RemoveCurrentCaseProtocol removes the current case protocol from the session.
	RemoveCurrentCaseProtocol(w http.ResponseWriter, r *http.Request) error
}

CaseProtocolCleaner is used to clean the testcase session after a new protocol has been successfully added.

type CaseProtocolGetter added in v0.10.0

type CaseProtocolGetter interface {
	// GetCaseExecutionProtocol gets the protocol with the given id for the testcase with given id,
	// which is part of the project with given id.
	GetCaseExecutionProtocol(protocolID id.ProtocolID) (test.CaseExecutionProtocol, error)
}

CaseProtocolGetter is used to get testcase protocols from the store.

type CaseProtocolStore added in v0.10.0

type CaseProtocolStore interface {
	CaseProtocolAdder
	CaseProtocolGetter
	// GetCaseExecutionProtocols gets the protocols for the testcase with given id,
	// which is part of the project with given id.
	GetCaseExecutionProtocols(testCaseID id.TestID) ([]test.CaseExecutionProtocol, error)
}

CaseProtocolStore interface for storing testcase protocols.

type CaseSession added in v0.8.0

type CaseSession interface {
	CaseSessionUpdater
	//RemoveCurrentCaseProtocol removes the current case protocol from the session.
	RemoveCurrentCaseProtocol(w http.ResponseWriter, r *http.Request) error
	TimeSession
}

CaseSession is used to manage the session for testcases during execution.

type CaseSessionGetter added in v0.8.0

type CaseSessionGetter interface {
	//GetCurrentCaseProtocol returns the protocol to the currently running case execution to the given request.
	//If there is no case execution running, the function will return nil, nil
	//If an error occurs nil and the error will be returned
	GetCurrentCaseProtocol(r *http.Request) (*test.CaseExecutionProtocol, error)
}

CaseSessionGetter is used to get the testcase currently contained within a session.

type CaseSessionSetter added in v0.8.0

type CaseSessionSetter interface {
	//SetCurrentCaseProtocol saves the given protocol to the session.
	//After this call, you can get the current case protocol via the GetCurrentCaseProtocol-function
	SetCurrentCaseProtocol(w http.ResponseWriter, r *http.Request, protocol *test.CaseExecutionProtocol) error
}

CaseSessionSetter is used to set the managed testcase during a session.

type CaseSessionUpdater added in v0.8.0

type CaseSessionUpdater interface {
	CaseSessionGetter
	CaseSessionSetter
}

CaseSessionUpdater is used to update the testcase currently contained within a session.

type CommentAdder added in v0.10.0

type CommentAdder interface {
	// Add stores a comment for the given test case, project and container
	Add(c *comment.Comment) error
}

CommentAdder is used to store a comment to the store

type GroupAdder added in v0.8.0

type GroupAdder interface {
	// Add stores a group in the system
	Add(group *group.Group) error
}

GroupAdder is used to add groups to the storage.

type GroupLister added in v0.8.0

type GroupLister interface {
	// List returns a list of groups in the system
	List() ([]*group.Group, error)
}

GroupLister is used to list all groups in the system.

type ProjectAdder added in v0.8.0

type ProjectAdder interface {
	// Add stores a new project. The first argument is used to identify the container for the project
	Add(*project.Project) error
}

ProjectAdder is used to add projects to the storage.

type ProjectDeleter added in v0.10.0

type ProjectDeleter interface {
	// Delete removes an existing project. The first argument is used to identify the container
	// and the second to identify the project
	Delete(projectID id.ProjectID) error
}

ProjectDeleter is used to delete the reference of an existing project from storage

type ProjectLister added in v0.8.0

type ProjectLister interface {
	// List returns a list of projects in the system
	List() ([]*project.Project, error)
}

ProjectLister is used to list all projects in the system.

type SequenceProtocolAdder added in v0.10.0

type SequenceProtocolAdder interface {
	// AddSequenceProtocol adds the given protocol to the store
	AddSequenceProtocol(r *test.SequenceExecutionProtocol) (err error)
}

SequenceProtocolAdder interface for storing testsequence protocols.

type SequenceProtocolStore added in v0.10.0

type SequenceProtocolStore interface {
	SequenceProtocolAdder
	// GetSequenceExecutionProtocols gets the protocols for the testsequence with given id,
	// which is part of the project with given id.
	GetSequenceExecutionProtocols(projectID, sequenceID string) ([]test.SequenceExecutionProtocol, error)
	// GetSequenceExecutionProtocol gets the protocol with the given id for the testsequence with given id,
	// which is part of the project with given id.
	GetSequenceExecutionProtocol(projectID, sequenceID string, protocolID int) (test.SequenceExecutionProtocol, error)
}

SequenceProtocolStore interface for storing testsequence protocols.

type SequenceSession added in v0.8.0

type SequenceSession interface {
	SequenceSessionSetter
	//RemoveCurrentSequenceProtocol removes the current sequence protocol from the session.
	RemoveCurrentSequenceProtocol(w http.ResponseWriter, r *http.Request) error
	SequenceSessionGetter
	TimeSession
}

SequenceSession is the session that stores sequence data during execution of a testsequence.

type SequenceSessionGetter added in v0.8.0

type SequenceSessionGetter interface {
	//GetCurrentSequenceProtocol returns the protocol to the currently running sequence execution to the given request.
	//If there is no sequence execution running, the function will return nil, nil
	//If an error occurs nil and the error will be returned
	GetCurrentSequenceProtocol(r *http.Request) (*test.SequenceExecutionProtocol, error)
}

SequenceSessionGetter interface for retrieving testsequence protocols.

type SequenceSessionSetter added in v0.8.0

type SequenceSessionSetter interface {
	//SetCurrentSequenceProtocol saves the given protocol to the session.
	//After this call, you can get the current sequence protocol via the GetCurrentSequenceProtocol-function
	SetCurrentSequenceProtocol(w http.ResponseWriter, r *http.Request,
		protocol *test.SequenceExecutionProtocol) error
}

SequenceSessionSetter is used to set the managed testsequence protocol during requests.

type SessionHandler

type SessionHandler interface {
	// StartFor starts the session for given user.
	StartFor(w http.ResponseWriter, r *http.Request, u *user.User) error
	// EndFor ends the session for given user.
	EndFor(w http.ResponseWriter, r *http.Request, u *user.User) error
	// GetCurrent gets the user that hold the session. If there is no
	// user session the returned user will be nil.
	GetCurrent(r *http.Request) (*user.User, error)
}

SessionHandler is used to start sessions for a user and end them.

type TestCaseAdder added in v0.8.0

type TestCaseAdder interface {
	// Add stores a test case for the given project under the given container
	Add(testCase *test.Case) error
}

TestCaseAdder provides everything needed to add a testcase to a storage.

type TestCaseDeleter added in v0.8.0

type TestCaseDeleter interface {
	// Delete removes the test case with the given ID for the given project under the given container
	Delete(caseID id.TestID) error
}

TestCaseDeleter provides everything needed to remove a testcase to a storage.

type TestCaseGetter added in v0.8.0

type TestCaseGetter interface {
	// Get returns the test case with the given ID for the given project under the given container
	Get(caseID id.TestID) (*test.Case, bool, error)
}

TestCaseGetter is used to get testcases from the store.

type TestCaseLister added in v0.8.0

type TestCaseLister interface {
	// List returns a list of test cases for the given project under the given container
	List(projectID id.ProjectID) ([]*test.Case, error)
}

TestCaseLister is used to list all testcases for a specific project.

type TestCaseProtocolLister added in v0.10.0

type TestCaseProtocolLister interface {
	// GetCaseExecutionProtocols gets the protocols for the testcase with given id,
	// which is part of the project with given id.
	GetCaseExecutionProtocols(testCaseID id.TestID) ([]test.CaseExecutionProtocol, error)
}

TestCaseProtocolLister is used to list testcase execution protocols.

type TestCaseUpdater added in v0.8.0

type TestCaseUpdater interface {
	TestCaseDeleter
	TestCaseAdder
}

TestCaseUpdater contains every method needed to update a testcase.

type TestSequenceAdder added in v0.8.0

type TestSequenceAdder interface {
	// Add stores a test sequence for the given project under the given container
	Add(testSequence *test.Sequence) error
}

TestSequenceAdder is used to add testsequences to the storage.

type TestSequenceDeleter added in v0.8.0

type TestSequenceDeleter interface {
	// Delete removes the testsequence with the given ID for the given project under the given container
	Delete(sequenceID id.TestID) error
}

TestSequenceDeleter is used to delete testsequences from the storage.

type TestSequenceLister added in v0.8.0

type TestSequenceLister interface {
	// List returns a list of test sequences for the given project under the given container
	List(projectID id.ProjectID) ([]*test.Sequence, error)
}

TestSequenceLister is used to list all testsequences for a specific project.

type TestSequenceProtocolLister added in v0.10.0

type TestSequenceProtocolLister interface {
	// GetSequenceExecutionProtocols gets the protocols for the testsequence with given id,
	// which is part of the project with given id.
	GetSequenceExecutionProtocols(sequenceID id.TestID) ([]test.SequenceExecutionProtocol, error)
}

TestSequenceProtocolLister is used to list testsequence execution protocols.

type TestSequenceUpdater added in v0.8.0

type TestSequenceUpdater interface {
	TestSequenceAdder
	TestSequenceDeleter
}

TestSequenceUpdater is used to update testsequences in the storage.

type TimeSession added in v0.8.0

type TimeSession interface {
	//GetDuration returns the duration needed in this execution til now.
	//If there is no sequence execution running, the function will return nil, nil
	//If an error occurs nil and the error will be returned
	GetDuration(r *http.Request) (*duration.Duration, error)
	//SetDuration saves the given duration to the session.
	//After this call, you can get the current duration via the GetDuration-function
	SetDuration(w http.ResponseWriter, r *http.Request, duration *duration.Duration) error
}

TimeSession is used to store time in during requests.

type UserAuth

type UserAuth interface {
	// Validate validates user credentials and returns the corresponding user.
	//
	// If the credentials are invalid false and nil(for user and error) will be
	// returned.
	//
	// If a real error happens during validation it will be returned and the
	// user will be nil and the bool false.
	Validate(identifier string, password string) (*user.User, bool, error)
}

UserAuth is used to authenticate users.

type UserLister added in v0.8.0

type UserLister interface {
	// List returns a list of users in the system
	List() ([]*user.User, error)
}

UserLister is used to list all users in the system.

type UserServer

type UserServer interface {
	Get(id id.ActorID) (*user.User, bool)
	GetByMail(email string) (*user.User, bool)
	Add(pur *user.PasswordUser) error
}

UserServer is used to register a new user

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL