Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GateWithStats ¶
type GateWithStats struct {
Gate *traffictesting.Gate
Stats traffictesting.GateStats
}
GateWithStats composes a Gate aggregate with its read-side statistics.
type GetGateHandler ¶
type GetGateHandler struct {
// contains filtered or unexported fields
}
GetGateHandler handles the GetGate query
func NewGetGateHandler ¶
func NewGetGateHandler(repo traffictesting.GateRepository, statsRepo traffictesting.StatsRepository) *GetGateHandler
NewGetGateHandler creates a new GetGateHandler
func (*GetGateHandler) Handle ¶
func (h *GetGateHandler) Handle(ctx context.Context, q GetGateQuery) (*GateWithStats, error)
Handle executes the GetGate query
type GetGateQuery ¶
type GetGateQuery struct {
ID string
}
GetGateQuery represents a query to retrieve a single gate
type GetGlobalStatsHandler ¶
type GetGlobalStatsHandler struct {
// contains filtered or unexported fields
}
GetGlobalStatsHandler handles the global stats query
func NewGetGlobalStatsHandler ¶
func NewGetGlobalStatsHandler(repo traffictesting.StatsRepository) *GetGlobalStatsHandler
NewGetGlobalStatsHandler creates a new GetGlobalStatsHandler
func (*GetGlobalStatsHandler) Handle ¶
func (h *GetGlobalStatsHandler) Handle(ctx context.Context) (*traffictesting.GlobalStats, error)
Handle executes the global stats query
type GetRequestHandler ¶
type GetRequestHandler struct {
// contains filtered or unexported fields
}
GetRequestHandler handles the GetRequest query
func NewGetRequestHandler ¶
func NewGetRequestHandler(repo traffictesting.RequestRepository) *GetRequestHandler
NewGetRequestHandler creates a new GetRequestHandler
func (*GetRequestHandler) Handle ¶
func (h *GetRequestHandler) Handle(ctx context.Context, q GetRequestQuery) (*traffictesting.Request, error)
Handle executes the GetRequest query
type GetRequestQuery ¶
GetRequestQuery represents a query to retrieve a single request
type ListGatesHandler ¶
type ListGatesHandler struct {
// contains filtered or unexported fields
}
ListGatesHandler handles the ListGates query
func NewListGatesHandler ¶
func NewListGatesHandler(repo traffictesting.GateRepository, statsRepo traffictesting.StatsRepository) *ListGatesHandler
NewListGatesHandler creates a new ListGatesHandler
func (*ListGatesHandler) Handle ¶
func (h *ListGatesHandler) Handle(ctx context.Context, q ListGatesQuery) (*pagination.PagedResult[*GateWithStats], error)
Handle executes the ListGates query
type ListGatesQuery ¶
type ListGatesQuery struct {
// Pagination
Limit int
Offset int
// Filters (all optional, empty means no filter)
Name string // Substring match on name
LiveURL string // Substring match on live URL
ShadowURL string // Substring match on shadow URL
// Sorting (optional, defaults applied if empty)
SortField string // Field to sort by: "id", "name", "live_url", "shadow_url", "created_at"
SortOrder string // Sort direction: "asc", "desc"
}
ListGatesQuery represents a query to list gates with pagination, filters, and sorting
type ListRequestsHandler ¶
type ListRequestsHandler struct {
// contains filtered or unexported fields
}
ListRequestsHandler handles the ListRequests query
func NewListRequestsHandler ¶
func NewListRequestsHandler(repo traffictesting.RequestRepository) *ListRequestsHandler
NewListRequestsHandler creates a new ListRequestsHandler
func (*ListRequestsHandler) Handle ¶
func (h *ListRequestsHandler) Handle(ctx context.Context, q ListRequestsQuery) (*pagination.PagedResult[*traffictesting.Request], error)
Handle executes the ListRequests query
type ListRequestsQuery ¶
type ListRequestsQuery struct {
// Gate identification
GateID string
// Pagination
Limit int
Offset int
// Filters (all optional, empty/nil means no filter)
Methods []string // HTTP methods to filter by (e.g., ["GET", "POST"])
PathPattern string // Path pattern with wildcards (e.g., "/api/users/*")
FromDate *time.Time // Filter requests created after this date
ToDate *time.Time // Filter requests created before this date
HasDiff *bool // Filter by diff existence (true = has diff, false = no diff, nil = no filter)
// Sorting (optional, defaults applied if empty)
SortField string // Field to sort by: "created_at", "method", "path"
SortOrder string // Sort direction: "asc", "desc"
}
ListRequestsQuery represents a query to list requests for a gate with pagination, filters, and sorting