Work on portmaster restructuring

This commit is contained in:
Daniel
2018-11-27 16:39:06 +01:00
parent 99851166a0
commit 5bdb021c88
38 changed files with 605 additions and 332 deletions

6
profile/const_darwin.go Normal file
View File

@@ -0,0 +1,6 @@
package profile
// OS Identifier Prefix
const (
IdentifierPrefix = "mac:"
)

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"sync"
"github.com/satori/go.uuid"
uuid "github.com/satori/go.uuid"
"github.com/Safing/portbase/database/record"
"github.com/Safing/portmaster/status"
@@ -49,10 +49,12 @@ func New() *Profile {
// Save saves the profile to the database
func (profile *Profile) Save(namespace string) error {
if profile.ID == "" {
u, err := uuid.NewV4()
if err != nil {
return err
}
// FIXME: this is weird, the docs says that it also returns an error
u := uuid.NewV4()
// u, err := uuid.NewV4()
// if err != nil {
// return err
// }
profile.ID = u.String()
}