database

package
v0.0.0-...-35e93be Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeDatabase

func InitializeDatabase(dbPath string, gormConfig *gorm.Config) (db *gorm.DB, err error)

func RegisterModels

func RegisterModels(db *gorm.DB) (err error)

Types

type Case

type Case struct {
	gorm.Model
	Type        string
	State       string
	GuildID     string
	ExecutorID  string
	VictimID    string
	Description string
}

model for Cases like reports, kicks, bans and such

type Guild

type Guild struct {
	gorm.Model

	GuildID         string `gorm:"unique;not null"`
	Prefix          string `gorm:"default:;;"`
	HandleReports   string `gorm:"default:dm"`
	ReportChannelID string `gorm:"unique"`
	LogChannelID    string `gorm:"unique"`
	StaffRoleID     uint   `gorm:"unique"`
}

model to provide customization for your Guild, e.g. custom prefix

type Message

type Message struct {
	gorm.Model

	MessageID string
	ChannelID string
	GuildID   string

	Content string
	Author  string

	Timestamp       string
	EditedTimestamp string
}

type Rule

type Rule struct {
	gorm.Model

	GuildID string `gorm:"not null"`
	Content string `gorm:"not null"`
}

Jump to

Keyboard shortcuts

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