db

package
v0.0.0-...-0e337b7 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteScan

func DeleteScan(scanId int)

func LogStartScan

func LogStartScan(scanType string) int

func SaveMessageMetadataToDb

func SaveMessageMetadataToDb(scanId int, messageMetaData <-chan MessageMetadata)

func SavePhotosMediaItemToDb

func SavePhotosMediaItemToDb(scanId int, photosMediaItem <-chan PhotosMediaItem)

func SaveScanMetadata

func SaveScanMetadata(searchPath string, searchFilter string, scanId int)

func SaveStatToDb

func SaveStatToDb(scanId int, scanData <-chan FileData)

Types

type FileData

type FileData struct {
	FilePath  string
	FileName  string
	IsDir     bool
	Size      uint
	ModTime   time.Time
	FileCount uint
	Md5Hash   string
}

type MessageMetadata

type MessageMetadata struct {
	MessageId    string
	ThreadId     string
	LabelIds     []string
	From         string
	To           string
	Subject      string
	Date         string
	SizeEstimate int64
}

type MessageMetadataRead

type MessageMetadataRead struct {
	Id           int            `db:"id" json:"message_metadata_id"`
	ScanId       int            `db:"scan_id"`
	MessageId    sql.NullString `db:"message_id"`
	ThreadId     sql.NullString `db:"thread_id"`
	LabelIds     sql.NullString `db:"labels"`
	From         sql.NullString `db:"mail_from"`
	To           sql.NullString `db:"mail_to"`
	Subject      sql.NullString
	Date         sql.NullString
	SizeEstimate sql.NullInt64 `db:"size_estimate"`
}

func GetMessageMetadataFromDb

func GetMessageMetadataFromDb(scanId int, pageNo int) ([]MessageMetadataRead, int)

type PhotosMediaItem

type PhotosMediaItem struct {
	MediaItemId            string
	ProductUrl             string
	MimeType               string
	Filename               string
	Size                   int64
	FileModTime            time.Time
	Md5hash                string
	ContributorDisplayName string
	AlbumIds               []string
	CameraMake             string
	CameraModel            string
	FocalLength            float32
	FNumber                float32
	Iso                    int
	ExposureTime           string
	Fps                    float32
}

type PhotosMediaItemRead

type PhotosMediaItemRead struct {
	Id                     int            `db:"id" json:"photos_media_item_id"`
	ScanId                 int            `db:"scan_id"`
	MediaItemId            string         `db:"media_item_id" json:"media_item_id"`
	ProductUrl             string         `db:"product_url"`
	MimeType               sql.NullString `db:"mime_type"`
	Filename               string
	Size                   sql.NullInt64
	ModifiedTime           sql.NullTime `db:"file_mod_time"`
	Md5hash                sql.NullString
	ContributorDisplayName sql.NullString `db:"contributor_display_name"`
}

func GetPhotosMediaItemFromDb

func GetPhotosMediaItemFromDb(scanId int, pageNo int) ([]PhotosMediaItemRead, int)

type Scan

type Scan struct {
	Id            int          `db:"id" json:"scan_id"`
	ScanType      string       `db:"scan_type"`
	CreatedOn     time.Time    `db:"created_on"`
	ScanStartTime time.Time    `db:"scan_start_time"`
	ScanEndTime   sql.NullTime `db:"scan_end_time"`
	Metadata      string       `db:"metadata"`
	Duration      string       `db:"duration"`
}

func GetScansFromDb

func GetScansFromDb(pageNo int) ([]Scan, int)

type ScanData

type ScanData struct {
	Id           int            `db:"id" json:"scan_data_id"`
	Name         sql.NullString `db:"name"`
	Path         sql.NullString `db:"path"`
	Size         sql.NullInt64  `db:"size"`
	ModifiedTime sql.NullTime   `db:"file_mod_time"`
	Md5Hash      sql.NullString `db:"md5hash"`
	IsDir        sql.NullBool   `db:"is_dir"`
	FileCount    sql.NullInt32  `db:"file_count"`
	ScanId       int            `db:"scan_id"`
}

func GetScanDataFromDb

func GetScanDataFromDb(scanId int, pageNo int) ([]ScanData, int)

Jump to

Keyboard shortcuts

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