mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-13 00:42:49 -05:00
rename backend to core
This commit is contained in:
21
core/internal/server/bluez/broker.go
Normal file
21
core/internal/server/bluez/broker.go
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user