feat: add supervisor prototype with embedded frontend
This commit is contained in:
12
internal/util/ids.go
Normal file
12
internal/util/ids.go
Normal file
@ -0,0 +1,12 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
)
|
||||
|
||||
func NewID(prefix string) string {
|
||||
buf := make([]byte, 8)
|
||||
_, _ = rand.Read(buf)
|
||||
return prefix + "_" + hex.EncodeToString(buf)
|
||||
}
|
||||
10
internal/util/logger.go
Normal file
10
internal/util/logger.go
Normal file
@ -0,0 +1,10 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
func NewLogger() *log.Logger {
|
||||
return log.New(os.Stdout, "[supervisor] ", log.LstdFlags|log.Lmicroseconds)
|
||||
}
|
||||
Reference in New Issue
Block a user