database

package
v0.0.0-...-98f127c Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func InitializeDatabase

func InitializeDatabase() error

func Load

func Load()

Loads the database. Any problems will be logged

func SearchAveragePerceptionDifference

func SearchAveragePerceptionDifference(aHash, dHash, pHash *goimagehash.ImageHash, method *string) (bool, error)

func SearchSHA1

func SearchSHA1(h *string) (bool, error)

Types

type Blacklist

type Blacklist struct {
	Model
	Sha1           string `gorm:"unique;not null;index"`
	AverageHash    string `gorm:"not null;index"`
	DifferenceHash string `gorm:"not null;index"`
	PerceptionHash string `gorm:"not null;index"`
	URL            string `gorm:"unique;not null"`
}

func (*Blacklist) DeleteEntry

func (b *Blacklist) DeleteEntry()

func (*Blacklist) New

func (b *Blacklist) New(img image.Image, link string) error

func (*Blacklist) Save

func (b *Blacklist) Save() error

Saves the data to the database

func (Blacklist) TableName

func (Blacklist) TableName() string

type Guild

type Guild struct {
	Model
	GuildID string
}

func (*Guild) Save

func (g *Guild) Save() error

Saves the data to the database

func (Guild) TableName

func (Guild) TableName() string

type Model

type Model struct {
	ID        uint `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

Jump to

Keyboard shortcuts

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