diff --git a/go.mod b/go.mod
index c101584f..c902ca63 100644
--- a/go.mod
+++ b/go.mod
@@ -54,6 +54,7 @@ require (
github.com/containerd/containerd v1.7.14 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
+ github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect
@@ -119,6 +120,7 @@ require (
github.com/prometheus/procfs v0.15.1 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/rs/xid v1.4.0 // indirect
+ github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shirou/gopsutil/v3 v3.24.2 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
@@ -126,9 +128,11 @@ require (
github.com/tklauser/go-sysconf v0.3.13 // indirect
github.com/tklauser/numcpus v0.7.0 // indirect
github.com/ulikunitz/xz v0.5.9 // indirect
+ github.com/urfave/cli/v2 v2.27.5 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
+ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect
go.opentelemetry.io/otel/sdk v1.32.0 // indirect
diff --git a/go.sum b/go.sum
index 292582a4..5160d592 100644
--- a/go.sum
+++ b/go.sum
@@ -38,6 +38,8 @@ github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3
github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E=
github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
+github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
+github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -266,6 +268,8 @@ github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U=
github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY=
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
+github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
+github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA=
github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
@@ -306,6 +310,8 @@ github.com/twpayne/go-geom v1.5.7/go.mod h1:y4fTAQtLedXW8eG2Yo4tYrIGN1yIwwKkmA+K
github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/ulikunitz/xz v0.5.9 h1:RsKRIA2MO8x56wkkcd3LbtcE/uMszhb6DpRf+3uwa3I=
github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
+github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
+github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus=
@@ -316,6 +322,8 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
+github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
+github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
diff --git a/internal/pagination/pagination.go b/internal/pagination/pagination.go
index 9f0902ad..11a4ff6b 100644
--- a/internal/pagination/pagination.go
+++ b/internal/pagination/pagination.go
@@ -3,6 +3,7 @@ package pagination
import (
"encoding/base64"
"fmt"
+ "log"
"net/http"
"net/url"
"reflect"
@@ -17,6 +18,19 @@ const (
DEFAULT_LIMIT = 100
)
+var enc cbor.EncMode
+
+func init() {
+ var err error
+ encOpts := cbor.CoreDetEncOptions()
+ encOpts.Time = cbor.TimeUnixMicro
+ encOpts.TimeTag = cbor.EncTagRequired
+ enc, err = encOpts.EncMode()
+ if err != nil {
+ log.Fatalf("could not create cursor encoder: %s\n", err.Error())
+ }
+}
+
type Links struct {
Previous string `json:"previous"`
Next string `json:"next"`
@@ -90,11 +104,7 @@ func CreatePageT[T1 any, T2 any](data []T1, cursor Cursor[T2]) Page[T1] {
}
func EncodeCursor[T any](f Cursor[T]) string {
- opt := cbor.CanonicalEncOptions()
- opt.Time = cbor.TimeUnix
- enc, _ := opt.EncMode()
-
- data, err := enc.Marshal(&f)
+ data, err := enc.Marshal(f)
if err != nil {
panic(err)
}
@@ -156,8 +166,15 @@ func columnAlias(name string) string {
return "paginated_" + name
}
+func ApplyNoLimit[T any](q sq.SelectBuilder, c Cursor[T]) (sq.SelectBuilder, error) {
+ c.Limit = 0
+ return Apply(q, c)
+}
+
func Apply[T any](q sq.SelectBuilder, c Cursor[T]) (sq.SelectBuilder, error) {
- q = q.Limit(c.Limit)
+ if c.Limit > 0 {
+ q = q.Limit(c.Limit)
+ }
rt := reflect.TypeOf(c.Columns)
rv := reflect.ValueOf(c.Columns)
columns := []whereCol{}
diff --git a/pkg/api/.openapi-generator/FILES b/pkg/api/.openapi-generator/FILES
index 3cbf9906..797508cc 100644
--- a/pkg/api/.openapi-generator/FILES
+++ b/pkg/api/.openapi-generator/FILES
@@ -17,7 +17,6 @@ model_add_tenant_member_request.go
model_api_error.go
model_api_key.go
model_api_key_created.go
-model_archived_ingress.go
model_create_api_key_request.go
model_create_device_201_response.go
model_create_device_request.go
@@ -44,7 +43,6 @@ model_get_sensor_200_response.go
model_get_sensor_group_200_response.go
model_get_worker_200_response.go
model_get_worker_user_code_200_response.go
-model_ingress_dto.go
model_list_api_keys_200_response.go
model_list_api_keys_200_response_all_of.go
model_list_datastreams_200_response.go
@@ -53,8 +51,6 @@ model_list_device_sensors_200_response.go
model_list_device_sensors_200_response_all_of.go
model_list_devices_200_response.go
model_list_devices_200_response_all_of.go
-model_list_ingresses_200_response.go
-model_list_ingresses_200_response_all_of.go
model_list_pipelines_200_response.go
model_list_pipelines_200_response_all_of.go
model_list_sensor_groups_200_response.go
@@ -77,7 +73,6 @@ model_sensor.go
model_sensor_group.go
model_tenant.go
model_trace.go
-model_trace_step.go
model_update_device_200_response.go
model_update_device_request.go
model_update_pipeline_200_response.go
diff --git a/pkg/api/README.md b/pkg/api/README.md
index 09279ef7..3dad9919 100644
--- a/pkg/api/README.md
+++ b/pkg/api/README.md
@@ -122,8 +122,7 @@ Class | Method | HTTP request | Description
*TenantsApi* | [**ListTenants**](docs/TenantsApi.md#listtenants) | **Get** /tenants | Retrieves tenants
*TenantsApi* | [**RemoveTenantMember**](docs/TenantsApi.md#removetenantmember) | **Delete** /tenants/{tenant_id}/members/{user_id} | Removes a member from a tenant
*TenantsApi* | [**UpdateTenantMember**](docs/TenantsApi.md#updatetenantmember) | **Patch** /tenants/{tenant_id}/members/{user_id} | Update a tenant member's permissions
-*TracingApi* | [**ListIngresses**](docs/TracingApi.md#listingresses) | **Get** /ingresses | List ingresses
-*TracingApi* | [**ListTraces**](docs/TracingApi.md#listtraces) | **Get** /tracing | List traces
+*TracingApi* | [**ListTraces**](docs/TracingApi.md#listtraces) | **Get** /traces | List traces
*UplinkApi* | [**ProcessUplinkData**](docs/UplinkApi.md#processuplinkdata) | **Post** /uplinks/{pipeline_id} | Process uplink message
*WorkersApi* | [**CreateWorker**](docs/WorkersApi.md#createworker) | **Post** /workers | Create Worker
*WorkersApi* | [**GetWorker**](docs/WorkersApi.md#getworker) | **Get** /workers/{id} | Get worker
@@ -141,7 +140,6 @@ Class | Method | HTTP request | Description
- [ApiError](docs/ApiError.md)
- [ApiKey](docs/ApiKey.md)
- [ApiKeyCreated](docs/ApiKeyCreated.md)
- - [ArchivedIngress](docs/ArchivedIngress.md)
- [CreateApiKeyRequest](docs/CreateApiKeyRequest.md)
- [CreateDevice201Response](docs/CreateDevice201Response.md)
- [CreateDeviceRequest](docs/CreateDeviceRequest.md)
@@ -168,7 +166,6 @@ Class | Method | HTTP request | Description
- [GetSensorGroup200Response](docs/GetSensorGroup200Response.md)
- [GetWorker200Response](docs/GetWorker200Response.md)
- [GetWorkerUserCode200Response](docs/GetWorkerUserCode200Response.md)
- - [IngressDTO](docs/IngressDTO.md)
- [ListApiKeys200Response](docs/ListApiKeys200Response.md)
- [ListApiKeys200ResponseAllOf](docs/ListApiKeys200ResponseAllOf.md)
- [ListDatastreams200Response](docs/ListDatastreams200Response.md)
@@ -177,8 +174,6 @@ Class | Method | HTTP request | Description
- [ListDeviceSensors200ResponseAllOf](docs/ListDeviceSensors200ResponseAllOf.md)
- [ListDevices200Response](docs/ListDevices200Response.md)
- [ListDevices200ResponseAllOf](docs/ListDevices200ResponseAllOf.md)
- - [ListIngresses200Response](docs/ListIngresses200Response.md)
- - [ListIngresses200ResponseAllOf](docs/ListIngresses200ResponseAllOf.md)
- [ListPipelines200Response](docs/ListPipelines200Response.md)
- [ListPipelines200ResponseAllOf](docs/ListPipelines200ResponseAllOf.md)
- [ListSensorGroups200Response](docs/ListSensorGroups200Response.md)
@@ -201,7 +196,6 @@ Class | Method | HTTP request | Description
- [SensorGroup](docs/SensorGroup.md)
- [Tenant](docs/Tenant.md)
- [Trace](docs/Trace.md)
- - [TraceStep](docs/TraceStep.md)
- [UpdateDevice200Response](docs/UpdateDevice200Response.md)
- [UpdateDeviceRequest](docs/UpdateDeviceRequest.md)
- [UpdatePipeline200Response](docs/UpdatePipeline200Response.md)
diff --git a/pkg/api/api_pipelines.go b/pkg/api/api_pipelines.go
index 5c33a37f..9a593b85 100644
--- a/pkg/api/api_pipelines.go
+++ b/pkg/api/api_pipelines.go
@@ -374,12 +374,19 @@ func (a *PipelinesApiService) GetPipelineExecute(r ApiGetPipelineRequest) (*GetP
type ApiListPipelinesRequest struct {
ctx context.Context
ApiService *PipelinesApiService
+ id *[]string
inactive *bool
step *[]string
cursor *string
limit *int32
}
+// Filter on pipeline ID(s)
+func (r ApiListPipelinesRequest) Id(id []string) ApiListPipelinesRequest {
+ r.id = &id
+ return r
+}
+
// Only show inactive pipelines
func (r ApiListPipelinesRequest) Inactive(inactive bool) ApiListPipelinesRequest {
r.inactive = &inactive
@@ -449,6 +456,17 @@ func (a *PipelinesApiService) ListPipelinesExecute(r ApiListPipelinesRequest) (*
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
+ if r.id != nil {
+ t := *r.id
+ if reflect.TypeOf(t).Kind() == reflect.Slice {
+ s := reflect.ValueOf(t)
+ for i := 0; i < s.Len(); i++ {
+ localVarQueryParams.Add("id", parameterToString(s.Index(i), "multi"))
+ }
+ } else {
+ localVarQueryParams.Add("id", parameterToString(t, "multi"))
+ }
+ }
if r.inactive != nil {
localVarQueryParams.Add("inactive", parameterToString(*r.inactive, ""))
}
diff --git a/pkg/api/api_tracing.go b/pkg/api/api_tracing.go
index f5290eff..89d52a0a 100644
--- a/pkg/api/api_tracing.go
+++ b/pkg/api/api_tracing.go
@@ -17,154 +17,19 @@ import (
"io/ioutil"
"net/http"
"net/url"
- "reflect"
)
// TracingApiService TracingApi service
type TracingApiService service
-type ApiListIngressesRequest struct {
- ctx context.Context
- ApiService *TracingApiService
- cursor *string
- limit *int32
-}
-
-// The cursor for the current page
-func (r ApiListIngressesRequest) Cursor(cursor string) ApiListIngressesRequest {
- r.cursor = &cursor
- return r
-}
-
-// The maximum amount of items per page. Not applicable if `cursor` parameter is given. System limits are in place.
-func (r ApiListIngressesRequest) Limit(limit int32) ApiListIngressesRequest {
- r.limit = &limit
- return r
-}
-
-func (r ApiListIngressesRequest) Execute() (*ListIngresses200Response, *http.Response, error) {
- return r.ApiService.ListIngressesExecute(r)
-}
-
-/*
-ListIngresses List ingresses
-
-Lists ingresses that match the provided filter.
-
-
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return ApiListIngressesRequest
-*/
-func (a *TracingApiService) ListIngresses(ctx context.Context) ApiListIngressesRequest {
- return ApiListIngressesRequest{
- ApiService: a,
- ctx: ctx,
- }
-}
-
-// Execute executes the request
-// @return ListIngresses200Response
-func (a *TracingApiService) ListIngressesExecute(r ApiListIngressesRequest) (*ListIngresses200Response, *http.Response, error) {
- var (
- localVarHTTPMethod = http.MethodGet
- localVarPostBody interface{}
- formFiles []formFile
- localVarReturnValue *ListIngresses200Response
- )
-
- localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TracingApiService.ListIngresses")
- if err != nil {
- return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
- }
-
- localVarPath := localBasePath + "/ingresses"
-
- localVarHeaderParams := make(map[string]string)
- localVarQueryParams := url.Values{}
- localVarFormParams := url.Values{}
-
- if r.cursor != nil {
- localVarQueryParams.Add("cursor", parameterToString(*r.cursor, ""))
- }
- if r.limit != nil {
- localVarQueryParams.Add("limit", parameterToString(*r.limit, ""))
- }
- // to determine the Content-Type header
- localVarHTTPContentTypes := []string{}
-
- // set Content-Type header
- localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
- if localVarHTTPContentType != "" {
- localVarHeaderParams["Content-Type"] = localVarHTTPContentType
- }
-
- // to determine the Accept header
- localVarHTTPHeaderAccepts := []string{"application/json"}
-
- // set Accept header
- localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
- if localVarHTTPHeaderAccept != "" {
- localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
- }
- req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
- if err != nil {
- return localVarReturnValue, nil, err
- }
-
- localVarHTTPResponse, err := a.client.callAPI(req)
- if err != nil || localVarHTTPResponse == nil {
- return localVarReturnValue, localVarHTTPResponse, err
- }
-
- localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
- localVarHTTPResponse.Body.Close()
- localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
- if err != nil {
- return localVarReturnValue, localVarHTTPResponse, err
- }
-
- if localVarHTTPResponse.StatusCode >= 300 {
- newErr := &GenericOpenAPIError{
- body: localVarBody,
- error: localVarHTTPResponse.Status,
- }
- if localVarHTTPResponse.StatusCode == 400 {
- var v ApiError
- err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
- if err != nil {
- newErr.error = err.Error()
- return localVarReturnValue, localVarHTTPResponse, newErr
- }
- newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
- newErr.model = v
- return localVarReturnValue, localVarHTTPResponse, newErr
- }
- return localVarReturnValue, localVarHTTPResponse, newErr
- }
-
- err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
- if err != nil {
- newErr := &GenericOpenAPIError{
- body: localVarBody,
- error: err.Error(),
- }
- return localVarReturnValue, localVarHTTPResponse, newErr
- }
-
- return localVarReturnValue, localVarHTTPResponse, nil
-}
-
type ApiListTracesRequest struct {
ctx context.Context
ApiService *TracingApiService
cursor *string
limit *int32
- tracingId *[]string
+ pipeline *[]string
deviceId *int64
- status *int32
- durationGreaterThan *int32
- durationSmallerThan *int32
}
// The cursor for the current page
@@ -179,8 +44,8 @@ func (r ApiListTracesRequest) Limit(limit int32) ApiListTracesRequest {
return r
}
-func (r ApiListTracesRequest) TracingId(tracingId []string) ApiListTracesRequest {
- r.tracingId = &tracingId
+func (r ApiListTracesRequest) Pipeline(pipeline []string) ApiListTracesRequest {
+ r.pipeline = &pipeline
return r
}
@@ -189,21 +54,6 @@ func (r ApiListTracesRequest) DeviceId(deviceId int64) ApiListTracesRequest {
return r
}
-func (r ApiListTracesRequest) Status(status int32) ApiListTracesRequest {
- r.status = &status
- return r
-}
-
-func (r ApiListTracesRequest) DurationGreaterThan(durationGreaterThan int32) ApiListTracesRequest {
- r.durationGreaterThan = &durationGreaterThan
- return r
-}
-
-func (r ApiListTracesRequest) DurationSmallerThan(durationSmallerThan int32) ApiListTracesRequest {
- r.durationSmallerThan = &durationSmallerThan
- return r
-}
-
func (r ApiListTracesRequest) Execute() (*ListTraces200Response, *http.Response, error) {
return r.ApiService.ListTracesExecute(r)
}
@@ -239,7 +89,7 @@ func (a *TracingApiService) ListTracesExecute(r ApiListTracesRequest) (*ListTrac
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
- localVarPath := localBasePath + "/tracing"
+ localVarPath := localBasePath + "/traces"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -251,29 +101,12 @@ func (a *TracingApiService) ListTracesExecute(r ApiListTracesRequest) (*ListTrac
if r.limit != nil {
localVarQueryParams.Add("limit", parameterToString(*r.limit, ""))
}
- if r.tracingId != nil {
- t := *r.tracingId
- if reflect.TypeOf(t).Kind() == reflect.Slice {
- s := reflect.ValueOf(t)
- for i := 0; i < s.Len(); i++ {
- localVarQueryParams.Add("tracing_id", parameterToString(s.Index(i), "multi"))
- }
- } else {
- localVarQueryParams.Add("tracing_id", parameterToString(t, "multi"))
- }
+ if r.pipeline != nil {
+ localVarQueryParams.Add("pipeline", parameterToString(*r.pipeline, "csv"))
}
if r.deviceId != nil {
localVarQueryParams.Add("device_id", parameterToString(*r.deviceId, ""))
}
- if r.status != nil {
- localVarQueryParams.Add("status", parameterToString(*r.status, ""))
- }
- if r.durationGreaterThan != nil {
- localVarQueryParams.Add("duration_greater_than", parameterToString(*r.durationGreaterThan, ""))
- }
- if r.durationSmallerThan != nil {
- localVarQueryParams.Add("duration_smaller_than", parameterToString(*r.durationSmallerThan, ""))
- }
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
diff --git a/pkg/api/model_archived_ingress.go b/pkg/api/model_archived_ingress.go
deleted file mode 100644
index 014a5c72..00000000
--- a/pkg/api/model_archived_ingress.go
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
-Sensorbucket API
-
-SensorBucket processes data from different sources and devices into a single standardized format. An applications connected to SensorBucket, can use all devices SensorBucket supports. Missing a device or source? SensorBucket is designed to be scalable and extendable. Create your own worker that receives data from an AMQP source, process said data and output in the expected worker output format. Find out more at: https://developer.sensorbucket.nl/ Developed and designed by Provincie Zeeland and Pollex'
-
-API version: 1.2.5
-Contact: info@pollex.nl
-*/
-
-// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
-
-package api
-
-import (
- "encoding/json"
- "time"
-)
-
-// ArchivedIngress struct for ArchivedIngress
-type ArchivedIngress struct {
- TracingId string `json:"tracing_id"`
- RawMessage string `json:"raw_message"`
- ArchivedAt time.Time `json:"archived_at"`
- ExpiresAt time.Time `json:"expires_at"`
- IngressDto *IngressDTO `json:"ingress_dto,omitempty"`
-}
-
-// NewArchivedIngress instantiates a new ArchivedIngress object
-// This constructor will assign default values to properties that have it defined,
-// and makes sure properties required by API are set, but the set of arguments
-// will change when the set of required properties is changed
-func NewArchivedIngress(tracingId string, rawMessage string, archivedAt time.Time, expiresAt time.Time) *ArchivedIngress {
- this := ArchivedIngress{}
- this.TracingId = tracingId
- this.RawMessage = rawMessage
- this.ArchivedAt = archivedAt
- this.ExpiresAt = expiresAt
- return &this
-}
-
-// NewArchivedIngressWithDefaults instantiates a new ArchivedIngress object
-// This constructor will only assign default values to properties that have it defined,
-// but it doesn't guarantee that properties required by API are set
-func NewArchivedIngressWithDefaults() *ArchivedIngress {
- this := ArchivedIngress{}
- return &this
-}
-
-// GetTracingId returns the TracingId field value
-func (o *ArchivedIngress) GetTracingId() string {
- if o == nil {
- var ret string
- return ret
- }
-
- return o.TracingId
-}
-
-// GetTracingIdOk returns a tuple with the TracingId field value
-// and a boolean to check if the value has been set.
-func (o *ArchivedIngress) GetTracingIdOk() (*string, bool) {
- if o == nil {
- return nil, false
- }
- return &o.TracingId, true
-}
-
-// SetTracingId sets field value
-func (o *ArchivedIngress) SetTracingId(v string) {
- o.TracingId = v
-}
-
-// GetRawMessage returns the RawMessage field value
-func (o *ArchivedIngress) GetRawMessage() string {
- if o == nil {
- var ret string
- return ret
- }
-
- return o.RawMessage
-}
-
-// GetRawMessageOk returns a tuple with the RawMessage field value
-// and a boolean to check if the value has been set.
-func (o *ArchivedIngress) GetRawMessageOk() (*string, bool) {
- if o == nil {
- return nil, false
- }
- return &o.RawMessage, true
-}
-
-// SetRawMessage sets field value
-func (o *ArchivedIngress) SetRawMessage(v string) {
- o.RawMessage = v
-}
-
-// GetArchivedAt returns the ArchivedAt field value
-func (o *ArchivedIngress) GetArchivedAt() time.Time {
- if o == nil {
- var ret time.Time
- return ret
- }
-
- return o.ArchivedAt
-}
-
-// GetArchivedAtOk returns a tuple with the ArchivedAt field value
-// and a boolean to check if the value has been set.
-func (o *ArchivedIngress) GetArchivedAtOk() (*time.Time, bool) {
- if o == nil {
- return nil, false
- }
- return &o.ArchivedAt, true
-}
-
-// SetArchivedAt sets field value
-func (o *ArchivedIngress) SetArchivedAt(v time.Time) {
- o.ArchivedAt = v
-}
-
-// GetExpiresAt returns the ExpiresAt field value
-func (o *ArchivedIngress) GetExpiresAt() time.Time {
- if o == nil {
- var ret time.Time
- return ret
- }
-
- return o.ExpiresAt
-}
-
-// GetExpiresAtOk returns a tuple with the ExpiresAt field value
-// and a boolean to check if the value has been set.
-func (o *ArchivedIngress) GetExpiresAtOk() (*time.Time, bool) {
- if o == nil {
- return nil, false
- }
- return &o.ExpiresAt, true
-}
-
-// SetExpiresAt sets field value
-func (o *ArchivedIngress) SetExpiresAt(v time.Time) {
- o.ExpiresAt = v
-}
-
-// GetIngressDto returns the IngressDto field value if set, zero value otherwise.
-func (o *ArchivedIngress) GetIngressDto() IngressDTO {
- if o == nil || isNil(o.IngressDto) {
- var ret IngressDTO
- return ret
- }
- return *o.IngressDto
-}
-
-// GetIngressDtoOk returns a tuple with the IngressDto field value if set, nil otherwise
-// and a boolean to check if the value has been set.
-func (o *ArchivedIngress) GetIngressDtoOk() (*IngressDTO, bool) {
- if o == nil || isNil(o.IngressDto) {
- return nil, false
- }
- return o.IngressDto, true
-}
-
-// HasIngressDto returns a boolean if a field has been set.
-func (o *ArchivedIngress) HasIngressDto() bool {
- if o != nil && !isNil(o.IngressDto) {
- return true
- }
-
- return false
-}
-
-// SetIngressDto gets a reference to the given IngressDTO and assigns it to the IngressDto field.
-func (o *ArchivedIngress) SetIngressDto(v IngressDTO) {
- o.IngressDto = &v
-}
-
-func (o ArchivedIngress) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if true {
- toSerialize["tracing_id"] = o.TracingId
- }
- if true {
- toSerialize["raw_message"] = o.RawMessage
- }
- if true {
- toSerialize["archived_at"] = o.ArchivedAt
- }
- if true {
- toSerialize["expires_at"] = o.ExpiresAt
- }
- if !isNil(o.IngressDto) {
- toSerialize["ingress_dto"] = o.IngressDto
- }
- return json.Marshal(toSerialize)
-}
-
-type NullableArchivedIngress struct {
- value *ArchivedIngress
- isSet bool
-}
-
-func (v NullableArchivedIngress) Get() *ArchivedIngress {
- return v.value
-}
-
-func (v *NullableArchivedIngress) Set(val *ArchivedIngress) {
- v.value = val
- v.isSet = true
-}
-
-func (v NullableArchivedIngress) IsSet() bool {
- return v.isSet
-}
-
-func (v *NullableArchivedIngress) Unset() {
- v.value = nil
- v.isSet = false
-}
-
-func NewNullableArchivedIngress(val *ArchivedIngress) *NullableArchivedIngress {
- return &NullableArchivedIngress{value: val, isSet: true}
-}
-
-func (v NullableArchivedIngress) MarshalJSON() ([]byte, error) {
- return json.Marshal(v.value)
-}
-
-func (v *NullableArchivedIngress) UnmarshalJSON(src []byte) error {
- v.isSet = true
- return json.Unmarshal(src, &v.value)
-}
-
-
diff --git a/pkg/api/model_ingress_dto.go b/pkg/api/model_ingress_dto.go
deleted file mode 100644
index c9ef358b..00000000
--- a/pkg/api/model_ingress_dto.go
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
-Sensorbucket API
-
-SensorBucket processes data from different sources and devices into a single standardized format. An applications connected to SensorBucket, can use all devices SensorBucket supports. Missing a device or source? SensorBucket is designed to be scalable and extendable. Create your own worker that receives data from an AMQP source, process said data and output in the expected worker output format. Find out more at: https://developer.sensorbucket.nl/ Developed and designed by Provincie Zeeland and Pollex'
-
-API version: 1.2.5
-Contact: info@pollex.nl
-*/
-
-// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
-
-package api
-
-import (
- "encoding/json"
- "time"
-)
-
-// IngressDTO struct for IngressDTO
-type IngressDTO struct {
- TracingId string `json:"tracing_id"`
- PipelineId string `json:"pipeline_id"`
- OwnerId int64 `json:"owner_id"`
- Payload string `json:"payload"`
- CreatedAt time.Time `json:"created_at"`
-}
-
-// NewIngressDTO instantiates a new IngressDTO object
-// This constructor will assign default values to properties that have it defined,
-// and makes sure properties required by API are set, but the set of arguments
-// will change when the set of required properties is changed
-func NewIngressDTO(tracingId string, pipelineId string, ownerId int64, payload string, createdAt time.Time) *IngressDTO {
- this := IngressDTO{}
- this.TracingId = tracingId
- this.PipelineId = pipelineId
- this.OwnerId = ownerId
- this.Payload = payload
- this.CreatedAt = createdAt
- return &this
-}
-
-// NewIngressDTOWithDefaults instantiates a new IngressDTO object
-// This constructor will only assign default values to properties that have it defined,
-// but it doesn't guarantee that properties required by API are set
-func NewIngressDTOWithDefaults() *IngressDTO {
- this := IngressDTO{}
- return &this
-}
-
-// GetTracingId returns the TracingId field value
-func (o *IngressDTO) GetTracingId() string {
- if o == nil {
- var ret string
- return ret
- }
-
- return o.TracingId
-}
-
-// GetTracingIdOk returns a tuple with the TracingId field value
-// and a boolean to check if the value has been set.
-func (o *IngressDTO) GetTracingIdOk() (*string, bool) {
- if o == nil {
- return nil, false
- }
- return &o.TracingId, true
-}
-
-// SetTracingId sets field value
-func (o *IngressDTO) SetTracingId(v string) {
- o.TracingId = v
-}
-
-// GetPipelineId returns the PipelineId field value
-func (o *IngressDTO) GetPipelineId() string {
- if o == nil {
- var ret string
- return ret
- }
-
- return o.PipelineId
-}
-
-// GetPipelineIdOk returns a tuple with the PipelineId field value
-// and a boolean to check if the value has been set.
-func (o *IngressDTO) GetPipelineIdOk() (*string, bool) {
- if o == nil {
- return nil, false
- }
- return &o.PipelineId, true
-}
-
-// SetPipelineId sets field value
-func (o *IngressDTO) SetPipelineId(v string) {
- o.PipelineId = v
-}
-
-// GetOwnerId returns the OwnerId field value
-func (o *IngressDTO) GetOwnerId() int64 {
- if o == nil {
- var ret int64
- return ret
- }
-
- return o.OwnerId
-}
-
-// GetOwnerIdOk returns a tuple with the OwnerId field value
-// and a boolean to check if the value has been set.
-func (o *IngressDTO) GetOwnerIdOk() (*int64, bool) {
- if o == nil {
- return nil, false
- }
- return &o.OwnerId, true
-}
-
-// SetOwnerId sets field value
-func (o *IngressDTO) SetOwnerId(v int64) {
- o.OwnerId = v
-}
-
-// GetPayload returns the Payload field value
-func (o *IngressDTO) GetPayload() string {
- if o == nil {
- var ret string
- return ret
- }
-
- return o.Payload
-}
-
-// GetPayloadOk returns a tuple with the Payload field value
-// and a boolean to check if the value has been set.
-func (o *IngressDTO) GetPayloadOk() (*string, bool) {
- if o == nil {
- return nil, false
- }
- return &o.Payload, true
-}
-
-// SetPayload sets field value
-func (o *IngressDTO) SetPayload(v string) {
- o.Payload = v
-}
-
-// GetCreatedAt returns the CreatedAt field value
-func (o *IngressDTO) GetCreatedAt() time.Time {
- if o == nil {
- var ret time.Time
- return ret
- }
-
- return o.CreatedAt
-}
-
-// GetCreatedAtOk returns a tuple with the CreatedAt field value
-// and a boolean to check if the value has been set.
-func (o *IngressDTO) GetCreatedAtOk() (*time.Time, bool) {
- if o == nil {
- return nil, false
- }
- return &o.CreatedAt, true
-}
-
-// SetCreatedAt sets field value
-func (o *IngressDTO) SetCreatedAt(v time.Time) {
- o.CreatedAt = v
-}
-
-func (o IngressDTO) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if true {
- toSerialize["tracing_id"] = o.TracingId
- }
- if true {
- toSerialize["pipeline_id"] = o.PipelineId
- }
- if true {
- toSerialize["owner_id"] = o.OwnerId
- }
- if true {
- toSerialize["payload"] = o.Payload
- }
- if true {
- toSerialize["created_at"] = o.CreatedAt
- }
- return json.Marshal(toSerialize)
-}
-
-type NullableIngressDTO struct {
- value *IngressDTO
- isSet bool
-}
-
-func (v NullableIngressDTO) Get() *IngressDTO {
- return v.value
-}
-
-func (v *NullableIngressDTO) Set(val *IngressDTO) {
- v.value = val
- v.isSet = true
-}
-
-func (v NullableIngressDTO) IsSet() bool {
- return v.isSet
-}
-
-func (v *NullableIngressDTO) Unset() {
- v.value = nil
- v.isSet = false
-}
-
-func NewNullableIngressDTO(val *IngressDTO) *NullableIngressDTO {
- return &NullableIngressDTO{value: val, isSet: true}
-}
-
-func (v NullableIngressDTO) MarshalJSON() ([]byte, error) {
- return json.Marshal(v.value)
-}
-
-func (v *NullableIngressDTO) UnmarshalJSON(src []byte) error {
- v.isSet = true
- return json.Unmarshal(src, &v.value)
-}
-
-
diff --git a/pkg/api/model_list_ingresses_200_response.go b/pkg/api/model_list_ingresses_200_response.go
deleted file mode 100644
index c97457a5..00000000
--- a/pkg/api/model_list_ingresses_200_response.go
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
-Sensorbucket API
-
-SensorBucket processes data from different sources and devices into a single standardized format. An applications connected to SensorBucket, can use all devices SensorBucket supports. Missing a device or source? SensorBucket is designed to be scalable and extendable. Create your own worker that receives data from an AMQP source, process said data and output in the expected worker output format. Find out more at: https://developer.sensorbucket.nl/ Developed and designed by Provincie Zeeland and Pollex'
-
-API version: 1.2.5
-Contact: info@pollex.nl
-*/
-
-// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
-
-package api
-
-import (
- "encoding/json"
-)
-
-// ListIngresses200Response struct for ListIngresses200Response
-type ListIngresses200Response struct {
- Links PaginatedResponseLinks `json:"links"`
- PageSize int32 `json:"page_size"`
- TotalCount int32 `json:"total_count"`
- Data []ArchivedIngress `json:"data"`
-}
-
-// NewListIngresses200Response instantiates a new ListIngresses200Response object
-// This constructor will assign default values to properties that have it defined,
-// and makes sure properties required by API are set, but the set of arguments
-// will change when the set of required properties is changed
-func NewListIngresses200Response(links PaginatedResponseLinks, pageSize int32, totalCount int32, data []ArchivedIngress) *ListIngresses200Response {
- this := ListIngresses200Response{}
- this.Links = links
- this.PageSize = pageSize
- this.TotalCount = totalCount
- this.Data = data
- return &this
-}
-
-// NewListIngresses200ResponseWithDefaults instantiates a new ListIngresses200Response object
-// This constructor will only assign default values to properties that have it defined,
-// but it doesn't guarantee that properties required by API are set
-func NewListIngresses200ResponseWithDefaults() *ListIngresses200Response {
- this := ListIngresses200Response{}
- return &this
-}
-
-// GetLinks returns the Links field value
-func (o *ListIngresses200Response) GetLinks() PaginatedResponseLinks {
- if o == nil {
- var ret PaginatedResponseLinks
- return ret
- }
-
- return o.Links
-}
-
-// GetLinksOk returns a tuple with the Links field value
-// and a boolean to check if the value has been set.
-func (o *ListIngresses200Response) GetLinksOk() (*PaginatedResponseLinks, bool) {
- if o == nil {
- return nil, false
- }
- return &o.Links, true
-}
-
-// SetLinks sets field value
-func (o *ListIngresses200Response) SetLinks(v PaginatedResponseLinks) {
- o.Links = v
-}
-
-// GetPageSize returns the PageSize field value
-func (o *ListIngresses200Response) GetPageSize() int32 {
- if o == nil {
- var ret int32
- return ret
- }
-
- return o.PageSize
-}
-
-// GetPageSizeOk returns a tuple with the PageSize field value
-// and a boolean to check if the value has been set.
-func (o *ListIngresses200Response) GetPageSizeOk() (*int32, bool) {
- if o == nil {
- return nil, false
- }
- return &o.PageSize, true
-}
-
-// SetPageSize sets field value
-func (o *ListIngresses200Response) SetPageSize(v int32) {
- o.PageSize = v
-}
-
-// GetTotalCount returns the TotalCount field value
-func (o *ListIngresses200Response) GetTotalCount() int32 {
- if o == nil {
- var ret int32
- return ret
- }
-
- return o.TotalCount
-}
-
-// GetTotalCountOk returns a tuple with the TotalCount field value
-// and a boolean to check if the value has been set.
-func (o *ListIngresses200Response) GetTotalCountOk() (*int32, bool) {
- if o == nil {
- return nil, false
- }
- return &o.TotalCount, true
-}
-
-// SetTotalCount sets field value
-func (o *ListIngresses200Response) SetTotalCount(v int32) {
- o.TotalCount = v
-}
-
-// GetData returns the Data field value
-func (o *ListIngresses200Response) GetData() []ArchivedIngress {
- if o == nil {
- var ret []ArchivedIngress
- return ret
- }
-
- return o.Data
-}
-
-// GetDataOk returns a tuple with the Data field value
-// and a boolean to check if the value has been set.
-func (o *ListIngresses200Response) GetDataOk() ([]ArchivedIngress, bool) {
- if o == nil {
- return nil, false
- }
- return o.Data, true
-}
-
-// SetData sets field value
-func (o *ListIngresses200Response) SetData(v []ArchivedIngress) {
- o.Data = v
-}
-
-func (o ListIngresses200Response) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if true {
- toSerialize["links"] = o.Links
- }
- if true {
- toSerialize["page_size"] = o.PageSize
- }
- if true {
- toSerialize["total_count"] = o.TotalCount
- }
- if true {
- toSerialize["data"] = o.Data
- }
- return json.Marshal(toSerialize)
-}
-
-type NullableListIngresses200Response struct {
- value *ListIngresses200Response
- isSet bool
-}
-
-func (v NullableListIngresses200Response) Get() *ListIngresses200Response {
- return v.value
-}
-
-func (v *NullableListIngresses200Response) Set(val *ListIngresses200Response) {
- v.value = val
- v.isSet = true
-}
-
-func (v NullableListIngresses200Response) IsSet() bool {
- return v.isSet
-}
-
-func (v *NullableListIngresses200Response) Unset() {
- v.value = nil
- v.isSet = false
-}
-
-func NewNullableListIngresses200Response(val *ListIngresses200Response) *NullableListIngresses200Response {
- return &NullableListIngresses200Response{value: val, isSet: true}
-}
-
-func (v NullableListIngresses200Response) MarshalJSON() ([]byte, error) {
- return json.Marshal(v.value)
-}
-
-func (v *NullableListIngresses200Response) UnmarshalJSON(src []byte) error {
- v.isSet = true
- return json.Unmarshal(src, &v.value)
-}
-
-
diff --git a/pkg/api/model_list_ingresses_200_response_all_of.go b/pkg/api/model_list_ingresses_200_response_all_of.go
deleted file mode 100644
index b5762425..00000000
--- a/pkg/api/model_list_ingresses_200_response_all_of.go
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-Sensorbucket API
-
-SensorBucket processes data from different sources and devices into a single standardized format. An applications connected to SensorBucket, can use all devices SensorBucket supports. Missing a device or source? SensorBucket is designed to be scalable and extendable. Create your own worker that receives data from an AMQP source, process said data and output in the expected worker output format. Find out more at: https://developer.sensorbucket.nl/ Developed and designed by Provincie Zeeland and Pollex'
-
-API version: 1.2.5
-Contact: info@pollex.nl
-*/
-
-// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
-
-package api
-
-import (
- "encoding/json"
-)
-
-// ListIngresses200ResponseAllOf struct for ListIngresses200ResponseAllOf
-type ListIngresses200ResponseAllOf struct {
- Data []ArchivedIngress `json:"data,omitempty"`
-}
-
-// NewListIngresses200ResponseAllOf instantiates a new ListIngresses200ResponseAllOf object
-// This constructor will assign default values to properties that have it defined,
-// and makes sure properties required by API are set, but the set of arguments
-// will change when the set of required properties is changed
-func NewListIngresses200ResponseAllOf() *ListIngresses200ResponseAllOf {
- this := ListIngresses200ResponseAllOf{}
- return &this
-}
-
-// NewListIngresses200ResponseAllOfWithDefaults instantiates a new ListIngresses200ResponseAllOf object
-// This constructor will only assign default values to properties that have it defined,
-// but it doesn't guarantee that properties required by API are set
-func NewListIngresses200ResponseAllOfWithDefaults() *ListIngresses200ResponseAllOf {
- this := ListIngresses200ResponseAllOf{}
- return &this
-}
-
-// GetData returns the Data field value if set, zero value otherwise.
-func (o *ListIngresses200ResponseAllOf) GetData() []ArchivedIngress {
- if o == nil || isNil(o.Data) {
- var ret []ArchivedIngress
- return ret
- }
- return o.Data
-}
-
-// GetDataOk returns a tuple with the Data field value if set, nil otherwise
-// and a boolean to check if the value has been set.
-func (o *ListIngresses200ResponseAllOf) GetDataOk() ([]ArchivedIngress, bool) {
- if o == nil || isNil(o.Data) {
- return nil, false
- }
- return o.Data, true
-}
-
-// HasData returns a boolean if a field has been set.
-func (o *ListIngresses200ResponseAllOf) HasData() bool {
- if o != nil && !isNil(o.Data) {
- return true
- }
-
- return false
-}
-
-// SetData gets a reference to the given []ArchivedIngress and assigns it to the Data field.
-func (o *ListIngresses200ResponseAllOf) SetData(v []ArchivedIngress) {
- o.Data = v
-}
-
-func (o ListIngresses200ResponseAllOf) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if !isNil(o.Data) {
- toSerialize["data"] = o.Data
- }
- return json.Marshal(toSerialize)
-}
-
-type NullableListIngresses200ResponseAllOf struct {
- value *ListIngresses200ResponseAllOf
- isSet bool
-}
-
-func (v NullableListIngresses200ResponseAllOf) Get() *ListIngresses200ResponseAllOf {
- return v.value
-}
-
-func (v *NullableListIngresses200ResponseAllOf) Set(val *ListIngresses200ResponseAllOf) {
- v.value = val
- v.isSet = true
-}
-
-func (v NullableListIngresses200ResponseAllOf) IsSet() bool {
- return v.isSet
-}
-
-func (v *NullableListIngresses200ResponseAllOf) Unset() {
- v.value = nil
- v.isSet = false
-}
-
-func NewNullableListIngresses200ResponseAllOf(val *ListIngresses200ResponseAllOf) *NullableListIngresses200ResponseAllOf {
- return &NullableListIngresses200ResponseAllOf{value: val, isSet: true}
-}
-
-func (v NullableListIngresses200ResponseAllOf) MarshalJSON() ([]byte, error) {
- return json.Marshal(v.value)
-}
-
-func (v *NullableListIngresses200ResponseAllOf) UnmarshalJSON(src []byte) error {
- v.isSet = true
- return json.Unmarshal(src, &v.value)
-}
-
-
diff --git a/pkg/api/model_trace.go b/pkg/api/model_trace.go
index 4e20c7f0..d1f599f4 100644
--- a/pkg/api/model_trace.go
+++ b/pkg/api/model_trace.go
@@ -18,27 +18,29 @@ import (
// Trace struct for Trace
type Trace struct {
- TracingId string `json:"tracing_id"`
+ Id string `json:"id"`
+ PipelineId string `json:"pipeline_id"`
// id is 0 if not defined
DeviceId int64 `json:"device_id"`
StartTime time.Time `json:"start_time"`
- Status int32 `json:"status"`
- StatusString string `json:"status_string"`
- Steps []TraceStep `json:"steps"`
+ Workers []string `json:"workers"`
+ WorkerTimes []time.Time `json:"worker_times"`
+ Error *string `json:"error,omitempty"`
+ ErrorAt *time.Time `json:"error_at,omitempty"`
}
// NewTrace instantiates a new Trace object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
-func NewTrace(tracingId string, deviceId int64, startTime time.Time, status int32, statusString string, steps []TraceStep) *Trace {
+func NewTrace(id string, pipelineId string, deviceId int64, startTime time.Time, workers []string, workerTimes []time.Time) *Trace {
this := Trace{}
- this.TracingId = tracingId
+ this.Id = id
+ this.PipelineId = pipelineId
this.DeviceId = deviceId
this.StartTime = startTime
- this.Status = status
- this.StatusString = statusString
- this.Steps = steps
+ this.Workers = workers
+ this.WorkerTimes = workerTimes
return &this
}
@@ -50,28 +52,52 @@ func NewTraceWithDefaults() *Trace {
return &this
}
-// GetTracingId returns the TracingId field value
-func (o *Trace) GetTracingId() string {
+// GetId returns the Id field value
+func (o *Trace) GetId() string {
if o == nil {
var ret string
return ret
}
- return o.TracingId
+ return o.Id
}
-// GetTracingIdOk returns a tuple with the TracingId field value
+// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
-func (o *Trace) GetTracingIdOk() (*string, bool) {
+func (o *Trace) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
- return &o.TracingId, true
+ return &o.Id, true
}
-// SetTracingId sets field value
-func (o *Trace) SetTracingId(v string) {
- o.TracingId = v
+// SetId sets field value
+func (o *Trace) SetId(v string) {
+ o.Id = v
+}
+
+// GetPipelineId returns the PipelineId field value
+func (o *Trace) GetPipelineId() string {
+ if o == nil {
+ var ret string
+ return ret
+ }
+
+ return o.PipelineId
+}
+
+// GetPipelineIdOk returns a tuple with the PipelineId field value
+// and a boolean to check if the value has been set.
+func (o *Trace) GetPipelineIdOk() (*string, bool) {
+ if o == nil {
+ return nil, false
+ }
+ return &o.PipelineId, true
+}
+
+// SetPipelineId sets field value
+func (o *Trace) SetPipelineId(v string) {
+ o.PipelineId = v
}
// GetDeviceId returns the DeviceId field value
@@ -122,82 +148,125 @@ func (o *Trace) SetStartTime(v time.Time) {
o.StartTime = v
}
-// GetStatus returns the Status field value
-func (o *Trace) GetStatus() int32 {
+// GetWorkers returns the Workers field value
+func (o *Trace) GetWorkers() []string {
if o == nil {
- var ret int32
+ var ret []string
return ret
}
- return o.Status
+ return o.Workers
}
-// GetStatusOk returns a tuple with the Status field value
+// GetWorkersOk returns a tuple with the Workers field value
// and a boolean to check if the value has been set.
-func (o *Trace) GetStatusOk() (*int32, bool) {
+func (o *Trace) GetWorkersOk() ([]string, bool) {
if o == nil {
return nil, false
}
- return &o.Status, true
+ return o.Workers, true
}
-// SetStatus sets field value
-func (o *Trace) SetStatus(v int32) {
- o.Status = v
+// SetWorkers sets field value
+func (o *Trace) SetWorkers(v []string) {
+ o.Workers = v
}
-// GetStatusString returns the StatusString field value
-func (o *Trace) GetStatusString() string {
+// GetWorkerTimes returns the WorkerTimes field value
+func (o *Trace) GetWorkerTimes() []time.Time {
if o == nil {
- var ret string
+ var ret []time.Time
return ret
}
- return o.StatusString
+ return o.WorkerTimes
}
-// GetStatusStringOk returns a tuple with the StatusString field value
+// GetWorkerTimesOk returns a tuple with the WorkerTimes field value
// and a boolean to check if the value has been set.
-func (o *Trace) GetStatusStringOk() (*string, bool) {
+func (o *Trace) GetWorkerTimesOk() ([]time.Time, bool) {
if o == nil {
return nil, false
}
- return &o.StatusString, true
+ return o.WorkerTimes, true
}
-// SetStatusString sets field value
-func (o *Trace) SetStatusString(v string) {
- o.StatusString = v
+// SetWorkerTimes sets field value
+func (o *Trace) SetWorkerTimes(v []time.Time) {
+ o.WorkerTimes = v
}
-// GetSteps returns the Steps field value
-func (o *Trace) GetSteps() []TraceStep {
- if o == nil {
- var ret []TraceStep
+// GetError returns the Error field value if set, zero value otherwise.
+func (o *Trace) GetError() string {
+ if o == nil || isNil(o.Error) {
+ var ret string
return ret
}
+ return *o.Error
+}
+
+// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
+// and a boolean to check if the value has been set.
+func (o *Trace) GetErrorOk() (*string, bool) {
+ if o == nil || isNil(o.Error) {
+ return nil, false
+ }
+ return o.Error, true
+}
+
+// HasError returns a boolean if a field has been set.
+func (o *Trace) HasError() bool {
+ if o != nil && !isNil(o.Error) {
+ return true
+ }
- return o.Steps
+ return false
}
-// GetStepsOk returns a tuple with the Steps field value
+// SetError gets a reference to the given string and assigns it to the Error field.
+func (o *Trace) SetError(v string) {
+ o.Error = &v
+}
+
+// GetErrorAt returns the ErrorAt field value if set, zero value otherwise.
+func (o *Trace) GetErrorAt() time.Time {
+ if o == nil || isNil(o.ErrorAt) {
+ var ret time.Time
+ return ret
+ }
+ return *o.ErrorAt
+}
+
+// GetErrorAtOk returns a tuple with the ErrorAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
-func (o *Trace) GetStepsOk() ([]TraceStep, bool) {
- if o == nil {
+func (o *Trace) GetErrorAtOk() (*time.Time, bool) {
+ if o == nil || isNil(o.ErrorAt) {
return nil, false
}
- return o.Steps, true
+ return o.ErrorAt, true
+}
+
+// HasErrorAt returns a boolean if a field has been set.
+func (o *Trace) HasErrorAt() bool {
+ if o != nil && !isNil(o.ErrorAt) {
+ return true
+ }
+
+ return false
}
-// SetSteps sets field value
-func (o *Trace) SetSteps(v []TraceStep) {
- o.Steps = v
+// SetErrorAt gets a reference to the given time.Time and assigns it to the ErrorAt field.
+func (o *Trace) SetErrorAt(v time.Time) {
+ o.ErrorAt = &v
}
func (o Trace) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
- toSerialize["tracing_id"] = o.TracingId
+ toSerialize["id"] = o.Id
+ }
+ if true {
+ toSerialize["pipeline_id"] = o.PipelineId
}
if true {
toSerialize["device_id"] = o.DeviceId
@@ -206,13 +275,16 @@ func (o Trace) MarshalJSON() ([]byte, error) {
toSerialize["start_time"] = o.StartTime
}
if true {
- toSerialize["status"] = o.Status
+ toSerialize["workers"] = o.Workers
}
if true {
- toSerialize["status_string"] = o.StatusString
+ toSerialize["worker_times"] = o.WorkerTimes
}
- if true {
- toSerialize["steps"] = o.Steps
+ if !isNil(o.Error) {
+ toSerialize["error"] = o.Error
+ }
+ if !isNil(o.ErrorAt) {
+ toSerialize["error_at"] = o.ErrorAt
}
return json.Marshal(toSerialize)
}
diff --git a/pkg/api/model_trace_step.go b/pkg/api/model_trace_step.go
deleted file mode 100644
index 5e961b8a..00000000
--- a/pkg/api/model_trace_step.go
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
-Sensorbucket API
-
-SensorBucket processes data from different sources and devices into a single standardized format. An applications connected to SensorBucket, can use all devices SensorBucket supports. Missing a device or source? SensorBucket is designed to be scalable and extendable. Create your own worker that receives data from an AMQP source, process said data and output in the expected worker output format. Find out more at: https://developer.sensorbucket.nl/ Developed and designed by Provincie Zeeland and Pollex'
-
-API version: 1.2.5
-Contact: info@pollex.nl
-*/
-
-// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
-
-package api
-
-import (
- "encoding/json"
- "time"
-)
-
-// TraceStep struct for TraceStep
-type TraceStep struct {
- StartTime *time.Time `json:"start_time,omitempty"`
- Status int32 `json:"status"`
- StatusString string `json:"status_string"`
- // Duration in seconds
- Duration float64 `json:"duration"`
- Error string `json:"error"`
-}
-
-// NewTraceStep instantiates a new TraceStep object
-// This constructor will assign default values to properties that have it defined,
-// and makes sure properties required by API are set, but the set of arguments
-// will change when the set of required properties is changed
-func NewTraceStep(status int32, statusString string, duration float64, error_ string) *TraceStep {
- this := TraceStep{}
- this.Status = status
- this.StatusString = statusString
- this.Duration = duration
- this.Error = error_
- return &this
-}
-
-// NewTraceStepWithDefaults instantiates a new TraceStep object
-// This constructor will only assign default values to properties that have it defined,
-// but it doesn't guarantee that properties required by API are set
-func NewTraceStepWithDefaults() *TraceStep {
- this := TraceStep{}
- return &this
-}
-
-// GetStartTime returns the StartTime field value if set, zero value otherwise.
-func (o *TraceStep) GetStartTime() time.Time {
- if o == nil || isNil(o.StartTime) {
- var ret time.Time
- return ret
- }
- return *o.StartTime
-}
-
-// GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise
-// and a boolean to check if the value has been set.
-func (o *TraceStep) GetStartTimeOk() (*time.Time, bool) {
- if o == nil || isNil(o.StartTime) {
- return nil, false
- }
- return o.StartTime, true
-}
-
-// HasStartTime returns a boolean if a field has been set.
-func (o *TraceStep) HasStartTime() bool {
- if o != nil && !isNil(o.StartTime) {
- return true
- }
-
- return false
-}
-
-// SetStartTime gets a reference to the given time.Time and assigns it to the StartTime field.
-func (o *TraceStep) SetStartTime(v time.Time) {
- o.StartTime = &v
-}
-
-// GetStatus returns the Status field value
-func (o *TraceStep) GetStatus() int32 {
- if o == nil {
- var ret int32
- return ret
- }
-
- return o.Status
-}
-
-// GetStatusOk returns a tuple with the Status field value
-// and a boolean to check if the value has been set.
-func (o *TraceStep) GetStatusOk() (*int32, bool) {
- if o == nil {
- return nil, false
- }
- return &o.Status, true
-}
-
-// SetStatus sets field value
-func (o *TraceStep) SetStatus(v int32) {
- o.Status = v
-}
-
-// GetStatusString returns the StatusString field value
-func (o *TraceStep) GetStatusString() string {
- if o == nil {
- var ret string
- return ret
- }
-
- return o.StatusString
-}
-
-// GetStatusStringOk returns a tuple with the StatusString field value
-// and a boolean to check if the value has been set.
-func (o *TraceStep) GetStatusStringOk() (*string, bool) {
- if o == nil {
- return nil, false
- }
- return &o.StatusString, true
-}
-
-// SetStatusString sets field value
-func (o *TraceStep) SetStatusString(v string) {
- o.StatusString = v
-}
-
-// GetDuration returns the Duration field value
-func (o *TraceStep) GetDuration() float64 {
- if o == nil {
- var ret float64
- return ret
- }
-
- return o.Duration
-}
-
-// GetDurationOk returns a tuple with the Duration field value
-// and a boolean to check if the value has been set.
-func (o *TraceStep) GetDurationOk() (*float64, bool) {
- if o == nil {
- return nil, false
- }
- return &o.Duration, true
-}
-
-// SetDuration sets field value
-func (o *TraceStep) SetDuration(v float64) {
- o.Duration = v
-}
-
-// GetError returns the Error field value
-func (o *TraceStep) GetError() string {
- if o == nil {
- var ret string
- return ret
- }
-
- return o.Error
-}
-
-// GetErrorOk returns a tuple with the Error field value
-// and a boolean to check if the value has been set.
-func (o *TraceStep) GetErrorOk() (*string, bool) {
- if o == nil {
- return nil, false
- }
- return &o.Error, true
-}
-
-// SetError sets field value
-func (o *TraceStep) SetError(v string) {
- o.Error = v
-}
-
-func (o TraceStep) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if !isNil(o.StartTime) {
- toSerialize["start_time"] = o.StartTime
- }
- if true {
- toSerialize["status"] = o.Status
- }
- if true {
- toSerialize["status_string"] = o.StatusString
- }
- if true {
- toSerialize["duration"] = o.Duration
- }
- if true {
- toSerialize["error"] = o.Error
- }
- return json.Marshal(toSerialize)
-}
-
-type NullableTraceStep struct {
- value *TraceStep
- isSet bool
-}
-
-func (v NullableTraceStep) Get() *TraceStep {
- return v.value
-}
-
-func (v *NullableTraceStep) Set(val *TraceStep) {
- v.value = val
- v.isSet = true
-}
-
-func (v NullableTraceStep) IsSet() bool {
- return v.isSet
-}
-
-func (v *NullableTraceStep) Unset() {
- v.value = nil
- v.isSet = false
-}
-
-func NewNullableTraceStep(val *TraceStep) *NullableTraceStep {
- return &NullableTraceStep{value: val, isSet: true}
-}
-
-func (v NullableTraceStep) MarshalJSON() ([]byte, error) {
- return json.Marshal(v.value)
-}
-
-func (v *NullableTraceStep) UnmarshalJSON(src []byte) error {
- v.isSet = true
- return json.Unmarshal(src, &v.value)
-}
-
-
diff --git a/services/dashboard/main.go b/services/dashboard/main.go
index 4dd0ce21..cc7874db 100644
--- a/services/dashboard/main.go
+++ b/services/dashboard/main.go
@@ -93,7 +93,7 @@ func Run(cleanup cleanupper.Cleanupper) error {
router.Mount("/overview", routes.CreateOverviewPageHandler(
createAPIClient(EP_CORE),
))
- router.Mount("/ingress", routes.CreateIngressPageHandler(
+ router.Mount("/traces", routes.CreateTracesPageHandler(
createAPIClient(EP_CORE),
createAPIClient(EP_TRACING),
createAPIClient(EP_WORKERS),
diff --git a/services/dashboard/routes/ingress.go b/services/dashboard/routes/ingress.go
index a8409c4b..b797a799 100644
--- a/services/dashboard/routes/ingress.go
+++ b/services/dashboard/routes/ingress.go
@@ -2,9 +2,11 @@ package routes
import (
"context"
+ "errors"
"fmt"
- "log"
"net/http"
+ "strconv"
+ "sync"
"time"
"github.com/go-chi/chi/v5"
@@ -13,172 +15,195 @@ import (
"sensorbucket.nl/sensorbucket/internal/web"
"sensorbucket.nl/sensorbucket/pkg/api"
"sensorbucket.nl/sensorbucket/services/dashboard/views"
- "sensorbucket.nl/sensorbucket/services/tracing/tracing"
)
-type IngressPageHandler struct {
+type TracesPageHandler struct {
router chi.Router
coreClient *api.APIClient
- tracingClient *api.APIClient
+ tracesClient *api.APIClient
workersClient *api.APIClient
}
-func CreateIngressPageHandler(core, tracing, workers *api.APIClient) *IngressPageHandler {
- handler := &IngressPageHandler{
+func CreateTracesPageHandler(core, traces, workers *api.APIClient) *TracesPageHandler {
+ handler := &TracesPageHandler{
router: chi.NewRouter(),
coreClient: core,
- tracingClient: tracing,
+ tracesClient: traces,
workersClient: workers,
}
handler.SetupRoutes(handler.router)
return handler
}
-func (h IngressPageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+func (h TracesPageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.router.ServeHTTP(w, r)
}
-func (h *IngressPageHandler) SetupRoutes(r chi.Router) {
- r.Get("/", h.ingressListPage())
- r.Get("/list", h.ingressListPartial())
+func (h *TracesPageHandler) SetupRoutes(r chi.Router) {
+ r.Get("/list", h.listPartial())
}
-func (h *IngressPageHandler) createViewIngresses(ctx context.Context) ([]views.Ingress, error) {
- resIngresses, _, err := h.tracingClient.TracingApi.ListIngresses(ctx).Limit(30).Execute()
- if err != nil {
- return nil, fmt.Errorf("error listing ingresses: %w", err)
- }
- resPipelines, _, err := h.coreClient.PipelinesApi.ListPipelines(ctx).Execute()
- if err != nil {
- return nil, fmt.Errorf("error listing pipelines: %w", err)
- }
+func (h *TracesPageHandler) listPartial() http.HandlerFunc {
+ return func(w http.ResponseWriter, r *http.Request) {
+ req := h.tracesClient.TracingApi.ListTraces(r.Context())
- plSteps := lo.FlatMap(resPipelines.Data, func(p api.Pipeline, _ int) []string { return p.Steps })
- plSteps = lo.Uniq(plSteps)
- resWorkers, _, err := h.workersClient.WorkersApi.ListWorkers(ctx).Id(plSteps).Execute()
- if err != nil {
- return nil, fmt.Errorf("error listing workers: %w", err)
+ if pipelineIDs, ok := r.URL.Query()["pipeline"]; ok {
+ req = req.Pipeline(pipelineIDs)
+ }
+ if limitStr := r.URL.Query().Get("limit"); limitStr != "" {
+ limit, err := strconv.Atoi(limitStr)
+ if err != nil {
+ web.HTTPError(w, err)
+ return
+ }
+ req = req.Limit(int32(limit))
+ }
+
+ traces, _, err := req.Execute()
+ if err != nil {
+ web.HTTPError(w, err)
+ return
+ }
+ viewModels, err := h.createViewData(r.Context(), traces.GetData())
+ if err != nil {
+ web.HTTPError(w, err)
+ return
+ }
+ views.WriteRenderTracesList(w, viewModels)
}
- workerNames := lo.SliceToMap(resWorkers.Data, func(w api.UserWorker) (string, string) {
- return w.GetId(), w.GetName()
- })
+}
- traceIDs := lo.Map(resIngresses.Data, func(ing api.ArchivedIngress, _ int) string { return ing.GetTracingId() })
- traceIDs = lo.Uniq(traceIDs)
- resLogs, _, err := h.tracingClient.TracingApi.ListTraces(ctx).TracingId(traceIDs).Execute()
- if err != nil {
- return nil, fmt.Errorf("error listing traces: %w", err)
+func formatSince(t time.Time) string {
+ d := time.Since(t)
+ if d.Hours() > 24 {
+ return "More than a day ago"
+ }
+ if int(d.Hours()) > 1 {
+ return fmt.Sprintf("About %d hours ago", int(d.Hours()))
+ }
+ if int(d.Hours()) > 0 {
+ return fmt.Sprintf("About %d hours ago", int(d.Hours()))
}
- traceMap := lo.SliceToMap(resLogs.Data, func(steplog api.Trace) (string, api.Trace) {
- return steplog.TracingId, steplog
- })
-
- deviceIDs := lo.FilterMap(resLogs.Data, func(traceLog api.Trace, _ int) (int64, bool) {
- return traceLog.DeviceId, traceLog.DeviceId > 0
- })
- resDevices, _, err := h.coreClient.DevicesApi.ListDevices(ctx).Id(lo.Uniq(deviceIDs)).Execute()
+ if int(d.Minutes()) > 1 {
+ return fmt.Sprintf("About %d minutes ago", int(d.Minutes()))
+ }
+ if int(d.Minutes()) > 0 {
+ return fmt.Sprintf("About %d minute ago", int(d.Minutes()))
+ }
+ return fmt.Sprintf("About %d seconds ago", int(d.Seconds()))
+}
+
+func (h *TracesPageHandler) createViewData(ctx context.Context, traces []api.Trace) ([]views.Trace, error) {
+ deviceIDs := lo.Map(traces, func(trace api.Trace, _ int) int64 { return trace.GetDeviceId() })
+ pipelineIDs := lo.Map(traces, func(trace api.Trace, _ int) string { return trace.GetPipelineId() })
+ workerIDs := lo.FlatMap(traces, func(trace api.Trace, _ int) []string { return trace.GetWorkers() })
+
+ devices, pipelines, workers, err := h.enrichData(ctx, deviceIDs, pipelineIDs, workerIDs)
if err != nil {
- return nil, fmt.Errorf("error listing devices: %w", err)
+ return nil, err
}
- deviceMap := lo.SliceToMap(resDevices.Data, func(device api.Device) (int64, api.Device) {
- return device.Id, device
- })
-
- ingresses := make([]views.Ingress, 0, len(resIngresses.Data))
- for _, ingress := range resIngresses.Data {
- if ingress.IngressDto == nil {
- continue
+
+ viewModels := make([]views.Trace, len(traces))
+ for i, trace := range traces {
+
+ viewModels[i] = views.Trace{
+ ID: trace.GetId(),
+ StartTime: trace.GetStartTime(),
+ TimeAgo: formatSince(trace.GetStartTime()),
+ PipelineID: pipelineIDs[i],
+ DeviceID: deviceIDs[i],
+ Steps: make([]views.Step, 0, len(trace.GetWorkers())),
}
- pl, found := lo.Find(resPipelines.Data, func(pl api.Pipeline) bool {
- return pl.Id == ingress.IngressDto.PipelineId
- })
- if !found {
- continue
+
+ pipeline, ok := pipelines[pipelineIDs[i]]
+ if ok {
+ viewModels[i].PipelineName = pipeline.GetDescription()
}
- traceLog, ok := traceMap[ingress.TracingId]
- if !ok {
- log.Printf("warning: could not find trace for archived ingres: %s\n", ingress.TracingId)
- continue
+ device, ok := devices[deviceIDs[i]]
+ if ok {
+ viewModels[i].DeviceCode = device.GetCode()
}
- viewSteps := []views.IngressStep{
- {
- Label: "Information not available",
- Tooltip: "The pipeline was modified after this message was received, information is not available",
- Status: int(tracing.Unknown),
- },
- }
- if len(traceLog.Steps) != len(pl.Steps) {
- // The default viewSteps array above already has an "error" set by default.
- // If we can show all the steps, then the whole array is overwritten. See the next "else"
- log.Printf(
- "warning: pipeline has %d steps, but log only has %d. Pipeline has probably been modified after this ingress. Showing no steps...\n",
- len(pl.Steps),
- len(traceLog.Steps),
- )
- } else {
- // TODO: This currently requires that there are an equal number of StepDTO's and Pipeline Steps
- // In the future pipelines will have revisions and are not directly mutable, thus this should always be equal
- viewSteps = lo.Map(pl.Steps, func(stepKey string, ix int) views.IngressStep {
- step := traceLog.Steps[ix]
- stepName := stepKey
- if workerName, ok := workerNames[stepName]; ok {
- stepName = workerName
- }
- viewStep := views.IngressStep{
- Label: stepName,
- Status: int(step.Status),
- }
- if step.Error != "" {
- viewStep.Tooltip = step.Error
- } else if step.Duration != 0 {
- viewStep.Tooltip = time.Duration(step.Duration * float64(time.Second)).String()
- } else if step.Status == 3 || viewStep.Status == 4 {
- viewStep.Tooltip = "<1s"
- }
- return viewStep
- })
+ // First add all workers from the trace to the viewModel
+ workerIndex := 0
+ for j, workerID := range trace.GetWorkers() {
+ step := views.Step{
+ Name: workerID,
+ Status: views.StatusCompleted,
+ }
+ worker, ok := workers[workerID]
+ if ok {
+ step.Name = worker.GetName()
+ }
+ viewModels[i].Steps = append(viewModels[i].Steps, step)
+
+ // update last worker with duration
+ if j > 0 {
+ viewModels[i].Steps[j-1].Label = trace.WorkerTimes[j].Sub(trace.WorkerTimes[j-1]).String()
+ }
+
+ workerIndex++
}
- ingress := views.Ingress{
- TracingID: ingress.TracingId,
- CreatedAt: ingress.IngressDto.CreatedAt,
- Steps: viewSteps,
+ // Set the last trace to pending, unless its storage
+ if workerIndex > 0 && trace.HasError() {
+ viewModels[i].Steps[workerIndex-1].Status = views.StatusError
+ viewModels[i].Steps[workerIndex-1].Label = trace.GetError()
+ } else if workerIndex > 0 && trace.Workers[workerIndex-1] != "storage" {
+ viewModels[i].Steps[workerIndex-1].Status = views.StatusPending
}
- if traceLog.DeviceId != 0 {
- ingress.Device = deviceMap[traceLog.DeviceId]
+
+ // Then add all the workers from the pipeline to the model, starting from the last added worker
+ for ; workerIndex < len(pipeline.Steps); workerIndex++ {
+ workerID := pipeline.Steps[workerIndex]
+ step := views.Step{
+ Name: workerID,
+ }
+ worker, ok := workers[workerID]
+ if ok {
+ step.Name = worker.GetName()
+ }
+ viewModels[i].Steps = append(viewModels[i].Steps, step)
}
- ingresses = append(ingresses, ingress)
}
- return ingresses, nil
+ return viewModels, nil
}
-func (h *IngressPageHandler) ingressListPage() http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- ingresses, err := h.createViewIngresses(r.Context())
+func (h *TracesPageHandler) enrichData(ctx context.Context, deviceIDs []int64, pipelineIDs, workerIDs []string) (
+ devices map[int64]api.Device, pipelines map[string]api.Pipeline, workers map[string]api.UserWorker, err error,
+) {
+ errs := make([]error, 3)
+
+ var wg sync.WaitGroup
+ wg.Add(2)
+ go func() {
+ defer wg.Done()
+ res, _, err := h.coreClient.DevicesApi.ListDevices(ctx).Id(deviceIDs).Execute()
if err != nil {
- web.HTTPError(w, err)
+ errs[0] = err
return
}
- page := &views.IngressPage{
- BasePage: createBasePage(r),
- Ingresses: ingresses,
- }
- if isHX(r) {
- page.WriteBody(w)
+ devices = lo.KeyBy(res.GetData(), func(d api.Device) int64 { return d.GetId() })
+ }()
+ go func() {
+ defer wg.Done()
+ res, _, err := h.coreClient.PipelinesApi.ListPipelines(ctx).Id(pipelineIDs).Execute()
+ if err != nil {
+ errs[1] = err
return
}
- views.WriteIndex(w, page)
- }
-}
+ pipelines = lo.KeyBy(res.GetData(), func(p api.Pipeline) string { return p.GetId() })
+ workerIDs = append(workerIDs, lo.FlatMap(res.GetData(), func(p api.Pipeline, _ int) []string { return p.GetSteps() })...)
-func (h *IngressPageHandler) ingressListPartial() http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- ingresses, err := h.createViewIngresses(r.Context())
+ wRes, _, err := h.workersClient.WorkersApi.ListWorkers(ctx).Id(workerIDs).Execute()
if err != nil {
- web.HTTPError(w, err)
+ errs[2] = err
return
}
- views.WriteRenderIngressList(w, ingresses)
- }
+ workers = lo.KeyBy(wRes.GetData(), func(w api.UserWorker) string { return w.GetId() })
+ }()
+
+ wg.Wait()
+ err = errors.Join(errs...)
+ return
}
diff --git a/services/dashboard/routes/pipelines.go b/services/dashboard/routes/pipelines.go
index f52d19f4..d00efec3 100644
--- a/services/dashboard/routes/pipelines.go
+++ b/services/dashboard/routes/pipelines.go
@@ -2,11 +2,11 @@ package routes
import (
"context"
- "encoding/json"
"errors"
"fmt"
+ "io"
+ "log"
"net/http"
- "strconv"
"github.com/go-chi/chi/v5"
"github.com/ory/nosurf"
@@ -114,6 +114,12 @@ func (h *PipelinePageHandler) createPipeline() http.HandlerFunc {
}
if resp.StatusCode != http.StatusCreated {
+ responseBody, err := io.ReadAll(resp.Body)
+ if err != nil {
+ log.Printf("in createPipeline, err reading response body: %s\n", err)
+ } else {
+ log.Printf("in createPipeline, err: %s\n", string(responseBody))
+ }
layout.SnackbarSomethingWentWrong(w)
return
}
@@ -234,6 +240,12 @@ func (h *PipelinePageHandler) updatePipeline(next http.Handler) http.Handler {
_, resp, err := h.coreClient.PipelinesApi.UpdatePipeline(r.Context(), pipelineId).UpdatePipelineRequest(updateDto).Execute()
if err != nil {
+ responseBody, err := io.ReadAll(resp.Body)
+ if err != nil {
+ log.Printf("in createPipeline, err reading response body: %s\n", err)
+ } else {
+ log.Printf("in createPipeline, err: %s\n", string(responseBody))
+ }
layout.SnackbarSomethingWentWrong(w)
return
}
@@ -241,6 +253,12 @@ func (h *PipelinePageHandler) updatePipeline(next http.Handler) http.Handler {
// TODO: API returns status created instead of found for some reason
if resp.StatusCode != http.StatusCreated {
if resp.StatusCode == http.StatusInternalServerError {
+ responseBody, err := io.ReadAll(resp.Body)
+ if err != nil {
+ log.Printf("in createPipeline, err reading response body: %s\n", err)
+ } else {
+ log.Printf("in createPipeline, err: %s\n", string(responseBody))
+ }
layout.SnackbarSomethingWentWrong(w)
} else {
var apierror *web.APIError
@@ -285,52 +303,19 @@ func (h *PipelinePageHandler) validatePipelineSteps(next http.Handler) http.Hand
return
}
- if len(steps) != 1 {
- layout.SnackbarSomethingWentWrong(w)
- return
- }
-
- stepMap := map[string][]string{}
- err = json.Unmarshal([]byte(steps[0]), &stepMap)
- if err != nil {
- layout.WithSnackbarError(w, "Invalid steps")
- w.WriteHeader(http.StatusBadRequest)
- return
- }
-
- if len(stepMap) == 0 {
- layout.WithSnackbarError(w, "No steps provided")
+ if len(steps) == 0 {
+ layout.WithSnackbarError(w, "expected single step")
w.WriteHeader(http.StatusBadRequest)
return
}
- newOrder := make([]string, len(stepMap))
- for key, val := range stepMap {
- if len(val) != 1 {
- layout.WithSnackbarError(w, "Duplicate workers are not allowed")
- w.WriteHeader(http.StatusBadRequest)
- return
- }
+ steps = fixStorageStep(steps)
- ix, err := strconv.Atoi(val[0])
- if err != nil {
- layout.WithSnackbarError(w, fmt.Sprintf("Invalid input: %s is not a number", val[0]))
- w.WriteHeader(http.StatusBadRequest)
- return
- }
- if ix >= len(newOrder) || ix < 0 {
- layout.WithSnackbarError(w, fmt.Sprintf("Invalid input: %d is out of bounds", ix))
- w.WriteHeader(http.StatusBadRequest)
- return
- }
- newOrder[ix] = key
- }
-
- newOrder = fixStorageStep(newOrder)
-
- allWorkers, err := h.getWorkersForSteps(r, newOrder)
+ allWorkers, err := h.getWorkersForSteps(r, steps)
if err != nil {
- layout.SnackbarSomethingWentWrong(w)
+ log.Printf("failed to get workers for step: %s\n", err.Error())
+ layout.WithSnackbarError(w, "Failed to get workers for step")
+ w.WriteHeader(http.StatusBadRequest)
return
}
diff --git a/services/dashboard/static/style.css b/services/dashboard/static/style.css
index 32059b89..07554034 100644
--- a/services/dashboard/static/style.css
+++ b/services/dashboard/static/style.css
@@ -931,6 +931,10 @@ video {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
+.grid-cols-\[max-content\2c 1fr\2c max-content\] {
+ grid-template-columns: max-content 1fr max-content;
+}
+
.flex-col {
flex-direction: column;
}
@@ -1005,6 +1009,10 @@ video {
align-self: center;
}
+.justify-self-center {
+ justify-self: center;
+}
+
.overflow-y-auto {
overflow-y: auto;
}
@@ -1229,6 +1237,11 @@ video {
background-color: rgb(254 202 202 / var(--tw-bg-opacity));
}
+.bg-red-300 {
+ --tw-bg-opacity: 1;
+ background-color: rgb(252 165 165 / var(--tw-bg-opacity));
+}
+
.bg-red-400 {
--tw-bg-opacity: 1;
background-color: rgb(248 113 113 / var(--tw-bg-opacity));
@@ -1341,6 +1354,10 @@ video {
text-align: left;
}
+.text-center {
+ text-align: center;
+}
+
.align-middle {
vertical-align: middle;
}
diff --git a/services/dashboard/views/ingressPage.qtpl b/services/dashboard/views/ingressPage.qtpl
deleted file mode 100644
index 63769741..00000000
--- a/services/dashboard/views/ingressPage.qtpl
+++ /dev/null
@@ -1,93 +0,0 @@
-{% import "time" %}
-{% import "sensorbucket.nl/sensorbucket/pkg/api" %}
-{% func (p *IngressPage) Body() %}
-
-
- Incoming data and processing statusses
-
-
- {%= RenderIngressList(p.Ingresses) %}
-
-
-{% endfunc %}
-
-{% func RenderIngressList(ingresses []Ingress) %}
-{% for _, ingress := range ingresses %}
-
-
- {%s ingress.TracingID %}
-
-
{%s ingress.CreatedAt.Format("15:04:05 2006-01-02") %}
- {% if ingress.Device.Id != 0 %}
-
{%s ingress.Device.Code %}
- {% endif %}
-
-
-
-
- {% for _, step := range ingress.Steps %}
- -
- {%s step.Label %}
- {% switch step.Status %}
- {% case 3 %}
-
- {% case 4 %}
-
- {% case 5 %}
-
- {% default %}
-
- {% endswitch %}
- {% if step.Tooltip != "" %}
-
- {%s step.Tooltip %}
-
- {% endif %}
-
- {% endfor %}
-
-
-
-
-{% endfor %}
-{% endfunc %}
-
-{% code
-type IngressPage struct {
- BasePage
- Ingresses []Ingress
-}
-
-type IngressStep struct {
- Label string
- Status int
- Tooltip string
-}
-
-type Ingress struct {
- TracingID string
- CreatedAt time.Time
- Steps []IngressStep
- Device api.Device
-}
-%}
diff --git a/services/dashboard/views/ingressPage.qtpl.go b/services/dashboard/views/ingressPage.qtpl.go
deleted file mode 100644
index e482f43a..00000000
--- a/services/dashboard/views/ingressPage.qtpl.go
+++ /dev/null
@@ -1,283 +0,0 @@
-// Code generated by qtc from "ingressPage.qtpl". DO NOT EDIT.
-// See https://github.com/valyala/quicktemplate for details.
-
-//line views/ingressPage.qtpl:1
-package views
-
-//line views/ingressPage.qtpl:1
-import "time"
-
-//line views/ingressPage.qtpl:2
-import "sensorbucket.nl/sensorbucket/pkg/api"
-
-//line views/ingressPage.qtpl:3
-import (
- qtio422016 "io"
-
- qt422016 "github.com/valyala/quicktemplate"
-)
-
-//line views/ingressPage.qtpl:3
-var (
- _ = qtio422016.Copy
- _ = qt422016.AcquireByteBuffer
-)
-
-//line views/ingressPage.qtpl:3
-func (p *IngressPage) StreamBody(qw422016 *qt422016.Writer) {
-//line views/ingressPage.qtpl:3
- qw422016.N().S(`
-
-
- Incoming data and processing statusses
-
-
- `)
-//line views/ingressPage.qtpl:14
- StreamRenderIngressList(qw422016, p.Ingresses)
-//line views/ingressPage.qtpl:14
- qw422016.N().S(`
-
-
-`)
-//line views/ingressPage.qtpl:17
-}
-
-//line views/ingressPage.qtpl:17
-func (p *IngressPage) WriteBody(qq422016 qtio422016.Writer) {
-//line views/ingressPage.qtpl:17
- qw422016 := qt422016.AcquireWriter(qq422016)
-//line views/ingressPage.qtpl:17
- p.StreamBody(qw422016)
-//line views/ingressPage.qtpl:17
- qt422016.ReleaseWriter(qw422016)
-//line views/ingressPage.qtpl:17
-}
-
-//line views/ingressPage.qtpl:17
-func (p *IngressPage) Body() string {
-//line views/ingressPage.qtpl:17
- qb422016 := qt422016.AcquireByteBuffer()
-//line views/ingressPage.qtpl:17
- p.WriteBody(qb422016)
-//line views/ingressPage.qtpl:17
- qs422016 := string(qb422016.B)
-//line views/ingressPage.qtpl:17
- qt422016.ReleaseByteBuffer(qb422016)
-//line views/ingressPage.qtpl:17
- return qs422016
-//line views/ingressPage.qtpl:17
-}
-
-//line views/ingressPage.qtpl:19
-func StreamRenderIngressList(qw422016 *qt422016.Writer, ingresses []Ingress) {
-//line views/ingressPage.qtpl:19
- qw422016.N().S(`
-`)
-//line views/ingressPage.qtpl:20
- for _, ingress := range ingresses {
-//line views/ingressPage.qtpl:20
- qw422016.N().S(`
-
-
- `)
-//line views/ingressPage.qtpl:23
- qw422016.E().S(ingress.TracingID)
-//line views/ingressPage.qtpl:23
- qw422016.N().S(`
-
-
`)
-//line views/ingressPage.qtpl:25
- qw422016.E().S(ingress.CreatedAt.Format("15:04:05 2006-01-02"))
-//line views/ingressPage.qtpl:25
- qw422016.N().S(`
- `)
-//line views/ingressPage.qtpl:26
- if ingress.Device.Id != 0 {
-//line views/ingressPage.qtpl:26
- qw422016.N().S(`
-
`)
-//line views/ingressPage.qtpl:27
- qw422016.E().S(ingress.Device.Code)
-//line views/ingressPage.qtpl:27
- qw422016.N().S(`
- `)
-//line views/ingressPage.qtpl:28
- }
-//line views/ingressPage.qtpl:28
- qw422016.N().S(`
-
-
-
-
-`)
-//line views/ingressPage.qtpl:72
- }
-//line views/ingressPage.qtpl:72
- qw422016.N().S(`
-`)
-//line views/ingressPage.qtpl:73
-}
-
-//line views/ingressPage.qtpl:73
-func WriteRenderIngressList(qq422016 qtio422016.Writer, ingresses []Ingress) {
-//line views/ingressPage.qtpl:73
- qw422016 := qt422016.AcquireWriter(qq422016)
-//line views/ingressPage.qtpl:73
- StreamRenderIngressList(qw422016, ingresses)
-//line views/ingressPage.qtpl:73
- qt422016.ReleaseWriter(qw422016)
-//line views/ingressPage.qtpl:73
-}
-
-//line views/ingressPage.qtpl:73
-func RenderIngressList(ingresses []Ingress) string {
-//line views/ingressPage.qtpl:73
- qb422016 := qt422016.AcquireByteBuffer()
-//line views/ingressPage.qtpl:73
- WriteRenderIngressList(qb422016, ingresses)
-//line views/ingressPage.qtpl:73
- qs422016 := string(qb422016.B)
-//line views/ingressPage.qtpl:73
- qt422016.ReleaseByteBuffer(qb422016)
-//line views/ingressPage.qtpl:73
- return qs422016
-//line views/ingressPage.qtpl:73
-}
-
-//line views/ingressPage.qtpl:76
-type IngressPage struct {
- BasePage
- Ingresses []Ingress
-}
-
-type IngressStep struct {
- Label string
- Status int
- Tooltip string
-}
-
-type Ingress struct {
- TracingID string
- CreatedAt time.Time
- Steps []IngressStep
- Device api.Device
-}
diff --git a/services/dashboard/views/layout.qtpl b/services/dashboard/views/layout.qtpl
index 8f0e1ae6..88c4ae6b 100644
--- a/services/dashboard/views/layout.qtpl
+++ b/services/dashboard/views/layout.qtpl
@@ -8,7 +8,6 @@ type NavItem struct {
var topNavItems = []NavItem{
{Label: "Overview", URL: "/", Icon: "material-symbols:home-outline-rounded" },
- {Label: "Ingress", URL: "/ingress", Icon: "mdi:latest" },
{Label: "Workers", URL: "/workers", Icon: "uil:box" },
{Label: "Pipelines", URL: "/pipelines", Icon:"mdi:pipe"},
}
diff --git a/services/dashboard/views/layout.qtpl.go b/services/dashboard/views/layout.qtpl.go
index 738210a1..586cb1e5 100644
--- a/services/dashboard/views/layout.qtpl.go
+++ b/services/dashboard/views/layout.qtpl.go
@@ -29,7 +29,6 @@ type NavItem struct {
var topNavItems = []NavItem{
{Label: "Overview", URL: "/", Icon: "material-symbols:home-outline-rounded"},
- {Label: "Ingress", URL: "/ingress", Icon: "mdi:latest"},
{Label: "Workers", URL: "/workers", Icon: "uil:box"},
{Label: "Pipelines", URL: "/pipelines", Icon: "mdi:pipe"},
}
@@ -38,71 +37,102 @@ var bottomNavItems = []NavItem{
{Label: "Settings", URL: "/tenants/auth/settings", Icon: "bi:person-fill-gear"},
}
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
type Page interface {
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
Title() string
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
StreamTitle(qw422016 *qt422016.Writer)
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
WriteTitle(qq422016 qtio422016.Writer)
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
Header() string
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
StreamHeader(qw422016 *qt422016.Writer)
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
WriteHeader(qq422016 qtio422016.Writer)
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
Body() string
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
StreamBody(qw422016 *qt422016.Writer)
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
WriteBody(qq422016 qtio422016.Writer)
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
Footer() string
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
StreamFooter(qw422016 *qt422016.Writer)
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
WriteFooter(qq422016 qtio422016.Writer)
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
RenderFlashMessages() string
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
StreamRenderFlashMessages(qw422016 *qt422016.Writer)
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
WriteRenderFlashMessages(qq422016 qtio422016.Writer)
-//line views/layout.qtpl:22
+//line views/layout.qtpl:21
}
-//line views/layout.qtpl:32
+//line views/layout.qtpl:31
type BasePage struct {
CSRFToken string
flash_messages.FlashMessagesContainer
}
-//line views/layout.qtpl:37
+//line views/layout.qtpl:36
func (p *BasePage) StreamTitle(qw422016 *qt422016.Writer) {
-//line views/layout.qtpl:37
+//line views/layout.qtpl:36
qw422016.N().S(`This is a base title`)
+//line views/layout.qtpl:36
+}
+
+//line views/layout.qtpl:36
+func (p *BasePage) WriteTitle(qq422016 qtio422016.Writer) {
+//line views/layout.qtpl:36
+ qw422016 := qt422016.AcquireWriter(qq422016)
+//line views/layout.qtpl:36
+ p.StreamTitle(qw422016)
+//line views/layout.qtpl:36
+ qt422016.ReleaseWriter(qw422016)
+//line views/layout.qtpl:36
+}
+
+//line views/layout.qtpl:36
+func (p *BasePage) Title() string {
+//line views/layout.qtpl:36
+ qb422016 := qt422016.AcquireByteBuffer()
+//line views/layout.qtpl:36
+ p.WriteTitle(qb422016)
+//line views/layout.qtpl:36
+ qs422016 := string(qb422016.B)
+//line views/layout.qtpl:36
+ qt422016.ReleaseByteBuffer(qb422016)
+//line views/layout.qtpl:36
+ return qs422016
+//line views/layout.qtpl:36
+}
+
+//line views/layout.qtpl:37
+func (p *BasePage) StreamHeader(qw422016 *qt422016.Writer) {
//line views/layout.qtpl:37
}
//line views/layout.qtpl:37
-func (p *BasePage) WriteTitle(qq422016 qtio422016.Writer) {
+func (p *BasePage) WriteHeader(qq422016 qtio422016.Writer) {
//line views/layout.qtpl:37
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/layout.qtpl:37
- p.StreamTitle(qw422016)
+ p.StreamHeader(qw422016)
//line views/layout.qtpl:37
qt422016.ReleaseWriter(qw422016)
//line views/layout.qtpl:37
}
//line views/layout.qtpl:37
-func (p *BasePage) Title() string {
+func (p *BasePage) Header() string {
//line views/layout.qtpl:37
qb422016 := qt422016.AcquireByteBuffer()
//line views/layout.qtpl:37
- p.WriteTitle(qb422016)
+ p.WriteHeader(qb422016)
//line views/layout.qtpl:37
qs422016 := string(qb422016.B)
//line views/layout.qtpl:37
@@ -113,27 +143,29 @@ func (p *BasePage) Title() string {
}
//line views/layout.qtpl:38
-func (p *BasePage) StreamHeader(qw422016 *qt422016.Writer) {
+func (p *BasePage) StreamBody(qw422016 *qt422016.Writer) {
+//line views/layout.qtpl:38
+ qw422016.N().S(`Page has no body`)
//line views/layout.qtpl:38
}
//line views/layout.qtpl:38
-func (p *BasePage) WriteHeader(qq422016 qtio422016.Writer) {
+func (p *BasePage) WriteBody(qq422016 qtio422016.Writer) {
//line views/layout.qtpl:38
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/layout.qtpl:38
- p.StreamHeader(qw422016)
+ p.StreamBody(qw422016)
//line views/layout.qtpl:38
qt422016.ReleaseWriter(qw422016)
//line views/layout.qtpl:38
}
//line views/layout.qtpl:38
-func (p *BasePage) Header() string {
+func (p *BasePage) Body() string {
//line views/layout.qtpl:38
qb422016 := qt422016.AcquireByteBuffer()
//line views/layout.qtpl:38
- p.WriteHeader(qb422016)
+ p.WriteBody(qb422016)
//line views/layout.qtpl:38
qs422016 := string(qb422016.B)
//line views/layout.qtpl:38
@@ -144,29 +176,27 @@ func (p *BasePage) Header() string {
}
//line views/layout.qtpl:39
-func (p *BasePage) StreamBody(qw422016 *qt422016.Writer) {
-//line views/layout.qtpl:39
- qw422016.N().S(`Page has no body`)
+func (p *BasePage) StreamFooter(qw422016 *qt422016.Writer) {
//line views/layout.qtpl:39
}
//line views/layout.qtpl:39
-func (p *BasePage) WriteBody(qq422016 qtio422016.Writer) {
+func (p *BasePage) WriteFooter(qq422016 qtio422016.Writer) {
//line views/layout.qtpl:39
qw422016 := qt422016.AcquireWriter(qq422016)
//line views/layout.qtpl:39
- p.StreamBody(qw422016)
+ p.StreamFooter(qw422016)
//line views/layout.qtpl:39
qt422016.ReleaseWriter(qw422016)
//line views/layout.qtpl:39
}
//line views/layout.qtpl:39
-func (p *BasePage) Body() string {
+func (p *BasePage) Footer() string {
//line views/layout.qtpl:39
qb422016 := qt422016.AcquireByteBuffer()
//line views/layout.qtpl:39
- p.WriteBody(qb422016)
+ p.WriteFooter(qb422016)
//line views/layout.qtpl:39
qs422016 := string(qb422016.B)
//line views/layout.qtpl:39
@@ -177,78 +207,47 @@ func (p *BasePage) Body() string {
}
//line views/layout.qtpl:40
-func (p *BasePage) StreamFooter(qw422016 *qt422016.Writer) {
-//line views/layout.qtpl:40
-}
-
-//line views/layout.qtpl:40
-func (p *BasePage) WriteFooter(qq422016 qtio422016.Writer) {
-//line views/layout.qtpl:40
- qw422016 := qt422016.AcquireWriter(qq422016)
-//line views/layout.qtpl:40
- p.StreamFooter(qw422016)
-//line views/layout.qtpl:40
- qt422016.ReleaseWriter(qw422016)
-//line views/layout.qtpl:40
-}
-
-//line views/layout.qtpl:40
-func (p *BasePage) Footer() string {
-//line views/layout.qtpl:40
- qb422016 := qt422016.AcquireByteBuffer()
-//line views/layout.qtpl:40
- p.WriteFooter(qb422016)
-//line views/layout.qtpl:40
- qs422016 := string(qb422016.B)
-//line views/layout.qtpl:40
- qt422016.ReleaseByteBuffer(qb422016)
-//line views/layout.qtpl:40
- return qs422016
-//line views/layout.qtpl:40
-}
-
-//line views/layout.qtpl:41
func (p *BasePage) StreamRenderFlashMessages(qw422016 *qt422016.Writer) {
-//line views/layout.qtpl:41
+//line views/layout.qtpl:40
qw422016.N().S(`
`)
-//line views/layout.qtpl:42
+//line views/layout.qtpl:41
p.FlashMessagesContainer.StreamRender(qw422016)
-//line views/layout.qtpl:42
+//line views/layout.qtpl:41
qw422016.N().S(`
`)
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
}
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
func (p *BasePage) WriteRenderFlashMessages(qq422016 qtio422016.Writer) {
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
qw422016 := qt422016.AcquireWriter(qq422016)
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
p.StreamRenderFlashMessages(qw422016)
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
qt422016.ReleaseWriter(qw422016)
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
}
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
func (p *BasePage) RenderFlashMessages() string {
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
qb422016 := qt422016.AcquireByteBuffer()
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
p.WriteRenderFlashMessages(qb422016)
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
qs422016 := string(qb422016.B)
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
qt422016.ReleaseByteBuffer(qb422016)
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
return qs422016
-//line views/layout.qtpl:43
+//line views/layout.qtpl:42
}
-//line views/layout.qtpl:45
+//line views/layout.qtpl:44
func StreamIndex(qw422016 *qt422016.Writer, page Page) {
-//line views/layout.qtpl:45
+//line views/layout.qtpl:44
qw422016.N().S(`
@@ -258,14 +257,14 @@ func StreamIndex(qw422016 *qt422016.Writer, page Page) {
`)
-//line views/layout.qtpl:54
+//line views/layout.qtpl:53
streamdebugHeaders(qw422016)
-//line views/layout.qtpl:54
+//line views/layout.qtpl:53
qw422016.N().S(`
`)
-//line views/layout.qtpl:134
+//line views/layout.qtpl:133
page.StreamHeader(qw422016)
-//line views/layout.qtpl:134
+//line views/layout.qtpl:133
qw422016.N().S(`
@@ -385,22 +384,22 @@ func StreamIndex(qw422016 *qt422016.Writer, page Page) {
`)
-//line views/layout.qtpl:160
+//line views/layout.qtpl:159
page.StreamRenderFlashMessages(qw422016)
-//line views/layout.qtpl:160
+//line views/layout.qtpl:159
qw422016.N().S(`