aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/state
diff options
context:
space:
mode:
Diffstat (limited to 'internal/state')
-rw-r--r--internal/state/multi.go16
-rw-r--r--internal/state/multi_test.go2
-rw-r--r--internal/state/state.go10
-rw-r--r--internal/state/state_test.go10
4 files changed, 19 insertions, 19 deletions
diff --git a/internal/state/multi.go b/internal/state/multi.go
index f4436112..fac5b389 100644
--- a/internal/state/multi.go
+++ b/internal/state/multi.go
@@ -13,9 +13,9 @@ import (
"sync"
"syscall"
- "git.gensokyo.uk/security/fortify/fst"
- "git.gensokyo.uk/security/fortify/internal/app"
- "git.gensokyo.uk/security/fortify/internal/fmsg"
+ "git.gensokyo.uk/security/hakurei/hst"
+ "git.gensokyo.uk/security/hakurei/internal/app"
+ "git.gensokyo.uk/security/hakurei/internal/hlog"
)
// fine-grained locking and access
@@ -86,17 +86,17 @@ func (s *multiStore) List() ([]int, error) {
for _, e := range entries {
// skip non-directories
if !e.IsDir() {
- fmsg.Verbosef("skipped non-directory entry %q", e.Name())
+ hlog.Verbosef("skipped non-directory entry %q", e.Name())
continue
}
// skip non-numerical names
if v, err := strconv.Atoi(e.Name()); err != nil {
- fmsg.Verbosef("skipped non-aid entry %q", e.Name())
+ hlog.Verbosef("skipped non-aid entry %q", e.Name())
continue
} else {
if v < 0 || v > 9999 {
- fmsg.Verbosef("skipped out of bounds entry %q", e.Name())
+ hlog.Verbosef("skipped out of bounds entry %q", e.Name())
continue
}
@@ -232,7 +232,7 @@ func (b *multiBackend) load(decode bool) (Entries, error) {
}
// state file consists of an eight byte header, followed by concatenated gobs
-// of [fst.Config] and [State], if [State.Config] is not nil or offset < 0,
+// of [hst.Config] and [State], if [State.Config] is not nil or offset < 0,
// the first gob is skipped
func (b *multiBackend) decodeState(r io.ReadSeeker, state *State) error {
offset := make([]byte, 8)
@@ -269,7 +269,7 @@ func (b *multiBackend) decodeState(r io.ReadSeeker, state *State) error {
return ErrNoConfig
}
- state.Config = new(fst.Config)
+ state.Config = new(hst.Config)
if _, err := r.Seek(8, io.SeekStart); err != nil {
return err
}
diff --git a/internal/state/multi_test.go b/internal/state/multi_test.go
index e0407c4c..2549034d 100644
--- a/internal/state/multi_test.go
+++ b/internal/state/multi_test.go
@@ -3,7 +3,7 @@ package state_test
import (
"testing"
- "git.gensokyo.uk/security/fortify/internal/state"
+ "git.gensokyo.uk/security/hakurei/internal/state"
)
func TestMulti(t *testing.T) {
diff --git a/internal/state/state.go b/internal/state/state.go
index 609b4e92..0c07b371 100644
--- a/internal/state/state.go
+++ b/internal/state/state.go
@@ -5,8 +5,8 @@ import (
"io"
"time"
- "git.gensokyo.uk/security/fortify/fst"
- "git.gensokyo.uk/security/fortify/internal/app"
+ "git.gensokyo.uk/security/hakurei/hst"
+ "git.gensokyo.uk/security/hakurei/internal/app"
)
var ErrNoConfig = errors.New("state does not contain config")
@@ -35,14 +35,14 @@ type Cursor interface {
Len() (int, error)
}
-// State is a fortify process's state
+// State is an instance state
type State struct {
- // fortify instance id
+ // hakurei instance id
ID app.ID `json:"instance"`
// child process PID value
PID int `json:"pid"`
// sealed app configuration
- Config *fst.Config `json:"config"`
+ Config *hst.Config `json:"config"`
// process start time
Time time.Time `json:"time"`
diff --git a/internal/state/state_test.go b/internal/state/state_test.go
index fe7a6cc6..caf5c43a 100644
--- a/internal/state/state_test.go
+++ b/internal/state/state_test.go
@@ -10,9 +10,9 @@ import (
"testing"
"time"
- "git.gensokyo.uk/security/fortify/fst"
- "git.gensokyo.uk/security/fortify/internal/app"
- "git.gensokyo.uk/security/fortify/internal/state"
+ "git.gensokyo.uk/security/hakurei/hst"
+ "git.gensokyo.uk/security/hakurei/internal/app"
+ "git.gensokyo.uk/security/hakurei/internal/state"
)
func testStore(t *testing.T, s state.Store) {
@@ -63,7 +63,7 @@ func testStore(t *testing.T, s state.Store) {
&tc[i].state.ID)
} else {
got.Time = tc[i].state.Time
- tc[i].state.Config = fst.Template()
+ tc[i].state.Config = hst.Template()
if !reflect.DeepEqual(got, &tc[i].state) {
t.Fatalf("Load: entry %s got %#v, want %#v",
&tc[i].state.ID, got, &tc[i].state)
@@ -137,7 +137,7 @@ func makeState(t *testing.T, s *state.State, ct io.Writer) {
if err := app.NewAppID(&s.ID); err != nil {
t.Fatalf("cannot create dummy state: %v", err)
}
- if err := gob.NewEncoder(ct).Encode(fst.Template()); err != nil {
+ if err := gob.NewEncoder(ct).Encode(hst.Template()); err != nil {
t.Fatalf("cannot encode dummy config: %v", err)
}
s.PID = rand.Int()