2022-01-09 05:27:18 +01:00
|
|
|
package shared
|
|
|
|
|
2022-01-09 06:59:28 +01:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
2022-01-09 05:27:18 +01:00
|
|
|
|
2022-04-03 07:27:20 +02:00
|
|
|
type EncHistoryEntry struct {
|
|
|
|
EncryptedData []byte `json:"enc_data"`
|
|
|
|
Nonce []byte `json:"nonce"`
|
|
|
|
DeviceId string `json:"device_id"`
|
|
|
|
UserId string `json:"user_id"`
|
|
|
|
Date time.Time `json:"time"`
|
2022-04-04 05:55:37 +02:00
|
|
|
EncryptedId string `json:"id"`
|
|
|
|
ReadCount int `json:"read_count"`
|
2022-04-03 07:27:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type Device struct {
|
2022-04-04 05:55:37 +02:00
|
|
|
UserId string `json:"user_id"`
|
2022-04-03 07:27:20 +02:00
|
|
|
DeviceId string `json:"device_id"`
|
2022-04-10 01:37:51 +02:00
|
|
|
// The IP address that was used to register the device. Recorded so
|
|
|
|
// that I can count how many people are using hishtory and roughly
|
|
|
|
// from where. If you would like this deleted, please email me at
|
|
|
|
// david@daviddworken.com and I can clear it from your device entries.
|
|
|
|
RegistrationIp string `json:"registration_ip"`
|
|
|
|
RegistrationDate time.Time `json:"registration_date"`
|
2022-04-03 07:27:20 +02:00
|
|
|
}
|
|
|
|
|
2022-04-17 01:34:09 +02:00
|
|
|
type UpdateInfo struct {
|
2022-04-17 21:02:56 +02:00
|
|
|
LinuxAmd64Url string `json:"linux_amd_64_url"`
|
|
|
|
LinuxAmd64AttestationUrl string `json:"linux_amd_64_attestation_url"`
|
|
|
|
DarwinAmd64Url string `json:"darwin_amd_64_url"`
|
|
|
|
DarwinAmd64AttestationUrl string `json:"darwin_amd_64_attestation_url"`
|
|
|
|
DarwinArm64Url string `json:"darwin_arm_64_url"`
|
|
|
|
DarwinArm64AttestationUrl string `json:"darwin_arm_64_attestation_url"`
|
|
|
|
Version string `json:"version"`
|
2022-04-17 01:34:09 +02:00
|
|
|
}
|
|
|
|
|
2022-04-03 07:27:20 +02:00
|
|
|
const (
|
2022-04-08 05:59:40 +02:00
|
|
|
CONFIG_PATH = ".hishtory.config"
|
|
|
|
HISHTORY_PATH = ".hishtory"
|
|
|
|
DB_PATH = ".hishtory.db"
|
2022-04-03 07:27:20 +02:00
|
|
|
)
|