services

package
v0.0.0-...-93c18d4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserAlreadyExists = errors.New("user with given email already exists")

Functions

This section is empty.

Types

type AuthService

type AuthService interface {
	SignIn(*schema.LoginRequest) (*schema.LoginResponse, error)
	SignUp(*schema.SignUpRequest) (*schema.LoginResponse, error)
	ResetPassword(ctx context.Context, email string) error
	ChangePassword(ctx context.Context, request *schema.ChangePasswordRequest) error
}

func NewAuthService

func NewAuthService(authConfig *config.AuthConfiguration, db *dbsqlc.Queries, logger logging.Logger) AuthService

type GitHubIntegration

type GitHubIntegration struct {
	// contains filtered or unexported fields
}

func NewGitHubIntegration

func NewGitHubIntegration(client *github.Client, projectService ProjectService, testCaseService TestCaseService) *GitHubIntegration

NewGitHubIntegration creates a new github integration which requires a fully constructed AND authenticated GitHub client to work if the client is not authorized to make requests, then all functionality in this type may not work and will return errors

func (*GitHubIntegration) CreateTestCasesFromOpenIssues

func (g *GitHubIntegration) CreateTestCasesFromOpenIssues(ctx context.Context, owner, repo string, projectID int64) ([]dbsqlc.TestCase, error)

func (*GitHubIntegration) FetchProjects

func (g *GitHubIntegration) FetchProjects(ctx context.Context) ([]string, error)

func (*GitHubIntegration) ListIssues

func (g *GitHubIntegration) ListIssues(ctx context.Context, project string) ([]any, error)

type OrganizationUserService

type OrganizationUserService interface {
	// FindAll finds all users in a given organization
	FindAll(context.Context, int64) ([]dbsqlc.User, error)
}

type ProjectFetcherService

type ProjectFetcherService interface {
	FetchProjects(context.Context) ([]string, error)
}

type ProjectService

func NewProjectService

func NewProjectService(db *dbsqlc.Queries, logger logging.Logger) ProjectService

type SettingsService

type SettingsService interface{}

type TestCaseService

type TestCaseService interface {
	// FindAll retrieves all test cases in the database
	FindAll(context.Context) ([]dbsqlc.TestCase, error)

	// FindAllByID retrieves all test cases in the database by Project ID
	FindByID(context.Context, string) (*dbsqlc.TestCase, error)

	// FindAllByProjectID retrieves all test cases in the database by Project ID
	FindAllByProjectID(context.Context, int64) ([]dbsqlc.TestCase, error)

	// FindAllCreatedBy retrieves all test cases in the database created by a specific user
	FindAllCreatedBy(context.Context, int64) ([]dbsqlc.TestCase, error)

	// Create creates a new test case
	Create(context.Context, *schema.CreateTestCaseRequest) (*dbsqlc.TestCase, error)

	// BulkCreate creates test cases in bulk. Only valid test cases are created.
	BulkCreate(context.Context, *schema.BulkCreateTestCases) ([]dbsqlc.TestCase, error)

	// Update updates a test case in the system
	Update(context.Context, *schema.UpdateTestCaseRequest) (*dbsqlc.TestCase, error)

	// DeleteByID deletes a single test case by ID
	DeleteByID(context.Context, string) error

	// DeleteByID deletes all test cases linked to the given ProjectID
	DeleteByProjectID(context.Context, string) error

	// DeleteByTestRunID delets all test cases linked to the given TestRun
	DeleteByTestRunID(context.Context, string) error

	// BulkDelete deletes multiple test-cases by ID
	BulkDelete(context.Context, []string) error
}

TestCaseService contains functionality to manage services

func NewTestCaseService

func NewTestCaseService(conn *dbsqlc.Queries, logger logging.Logger) TestCaseService

type TestPlanService

type TestPlanService interface {
	FindAll(context.Context) ([]dbsqlc.TestPlan, error)
	FindAllByProjectID(context.Context, int64) ([]dbsqlc.TestPlan, error)
	Create(context.Context, *schema.CreateTestPlan) (*dbsqlc.TestPlan, error)
	AddTestCaseToPlan(context.Context, *schema.AssignTestsToPlanRequest) (*dbsqlc.TestPlan, error)
	DeleteByID(context.Context, int64) error
}

func NewTestPlanService

func NewTestPlanService(conn *dbsqlc.Queries, logger logging.Logger) TestPlanService

type TestRunService

type TestRunService interface {
	FindAll(context.Context) ([]dbsqlc.TestRun, error)
	DeleteByID(context.Context, string) error
	FindAllByProjectID(context.Context, int64) ([]dbsqlc.TestRun, error)
	Commit(context.Context, *schema.CommitTestRunResult) (*dbsqlc.TestRun, error)
	CommitBulk(context.Context, *schema.BulkCommitTestResults) (bool, error)
	// CreateFromFailedTest records tests without necessarily first creating TestCases.
	//
	// A common use case for Quality Assurance process is reporting things, right now,
	// having to wait for a scheduled Test Plan/Session. This function covers the scenario
	// where Testers need to just record "Issues" (TODO: reconsider the terminology)
	// This allows Testers to record failed tests which get backlinked to default test plan or
	// a specific test plan if specified
	CreateFromFoundIssues(context.Context, *schema.NewFoundIssuesRequest)
}

func NewTestRunService

func NewTestRunService(conn *dbsqlc.Queries, logger logging.Logger) TestRunService

type TesterService

type TesterService interface {
	FindAll(context.Context) ([]schema.Tester, error)
	Invite(context.Context, any) (any, error)
}

func NewTesterService

func NewTesterService(db *dbsqlc.Queries, logger logging.Logger) TesterService

type UserService

type UserService interface {
	// FindAll finds all users in the system
	FindAll(context.Context) ([]dbsqlc.User, error)
	// Create creates a new user in the system with the given information
	// provided that the user's email is not already in use and that the information is valid
	Create(context.Context, *schema.NewUserRequest) (*dbsqlc.User, error)
}

func NewUserService

func NewUserService(conn *dbsqlc.Queries, logger logging.Logger) UserService

Jump to

Keyboard shortcuts

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