Skip to content

Commit d8b0bcf

Browse files
authored
Rename diagnostic UI
1 parent 48bfd20 commit d8b0bcf

26 files changed

+62
-55
lines changed

backend/redis/diagnostics.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import (
55
"encoding/json"
66
"fmt"
77

8-
"github.com/cschleiden/go-workflows/web"
8+
"github.com/cschleiden/go-workflows/diag"
99
"github.com/go-redis/redis/v8"
1010
)
1111

12-
var _ web.Backend = (*redisBackend)(nil)
12+
var _ diag.Backend = (*redisBackend)(nil)
1313

14-
func (rb *redisBackend) GetWorkflowInstances(ctx context.Context, afterInstanceID string, count int) ([]*web.WorkflowInstanceRef, error) {
14+
func (rb *redisBackend) GetWorkflowInstances(ctx context.Context, afterInstanceID string, count int) ([]*diag.WorkflowInstanceRef, error) {
1515
max := "+inf"
1616

1717
if afterInstanceID != "" {
@@ -51,14 +51,14 @@ func (rb *redisBackend) GetWorkflowInstances(ctx context.Context, afterInstanceI
5151
return nil, fmt.Errorf("getting instances: %w", err)
5252
}
5353

54-
var instanceRefs []*web.WorkflowInstanceRef
54+
var instanceRefs []*diag.WorkflowInstanceRef
5555
for _, instance := range instances {
5656
var state instanceState
5757
if err := json.Unmarshal([]byte(instance.(string)), &state); err != nil {
5858
return nil, fmt.Errorf("unmarshaling instance state: %w", err)
5959
}
6060

61-
instanceRefs = append(instanceRefs, &web.WorkflowInstanceRef{
61+
instanceRefs = append(instanceRefs, &diag.WorkflowInstanceRef{
6262
Instance: state.Instance,
6363
CreatedAt: state.CreatedAt,
6464
CompletedAt: state.CompletedAt,
@@ -69,13 +69,13 @@ func (rb *redisBackend) GetWorkflowInstances(ctx context.Context, afterInstanceI
6969
return instanceRefs, nil
7070
}
7171

72-
func (rb *redisBackend) GetWorkflowInstance(ctx context.Context, instanceID string) (*web.WorkflowInstanceRef, error) {
72+
func (rb *redisBackend) GetWorkflowInstance(ctx context.Context, instanceID string) (*diag.WorkflowInstanceRef, error) {
7373
instance, err := readInstance(ctx, rb.rdb, instanceID)
7474
if err != nil {
7575
return nil, err
7676
}
7777

78-
return &web.WorkflowInstanceRef{
78+
return &diag.WorkflowInstanceRef{
7979
Instance: instance.Instance,
8080
CreatedAt: instance.CreatedAt,
8181
CompletedAt: instance.CompletedAt,

backend/sqlite/diagnostics.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import (
66
"time"
77

88
"github.com/cschleiden/go-workflows/backend"
9+
"github.com/cschleiden/go-workflows/diag"
910
"github.com/cschleiden/go-workflows/internal/core"
10-
"github.com/cschleiden/go-workflows/web"
1111
)
1212

13-
var _ web.Backend = (*sqliteBackend)(nil)
13+
var _ diag.Backend = (*sqliteBackend)(nil)
1414

15-
func (sb *sqliteBackend) GetWorkflowInstances(ctx context.Context, afterInstanceID string, count int) ([]*web.WorkflowInstanceRef, error) {
15+
func (sb *sqliteBackend) GetWorkflowInstances(ctx context.Context, afterInstanceID string, count int) ([]*diag.WorkflowInstanceRef, error) {
1616
var err error
1717
tx, err := sb.db.BeginTx(ctx, nil)
1818
if err != nil {
@@ -47,7 +47,7 @@ func (sb *sqliteBackend) GetWorkflowInstances(ctx context.Context, afterInstance
4747
return nil, err
4848
}
4949

50-
var instances []*web.WorkflowInstanceRef
50+
var instances []*diag.WorkflowInstanceRef
5151

5252
for rows.Next() {
5353
var id, executionID string
@@ -63,7 +63,7 @@ func (sb *sqliteBackend) GetWorkflowInstances(ctx context.Context, afterInstance
6363
state = backend.WorkflowStateFinished
6464
}
6565

66-
instances = append(instances, &web.WorkflowInstanceRef{
66+
instances = append(instances, &diag.WorkflowInstanceRef{
6767
Instance: core.NewWorkflowInstance(id, executionID),
6868
CreatedAt: createdAt,
6969
CompletedAt: completedAt,
@@ -74,7 +74,7 @@ func (sb *sqliteBackend) GetWorkflowInstances(ctx context.Context, afterInstance
7474
return instances, nil
7575
}
7676

77-
func (sb *sqliteBackend) GetWorkflowInstance(ctx context.Context, instanceID string) (*web.WorkflowInstanceRef, error) {
77+
func (sb *sqliteBackend) GetWorkflowInstance(ctx context.Context, instanceID string) (*diag.WorkflowInstanceRef, error) {
7878
tx, err := sb.db.BeginTx(ctx, nil)
7979
if err != nil {
8080
return nil, err
@@ -101,7 +101,7 @@ func (sb *sqliteBackend) GetWorkflowInstance(ctx context.Context, instanceID str
101101
state = backend.WorkflowStateFinished
102102
}
103103

104-
return &web.WorkflowInstanceRef{
104+
return &diag.WorkflowInstanceRef{
105105
Instance: core.NewWorkflowInstance(id, executionID),
106106
CreatedAt: createdAt,
107107
CompletedAt: completedAt,
File renamed without changes.

web/app/README.md renamed to diag/app/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Diagnostic Web UI
1+
# Diagnostic Web App
22

33
This is a basic diagnostic web UI. It's written as a small React application, bootstrapped with create-react-app, which is then embedded in its compiled form with Go `embed` into the binary.
44

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)