core

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIKeyAuth

func APIKeyAuth(db *bun.DB) echo.MiddlewareFunc

func APIKeysHandler

func APIKeysHandler(c echo.Context) error

func AllowUnauthenticatedViewers added in v0.20.0

func AllowUnauthenticatedViewers(c echo.Context) bool

func BuildGroupsQuery

func BuildGroupsQuery(db *bun.DB, userID model_db.BinaryUUID, queryAST query.Query, groupBy *query.GroupQuery) (*bun.SelectQuery, error)

func BuildSessionsQuery

func BuildSessionsQuery(
	db *bun.DB,
	userID model_db.BinaryUUID,
	queryAST query.Query,
) (*bun.SelectQuery, error)

func BuildTestcasesQuery

func BuildTestcasesQuery(
	db *bun.DB,
	userID model_db.BinaryUUID,
	queryAST query.Query,
) (*bun.SelectQuery, error)

func CreateAPIKeyHandler

func CreateAPIKeyHandler(c echo.Context) error

func DeleteAPIKeyHandler

func DeleteAPIKeyHandler(c echo.Context) error

func GetAPIKey

func GetAPIKey(c echo.Context) *model_db.APIKey

func GetUserId

func GetUserId(c echo.Context) model_db.BinaryUUID

func GroupsHandler

func GroupsHandler(c echo.Context) error

func HashSecret

func HashSecret(secret string, salt []byte) []byte

func IndexHandler

func IndexHandler(c echo.Context) error

func LoginHandler

func LoginHandler(c echo.Context) error

func LoginPageHandler

func LoginPageHandler(c echo.Context) error

func LogoutHandler

func LogoutHandler(c echo.Context) error

func Migrate

func Migrate(databaseURL string, verbose bool) error

func SessionDetailHandler

func SessionDetailHandler(c echo.Context) error

func SessionsHandler

func SessionsHandler(c echo.Context) error

func TestcaseDetailHandler

func TestcaseDetailHandler(c echo.Context) error

func TestcaseStatusFromString

func TestcaseStatusFromString(status string) (model_db.TestcaseStatus, error)

func TestcaseStatusToString

func TestcaseStatusToString(status model_db.TestcaseStatus) string

func TestcasesHandler

func TestcasesHandler(c echo.Context) error

Types

type APIKeyData

type APIKeyData struct {
	APIKeyID     string `json:"apiKeyId"`
	APIKeySecret string `json:"apiKeySecret"`
}

type IngressHandler

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

func NewIngressHandler

func NewIngressHandler(db *bun.DB) *IngressHandler

func (*IngressHandler) CreateSession

func (h *IngressHandler) CreateSession(c echo.Context) error

func (*IngressHandler) CreateTestcases

func (h *IngressHandler) CreateTestcases(c echo.Context) error

type LabelRequest

type LabelRequest struct {
	Key   string  `json:"key"`
	Value *string `json:"value,omitempty"`
}

type MockQueryServiceInterface added in v0.20.0

type MockQueryServiceInterface struct {
	mock.Mock
}

MockQueryServiceInterface is an autogenerated mock type for the QueryServiceInterface type

func NewMockQueryServiceInterface added in v0.20.0

func NewMockQueryServiceInterface(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockQueryServiceInterface

NewMockQueryServiceInterface creates a new instance of MockQueryServiceInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockQueryServiceInterface) EXPECT added in v0.20.0

func (*MockQueryServiceInterface) GetSession added in v0.20.0

func (_mock *MockQueryServiceInterface) GetSession(ctx context.Context, userID model_db.BinaryUUID, sessionID uuid.UUID) (*SessionDetail, error)

GetSession provides a mock function for the type MockQueryServiceInterface

func (*MockQueryServiceInterface) GetTestcase added in v0.20.0

func (_mock *MockQueryServiceInterface) GetTestcase(ctx context.Context, userID model_db.BinaryUUID, testcaseID uuid.UUID) (*TestcaseDetail, error)

GetTestcase provides a mock function for the type MockQueryServiceInterface

func (*MockQueryServiceInterface) QueryGroups added in v0.20.0

func (_mock *MockQueryServiceInterface) QueryGroups(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Group], error)

QueryGroups provides a mock function for the type MockQueryServiceInterface

func (*MockQueryServiceInterface) QuerySessions added in v0.20.0

func (_mock *MockQueryServiceInterface) QuerySessions(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Session], error)

QuerySessions provides a mock function for the type MockQueryServiceInterface

func (*MockQueryServiceInterface) QueryTestcases added in v0.20.0

func (_mock *MockQueryServiceInterface) QueryTestcases(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Testcase], error)

QueryTestcases provides a mock function for the type MockQueryServiceInterface

type MockQueryServiceInterface_Expecter added in v0.20.0

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

func (*MockQueryServiceInterface_Expecter) GetSession added in v0.20.0

