models

package
v0.0.0-...-070d176 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Secret

type Secret struct {
	gorm.Model
	UserID         uint       `gorm:"not null"` // ID пользователя
	Name           string     `gorm:"not null"` // Имя секрета
	Type           SecretType `gorm:"not null"` // Тип секрета (логин, текст, бинарные данные, карта)
	Metadata       string     // Метаинформация (например, теги, категории)
	Data           []byte     `gorm:"not null"`      // Данные
	Version        int        `gorm:"not null"`      // Версия данных для синхронизации
	LocalUpdatedAt time.Time  `gorm:"-"`             // Время последнего обновления локально, в gorm игнорируем
	Deleted        bool       `gorm:"default:false"` // Флаг актуальность секрета
	Synced         bool       `json:"synced"`        // Флаг синхронизации секрета с сервером
}

Secret описывает секрет

type SecretType

type SecretType string
const (
	TypeLogin  SecretType = "login"
	TypeText   SecretType = "text"
	TypeBinary SecretType = "binary"
	TypeCard   SecretType = "card"
)

type User

type User struct {
	gorm.Model
	Username        string `gorm:"unique;not null"`
	Password        string `gorm:"not null"`
	LastSyncVersion int
}

User описывает пользователя

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL