Files
miasma-installer/examples/danklinux/internal/server/bluez/broker.go
tumillanino 6fd2f42ec2
Some checks failed
Build / build (push) Failing after 4m53s
added required partitioning package installations
2025-11-12 16:01:17 +11:00

22 lines
455 B
Go

package bluez
import (
"context"
"crypto/rand"
"encoding/hex"
)
type PromptBroker interface {
Ask(ctx context.Context, req PromptRequest) (token string, err error)
Wait(ctx context.Context, token string) (PromptReply, error)
Resolve(token string, reply PromptReply) error
}
func generateToken() (string, error) {
bytes := make([]byte, 16)
if _, err := rand.Read(bytes); err != nil {
return "", err
}
return hex.EncodeToString(bytes), nil
}