func (_e *MockQueryServiceInterface_Expecter) GetSession(ctx interface{}, userID interface{}, sessionID interface{}) *MockQueryServiceInterface_GetSession_Call

GetSession is a helper method to define mock.On call

  • ctx context.Context
  • userID model_db.BinaryUUID
  • sessionID uuid.UUID

func (*MockQueryServiceInterface_Expecter) GetTestcase added in v0.20.0

func (_e *MockQueryServiceInterface_Expecter) GetTestcase(ctx interface{}, userID interface{}, testcaseID interface{}) *MockQueryServiceInterface_GetTestcase_Call

GetTestcase is a helper method to define mock.On call

  • ctx context.Context
  • userID model_db.BinaryUUID
  • testcaseID uuid.UUID

func (*MockQueryServiceInterface_Expecter) QueryGroups added in v0.20.0

func (_e *MockQueryServiceInterface_Expecter) QueryGroups(ctx interface{}, userID interface{}, params interface{}) *MockQueryServiceInterface_QueryGroups_Call

QueryGroups is a helper method to define mock.On call

  • ctx context.Context
  • userID model_db.BinaryUUID
  • params QueryParams

func (*MockQueryServiceInterface_Expecter) QuerySessions added in v0.20.0

func (_e *MockQueryServiceInterface_Expecter) QuerySessions(ctx interface{}, userID interface{}, params interface{}) *MockQueryServiceInterface_QuerySessions_Call

QuerySessions is a helper method to define mock.On call

  • ctx context.Context
  • userID model_db.BinaryUUID
  • params QueryParams

func (*MockQueryServiceInterface_Expecter) QueryTestcases added in v0.20.0

func (_e *MockQueryServiceInterface_Expecter) QueryTestcases(ctx interface{}, userID interface{}, params interface{}) *MockQueryServiceInterface_QueryTestcases_Call

QueryTestcases is a helper method to define mock.On call

  • ctx context.Context
  • userID model_db.BinaryUUID
  • params QueryParams

type MockQueryServiceInterface_GetSession_Call added in v0.20.0

type MockQueryServiceInterface_GetSession_Call struct {
	*mock.Call
}

MockQueryServiceInterface_GetSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSession'

func (*MockQueryServiceInterface_GetSession_Call) Return added in v0.20.0

func (*MockQueryServiceInterface_GetSession_Call) Run added in v0.20.0

func (_c *MockQueryServiceInterface_GetSession_Call) Run(run func(ctx context.Context, userID model_db.BinaryUUID, sessionID uuid.UUID)) *MockQueryServiceInterface_GetSession_Call

func (*MockQueryServiceInterface_GetSession_Call) RunAndReturn added in v0.20.0

func (_c *MockQueryServiceInterface_GetSession_Call) RunAndReturn(run func(ctx context.Context, userID model_db.BinaryUUID, sessionID uuid.UUID) (*SessionDetail, error)) *MockQueryServiceInterface_GetSession_Call

type MockQueryServiceInterface_GetTestcase_Call added in v0.20.0

type MockQueryServiceInterface_GetTestcase_Call struct {
	*mock.Call
}

MockQueryServiceInterface_GetTestcase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTestcase'

func (*MockQueryServiceInterface_GetTestcase_Call) Return added in v0.20.0

func (*MockQueryServiceInterface_GetTestcase_Call) Run added in v0.20.0

func (_c *MockQueryServiceInterface_GetTestcase_Call) Run(run func(ctx context.Context, userID model_db.BinaryUUID, testcaseID uuid.UUID)) *MockQueryServiceInterface_GetTestcase_Call

func (*MockQueryServiceInterface_GetTestcase_Call) RunAndReturn added in v0.20.0

func (_c *MockQueryServiceInterface_GetTestcase_Call) RunAndReturn(run func(ctx context.Context, userID model_db.BinaryUUID, testcaseID uuid.UUID) (*TestcaseDetail, error)) *MockQueryServiceInterface_GetTestcase_Call

type MockQueryServiceInterface_QueryGroups_Call added in v0.20.0

type MockQueryServiceInterface_QueryGroups_Call struct {
	*mock.Call
}

MockQueryServiceInterface_QueryGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryGroups'

func (*MockQueryServiceInterface_QueryGroups_Call) Return added in v0.20.0

func (*MockQueryServiceInterface_QueryGroups_Call) Run added in v0.20.0

func (_c *MockQueryServiceInterface_QueryGroups_Call) Run(run func(ctx context.Context, userID model_db.BinaryUUID, params QueryParams)) *MockQueryServiceInterface_QueryGroups_Call

func (*MockQueryServiceInterface_QueryGroups_Call) RunAndReturn added in v0.20.0

func (_c *MockQueryServiceInterface_QueryGroups_Call) RunAndReturn(run func(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Group], error)) *MockQueryServiceInterface_QueryGroups_Call

