Add first set of import/export APIs

This commit is contained in:
Daniel
2023-09-19 16:10:10 +02:00
parent 7c3925db32
commit cf3bd9f671
8 changed files with 743 additions and 14 deletions

45
sync/profile.go Normal file
View File

@@ -0,0 +1,45 @@
package sync
import (
"time"
"github.com/safing/portmaster/profile"
)
// ProfileExport holds an export of a profile.
type ProfileExport struct { //nolint:maligned
Type Type
// Identification (sync or import as new only)
ID string
Source string
// Human Metadata
Name string
Description string
Homepage string
Icons []profile.Icon
PresentationPath string
UsePresentationPath bool
// Process matching
Fingerprints []profile.Fingerprint
// Settings
Config map[string]any
// Metadata (sync only)
LastEdited time.Time
Created time.Time
Internal bool
}
// ProfileImportRequest is a request to import Profile.
type ProfileImportRequest struct {
ImportRequest
// Reset all settings and fingerprints of target before import.
Reset bool
Export *ProfileExport
}