Skip to content

Commit cae8a6d

Browse files
committed
Migrate project repository from stateforward to runpod
1 parent b0032f7 commit cae8a6d

File tree

8 files changed

+32
-25
lines changed

8 files changed

+32
-25
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# go-hsm [![PkgGoDev](https://pkg.go.dev/badge/github.com/stateforward/go-hsm)](https://pkg.go.dev/github.com/stateforward/go-hsm)
1+
# hsm [![PkgGoDev](https://pkg.go.dev/badge/github.com/runpod/hsm)](https://pkg.go.dev/github.com/runpod/hsm)
22

33
> **Warning**
44
> This package is currently in alpha stage. While it has test coverage, the API is subject to breaking changes between minor versions until we reach v1.0.0. Please pin your dependencies to specific versions.
@@ -8,7 +8,7 @@ Package go-hsm provides a powerful hierarchical state machine (HSM) implementati
88
## Installation
99

1010
```bash
11-
go get github.com/stateforward/go-hsm
11+
go get github.com/runpod/hsm
1212
```
1313

1414
## Key Features

diagram.puml

+13-12
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,44 @@
55
state s.s1.s11{
66
}
77
state s.s1.s11: entry / entry
8-
state s.s1.s11: activity / activity
8+
state s.s1.s11: activities activity
99
state s.s1.s11: exit / exit
1010
[*] ----> s.s1.s11 : / effect
1111
}
1212
state s.s1: entry / entry
13-
state s.s1: activity / activity
13+
state s.s1: activities activity
1414
state s.s1: exit / exit
1515
state s.s2{
1616
state s.s2.s21{
1717
state s.s2.s21.s211
1818
state s.s2.s21.s211: entry / entry
19-
state s.s2.s21.s211: activity / activity
19+
state s.s2.s21.s211: activities activity, s211.after
2020
state s.s2.s21.s211: exit / exit
2121
[*] ----> s.s2.s21.s211 : / effect
2222
}
2323
state s.s2.s21: entry / entry
24-
state s.s2.s21: activity / activity
24+
state s.s2.s21: activities activity
2525
state s.s2.s21: exit / exit
2626
[*] ----> s.s2.s21.s211 : / effect
2727
}
2828
state s.s2: entry / entry
29-
state s.s2: activity / activity
29+
state s.s2: activities activity
3030
state s.s2: exit / exit
3131
state s.s3
3232
state s.s3: entry / entry
33-
state s.s3: activity / activity
33+
state s.s3: activities activity
3434
state s.s3: exit / exit
3535
[*] ----> s.s1.s11 : / effect
3636
}
3737
state s: entry / entry
38-
state s: activity / activity
38+
state s: activities activity
3939
state s: exit / exit
40-
state s.s1.s11.choice_46 <<choice>>
40+
state s.s1.s11.choice_47 <<choice>>
4141
state t
4242
[*] ----> initial_choice : / effect
4343
initial_choice ----> s.s2
44-
s.s1.s11.choice_46 ----> s.s1 : [guard]
45-
s.s1.s11.choice_46 ----> s.s2 : / effect
44+
s.s1.s11.choice_47 ----> s.s1 : [guard]
45+
s.s1.s11.choice_47 ----> s.s2 : / effect
4646
state s.s1 : I / effect
4747
s.s1 ----> s.s1 : A / effect
4848
state s.s1 : 0
@@ -58,7 +58,8 @@ s ----> s.s1.s11 : E / effect
5858
s.s1.s11 ----> s.s2.s21.s211 : G / effect
5959
state s : I [guard] / effect
6060
s.s2.s21.s211 ----> s.s1.s11 : s211.after [guard] / effect
61-
s.s1.s11 ----> s.s1.s11.choice_46 : H / effect
61+
s.s1.s11 ----> s.s1.s11.choice_47 : H / effect
6262
s.s2.s21.s211 ----> s.s1.s11 : J / effect
6363
s.s1.s11 ----> s.s3 : K / effect
64-
state : Z / effect
64+
state : Z / effect
65+
@enduml

elements/elements.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type Vertex interface {
3636
type State interface {
3737
Vertex
3838
Entry() string
39-
Activity() string
39+
Activities() []string
4040
Exit() string
4141
}
4242

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/stateforward/go-hsm
1+
module github.com/runpod/hsm
22

33
go 1.22.5

hsm.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
"sync/atomic"
1515
"time"
1616

17-
"github.com/stateforward/go-hsm/elements"
18-
"github.com/stateforward/go-hsm/kind"
17+
"github.com/runpod/hsm/elements"
18+
"github.com/runpod/hsm/kind"
1919
)
2020

2121
var (

hsm_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ package hsm_test
22

33
import (
44
"context"
5+
"os"
56
"slices"
67
"testing"
78
"time"
89

9-
"github.com/stateforward/go-hsm"
10+
"github.com/runpod/hsm"
11+
"github.com/runpod/hsm/pkg/plantuml"
1012
)
1113

1214
type Trace struct {
@@ -189,7 +191,7 @@ func TestHSM(t *testing.T) {
189191
Name: "TestHSM",
190192
Id: "test",
191193
})
192-
// plantuml.Generate(os.Stdout, &model)
194+
plantuml.Generate(os.Stdout, &model)
193195
if sm.State() != "/s/s2/s21/s211" {
194196
t.Fatal("Initial state is not /s/s2/s21/s211", "state", sm.State())
195197
}

pkg/plantuml/plantuml.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"sort"
1010
"strings"
1111

12-
"github.com/stateforward/go-hsm/elements"
13-
"github.com/stateforward/go-hsm/kind"
12+
"github.com/runpod/hsm/elements"
13+
"github.com/runpod/hsm/kind"
1414
)
1515

1616
func idFromQualifiedName(qualifiedName string) string {
@@ -63,8 +63,12 @@ func generateState(builder *strings.Builder, depth int, state elements.NamedElem
6363
if entry := state.Entry(); entry != "" {
6464
fmt.Fprintf(builder, "%sstate %s: entry / %s\n", indent, id, idFromQualifiedName(path.Base(entry)))
6565
}
66-
if activity := state.Activity(); activity != "" {
67-
fmt.Fprintf(builder, "%sstate %s: activity / %s\n", indent, id, idFromQualifiedName(path.Base(activity)))
66+
if len(state.Activities()) > 0 {
67+
activities := []string{}
68+
for _, activity := range state.Activities() {
69+
activities = append(activities, idFromQualifiedName(path.Base(activity)))
70+
}
71+
fmt.Fprintf(builder, "%sstate %s: activities %s\n", indent, id, strings.Join(activities, ", "))
6872
}
6973
if exit := state.Exit(); exit != "" {
7074
fmt.Fprintf(builder, "%sstate %s: exit / %s\n", indent, id, idFromQualifiedName(path.Base(exit)))

queue/queue.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package queue
33
import (
44
"context"
55

6-
"github.com/stateforward/go-hsm/elements"
6+
"github.com/runpod/hsm/elements"
77
)
88

99
var NonBlocking = func() context.Context {

0 commit comments

Comments
 (0)