model

package
v0.0.0-...-7595909 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: CC0-1.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSchema

func InitSchema()

func InitUserSchema

func InitUserSchema()

func ValidateUserCreds

func ValidateUserCreds(v *validator.Validator, usr User)

Types

type DetectionModel

type DetectionModel struct {
	ModelVersion string `db:"model_version"`
	ModelId      int32  `db:"model_id"`
}

func (*DetectionModel) Insert

func (dm *DetectionModel) Insert() (int, error)

type DetectionModelHistory

type DetectionModelHistory struct {
	RecordId   int32     `db:"record_id"`
	ModelId    int32     `db:"model_id"` //foreign key
	UploadDate time.Time `db:"upload_date"`
	VideoHash  string    `db:"video_hash"`
	Result
}

func (*DetectionModelHistory) CheckHash

func (dmh *DetectionModelHistory) CheckHash() (bool, error)

func (*DetectionModelHistory) Insert

func (dmh *DetectionModelHistory) Insert() (int32, error)

type QueryResult

type QueryResult struct {
	TotalAnalyzed  int     `db:"total_analyzed" json:"totalAnalyzed"`
	FakePercentage float32 `db:"fake_percentage" json:"fakePercentage"`
	WeeklyData     any     `db:"weekly_data" json:"weeklyData"`
}

func GetUserAnalytics

func GetUserAnalytics(id int64) (QueryResult, error)

type Result

type Result struct {
	IsFake     bool    `db:"is_fake"`
	Confidence float32 `db:"confidence"`
}

type User

type User struct {
	ID          int64  `json:"id"`
	Name        string `json:"username"`
	Email       string `json:"email"`
	Password    string `json:"password"`
	AccessLevel int16  `db:"access_level" json:"access_level"`
}

func (*User) CheckPassword

func (usr *User) CheckPassword() (match bool, err error)

func (*User) GetHistory

func (usr *User) GetHistory() (UserHistoryHolder, error)

func (*User) InsertRecord

func (usr *User) InsertRecord() error

type UserHistory

type UserHistory struct {
	ActivityID        int64     `db:"activity_id"`
	UserID            int64     `db:"user_id"`
	ActivityTimestamp time.Time `db:"activity_timestamp"`
	VideoName         string    `db:"video_name"`
	HashID            int32     `db:"hash_id"`
}

func (*UserHistory) Register

func (usr *UserHistory) Register() (any, error)

type UserHistoryHolder

type UserHistoryHolder []VideoResultHolder

type VideoResultHolder

type VideoResultHolder struct {
	AID               int64     `db:"activity_id"`
	Name              string    `db:"video_name"`
	VideoHash         string    `db:"video_hash"`
	ActivityTimestamp time.Time `db:"activity_timestamp"`
	ModelVersion      string    `db:"model_version"`
	Confidence        float64   `db:"confidence"`
	IsFake            bool      `db:"is_fake"`
}

func GetVideoResult

func GetVideoResult(id int64) (VideoResultHolder, error)

Jump to

Keyboard shortcuts

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