database

package
v0.0.0-...-bfda327 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeSegments

func DecodeSegments(segments string) map[int]bool

DecodeSegments decodes segments into a map

func EncodeSegments

func EncodeSegments(segments map[int]bool) string

EncodeSegments returns an encoded string of segments

func ExecQuery

func ExecQuery(db *sql.DB, query ...string)

ExecQuery executes a simple query given a DB

Types

type CustomCommand

type CustomCommand struct {
	Link string
	Loop bool
}

CustomCommand holds data about a custom command

type DJ

type DJ struct {
	Enabled bool
	Role    string
}

type Database

type Database struct {
	AddToDb             func(el queue.Element, exist bool)
	CheckInDb           func(link string) (queue.Element, error)
	AddCommand          func(command string, song string, guild string, loop bool) error
	RemoveCustom        func(command string, guild string) error
	RemoveFromDB        func(el queue.Element)
	GetCustomCommands   func() (map[string]map[string]*CustomCommand, error)
	AddToBlacklist      func(id string) error
	RemoveFromBlacklist func(id string) error
	Close               func()
	UpdateDJRole        func(guild string, role string) error
	GetDJ               func() (map[string]DJ, error)
	GetBlacklist        func() (map[string]bool, error)
	SetDJSettings       func(guild string, enabled bool) error
	AddLinkDB           func(id, link string) error
	GetFavorites        func(userID string) []Favorite
	AddFavorite         func(userID string, favorite Favorite) error
	RemoveFavorite      func(userID, name string) error
}

type Favorite

type Favorite struct {
	Name   string `json:"name"`
	Link   string `json:"link"`
	Folder string `json:"folder"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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