model

package
v0.0.0-...-e05d22d Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 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 AuthApiKey

type AuthApiKey struct {
	Key          string `gorm:"primaryKey"`
	RawKeyPrefix string // Unhashed key prefix, e.g. "sk-xyz123"
	AuthUserID   int64
	CreatedAt    time.Time
	ExpiresAt    time.Time `gorm:"default:null"` // Can be zero, which means no expiry
}

Same semantics as AuthSession, but intended for API keys

type AuthSession

type AuthSession struct {
	Key        string `gorm:"primaryKey"`
	AuthUserID int64
	CreatedAt  time.Time
	ExpiresAt  time.Time
}

Login session (cookie-based)

type AuthUser

type AuthUser struct {
	BaseModel
	Email           string    `json:"email"` // Doesn't need to be email. Can be any string.
	Password        string    `json:"-"`
	CreatedAt       time.Time `json:"createdAt"`
	SitePermissions string    `json:"sitePermissions"`
}

type BaseModel

type BaseModel struct {
	ID int64 `gorm:"primaryKey" json:"id"`
}

BaseModel is our base class for a GORM model. The default GORM Model uses int, but we prefer int64

type Video

type Video struct {
	BaseModel
	CreatedBy  int64         `json:"createdBy"`
	CreatedAt  dbh.MilliTime `json:"createdAt"`
	CameraName string        `json:"cameraName"` // Whatever the user chose to name the camera
	HasLabels  bool          `json:"hasLabels"`  // True if the video has been labeled
}

SYNC-ARC-VIDEO-RECORD

Jump to

Keyboard shortcuts

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