sql

package
v0.0.0-...-886a64d Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func GetNewRoles

func GetNewRoles(copaing *Copaing, cfg *Config, roles []string, c chan<- string, n chan<- string)

func LoadConfig

func LoadConfig(cfg *Config)

func Save

func Save(i interface{})

Types

type Config

type Config struct {
	gorm.Model
	GuildID           string `gorm:"not null"`
	XpRoles           []XpRole
	BroadcastChannel  string
	DisabledXpChannel string
}

func (*Config) BeforeDelete

func (cfg *Config) BeforeDelete(tx *gorm.DB) (err error)

func (*Config) DisabledXpChannelsSlice

func (cfg *Config) DisabledXpChannelsSlice() []string

func (*Config) DisabledXpChannelsString

func (cfg *Config) DisabledXpChannelsString(slice []string) string

type Copaing

type Copaing struct {
	gorm.Model
	UserID  string `gorm:"not null"`
	GuildID string `gorm:"not null"`
	XP      uint   `gorm:"default:0"`
	OldXP   uint   `gorm:"default:0"`
}

func GetCopaing

func GetCopaing(userID string, guildID string) Copaing

type DBCredentials

type DBCredentials struct {
	Host     string
	User     string
	Password string
	DBName   string
	Port     string
}

func (*DBCredentials) Connect

func (dbCredentials *DBCredentials) Connect() *gorm.DB

type XpRole

type XpRole struct {
	gorm.Model
	XP       uint
	Role     string
	ConfigID uint
}

Jump to

Keyboard shortcuts

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