Documentation
¶
Index ¶
- Constants
- func ArchivePath(name string) string
- func BackupToArchive(out string, store imagestore.Store, dryRun, verbose bool) (string, error)
- func DefaultArchivePath(t time.Time) string
- func ListArchives() ([]string, error)
- func RestoreFromArchive(from string, store imagestore.Store, backupKey []byte, dryRun, verbose bool) error
- type AdFacetRow
- type AdRow
- type B64
- type BookmarkRow
- type ConversationRow
- type Counts
- type LocationRow
- type Manifest
- type MessageRow
- type RockOpinionRow
- type UserAdClickRow
- type UserAdImageClickRow
- type UserRow
Constants ¶
const DefaultDir = "backups"
Variables ¶
This section is empty.
Functions ¶
func ArchivePath ¶
func BackupToArchive ¶
BackupToArchive writes a tar.gz backup. Empty out uses DefaultArchivePath.
func DefaultArchivePath ¶
DefaultArchivePath returns backups/backup-YYYYMMDD-HHMMSS.tar.gz (UTC).
func ListArchives ¶
ListArchives returns *.tar.gz names in backups/, newest first.
func RestoreFromArchive ¶
func RestoreFromArchive(from string, store imagestore.Store, backupKey []byte, dryRun, verbose bool) error
RestoreFromArchive restores from a .tar.gz path (relative names use backups/). backupKey decrypts archive user fields. Empty uses backups/users.csv when that file exists, otherwise config.DBEncryptionKey.
Types ¶
type AdFacetRow ¶
type AdRow ¶
type AdRow struct {
Ref int `json:"ref"`
CategoryID int `json:"category_id" db:"category_id"`
Title string `json:"title" db:"title"`
Description string `json:"description" db:"description"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
ExpiresAt time.Time `json:"expires_at" db:"expires_at"`
InactiveAt *time.Time `json:"inactive_at,omitempty" db:"inactive_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty" db:"deleted_at"`
OwnerHash string `json:"owner_hash"`
ImageCount int `json:"image_count" db:"image_count"`
LocationRaw *string `json:"location_raw,omitempty"`
Tags string `json:"tags" db:"tags"`
Embedding B64 `json:"embedding,omitempty"`
VectorMetadata json.RawMessage `json:"vector_metadata,omitempty"`
}
type BookmarkRow ¶
type ConversationRow ¶
type ConversationRow struct {
Ref int `json:"ref"`
AdRef int `json:"ad_ref"`
OwnerHash string `json:"owner_hash"`
InquirerHash string `json:"inquirer_hash"`
OwnerHasUnread int `json:"owner_has_unread" db:"owner_has_unread"`
InquirerHasUnread int `json:"inquirer_has_unread" db:"inquirer_has_unread"`
RockThrowerHash *string `json:"rock_thrower_hash,omitempty"`
RockThrownAt *time.Time `json:"rock_thrown_at,omitempty" db:"rock_thrown_at"`
}
type Counts ¶
type Counts struct {
Users int `json:"users"`
Locations int `json:"locations"`
Ads int `json:"ads"`
AdFacets int `json:"ad_facets"`
Bookmarks int `json:"bookmarks"`
UserAdClicks int `json:"user_ad_clicks"`
UserAdImageClicks int `json:"user_ad_image_clicks"`
Conversations int `json:"conversations"`
Messages int `json:"messages"`
RockOpinions int `json:"rock_opinions"`
Images int `json:"images"`
AccountPictures int `json:"account_pictures"`
Embeddings int `json:"embeddings"`
}
type LocationRow ¶
type LocationRow struct {
RawText string `json:"raw_text" db:"raw_text"`
City string `json:"city" db:"city"`
AdminArea string `json:"admin_area" db:"admin_area"`
Country string `json:"country" db:"country"`
Latitude float64 `json:"latitude" db:"latitude"`
Longitude float64 `json:"longitude" db:"longitude"`
}
type MessageRow ¶
type RockOpinionRow ¶
type RockOpinionRow struct {
ConversationRef int `json:"conversation_ref"`
GeneratedAt time.Time `json:"generated_at" db:"generated_at"`
Summary string `json:"summary" db:"summary"`
Assessment int `json:"assessment" db:"assessment"`
AssessmentDetail string `json:"assessment_detail" db:"assessment_detail"`
Resolution string `json:"resolution" db:"resolution"`
Reasoning string `json:"reasoning" db:"reasoning"`
}
type UserAdClickRow ¶
type UserAdImageClickRow ¶
type UserRow ¶
type UserRow struct {
EncryptUserID int `json:"encrypt_user_id"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty" db:"deleted_at"`
IsAdmin int `json:"is_admin" db:"is_admin"`
EncryptedName B64 `json:"encrypted_name" db:"encrypted_name"`
NameNonce B64 `json:"name_nonce" db:"name_nonce"`
NameHash string `json:"name_hash" db:"name_hash"`
PasswordHash string `json:"password_hash" db:"password_hash"`
PasswordSalt string `json:"password_salt" db:"password_salt"`
PasswordAlgo string `json:"password_algo" db:"password_algo"`
EncryptedPhone B64 `json:"encrypted_phone" db:"encrypted_phone"`
PhoneNonce B64 `json:"phone_nonce" db:"phone_nonce"`
PhoneHash string `json:"phone_hash" db:"phone_hash"`
PhoneVerified int `json:"phone_verified" db:"phone_verified"`
SMSOptedOut int `json:"sms_opted_out" db:"sms_opted_out"`
LastSMSSentAt *time.Time `json:"last_sms_sent_at,omitempty" db:"last_sms_sent_at"`
HasAccountPicture int `json:"has_account_picture" db:"has_account_picture"`
AccountPictureURL *string `json:"account_picture_url,omitempty" db:"account_picture_url"`
}