-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Will probably squash or split this into proper commits later.
- Loading branch information
Showing
31 changed files
with
723 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package main | ||
|
||
import ( | ||
"io" | ||
"os" | ||
|
||
"github.com/google/uuid" | ||
) | ||
|
||
var zeroUUID = uuid.UUID{} | ||
|
||
func loadUUIDKey() (string, error) { | ||
var id uuid.UUID | ||
if f, err := os.Open("eaas-id.txt"); err == nil { | ||
defer f.Close() | ||
keyBytes, err := io.ReadAll(f) | ||
if err != nil { | ||
return "", err | ||
} | ||
id, err = uuid.ParseBytes(keyBytes) | ||
if err != nil { | ||
return "", err | ||
} | ||
} | ||
if id == zeroUUID { | ||
var err error | ||
id, err = uuid.NewUUID() | ||
if err != nil { | ||
return "", err | ||
} | ||
keyBytes, err := id.MarshalBinary() | ||
if err != nil { | ||
return "", err | ||
} | ||
os.WriteFile("eaas-id.txt", keyBytes, 0o600) | ||
} | ||
return id.String(), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
*.m4a filter=lfs diff=lfs merge=lfs -text | ||
*.beatgrid filter=lfs diff=lfs merge=lfs -text | ||
*.waveform filter=lfs diff=lfs merge=lfs -text |
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.