trifid/tfclient-go/config.go

25 lines
463 B
Go
Raw Permalink Normal View History

2024-01-24 00:34:46 +00:00
package tfclient
import (
"crypto/ed25519"
"runtime"
)
type TfConfig struct {
HostKey struct {
HostID string `yaml:"host_id"`
PrivateKey ed25519.PrivateKey `yaml:"private_key"`
Counter uint `yaml:"counter"`
TrustedKeys []ed25519.PublicKey `yaml:"trusted_keys"`
}
}
func ConfigPath() string {
switch runtime.GOOS {
case "windows":
return "C:\\ProgramData\\tfclient"
default:
return "/etc/tfclient"
}
}