type MockQueryServiceInterface_QuerySessions_Call added in v0.20.0

type MockQueryServiceInterface_QuerySessions_Call struct {
	*mock.Call
}

MockQueryServiceInterface_QuerySessions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QuerySessions'

func (*MockQueryServiceInterface_QuerySessions_Call) Return added in v0.20.0

func (*MockQueryServiceInterface_QuerySessions_Call) Run added in v0.20.0

func (*MockQueryServiceInterface_QuerySessions_Call) RunAndReturn added in v0.20.0

func (_c *MockQueryServiceInterface_QuerySessions_Call) RunAndReturn(run func(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Session], error)) *MockQueryServiceInterface_QuerySessions_Call

type MockQueryServiceInterface_QueryTestcases_Call added in v0.20.0

type MockQueryServiceInterface_QueryTestcases_Call struct {
	*mock.Call
}

MockQueryServiceInterface_QueryTestcases_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryTestcases'

func (*MockQueryServiceInterface_QueryTestcases_Call) Return added in v0.20.0

func (*MockQueryServiceInterface_QueryTestcases_Call) Run added in v0.20.0

func (*MockQueryServiceInterface_QueryTestcases_Call) RunAndReturn added in v0.20.0

func (_c *MockQueryServiceInterface_QueryTestcases_Call) RunAndReturn(run func(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Testcase], error)) *MockQueryServiceInterface_QueryTestcases_Call

type QueryParams added in v0.20.0

type QueryParams struct {
	Query  string
	Offset int
	Limit  int
}

type QueryResult added in v0.20.0

type QueryResult[T any] struct {
	Results    []T
	TotalCount int
}

type QueryService added in v0.20.0

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

func NewQueryService added in v0.20.0

func NewQueryService(db *bun.DB) *QueryService

func (*QueryService) GetSession added in v0.20.0

func (s *QueryService) GetSession(ctx context.Context, userID model_db.BinaryUUID, sessionID uuid.UUID) (*SessionDetail, error)

func (*QueryService) GetTestcase added in v0.20.0

func (s *QueryService) GetTestcase(ctx context.Context, userID model_db.BinaryUUID, testcaseID uuid.UUID) (*TestcaseDetail, error)

func (*QueryService) QueryGroups added in v0.20.0

func (s *QueryService) QueryGroups(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Group], error)

func (*QueryService) QuerySessions added in v0.20.0

func (s *QueryService) QuerySessions(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Session], error)

func (*QueryService) QueryTestcases added in v0.20.0

func (s *QueryService) QueryTestcases(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Testcase], error)

type QueryServiceInterface added in v0.20.0

type QueryServiceInterface interface {
	QueryTestcases(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Testcase], error)
	QuerySessions(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Session], error)
	QueryGroups(ctx context.Context, userID model_db.BinaryUUID, params QueryParams) (*QueryResult[model_api.Group], error)
	GetTestcase(ctx context.Context, userID model_db.BinaryUUID, testcaseID uuid.UUID) (*TestcaseDetail, error)
	GetSession(ctx context.Context, userID model_db.BinaryUUID, sessionID uuid.UUID) (*SessionDetail, error)
}

type QueryTable

type QueryTable string

type SessionDetail added in v0.20.0

type SessionDetail struct {
	ID          string
	Description string
	Status      string
	Baggage     any
	Labels      map[string]string
	CreatedAt   string
}

type SessionRequest

type SessionRequest struct {
	ID          *string        `json:"id,omitempty"`
	Description *string        `json:"description,omitempty"`
	Baggage     map[string]any `json:"baggage,omitempty"`
	Labels      []LabelRequest `json:"labels,omitempty"`
}

type SessionResponse

type SessionResponse struct {
	ID string `json:"id"`
}

type TestcaseDetail added in v0.20.0

type TestcaseDetail struct {
	ID        string
	SessionID string
	Name      string
	Status    string
	Classname string
	File      string
	Testsuite string
	Output    string
	Baggage   any
	Labels    map[string]string
	CreatedAt string
}

type TestcaseRequest

type TestcaseRequest struct {
	SessionID         string         `json:"sessionId"`
	TestcaseName      string         `json:"testcaseName"`
	TestcaseClassname *string        `json:"testcaseClassname,omitempty"`
	TestcaseFile      *string        `json:"testcaseFile,omitempty"`
	Testsuite         *string        `json:"testsuite,omitempty"`
	Status            string         `json:"status"`
	Output            *string        `json:"output,omitempty"`
	Baggage           map[string]any `json:"baggage,omitempty"`
}

type TestcasesRequest

type TestcasesRequest struct {
	Testcases []TestcaseRequest `json:"testcases"`
}

Directories

Path Synopsis
model
api
db

Jump to

Keyboard shortcuts

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