database

package
v0.0.0-...-2ea6397 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeSegments

func DecodeSegments(segments string) map[int]struct{}

DecodeSegments decodes segments into a map

func EncodeSegments

func EncodeSegments(segments map[int]struct{}) 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    snowflake.ID
}

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 snowflake.ID, loop bool) error
	RemoveCustom        func(command string, guild snowflake.ID) error
	RemoveFromDB        func(el queue.Element)
	GetCustomCommands   func() (map[snowflake.ID]map[string]*CustomCommand, error)
	AddToBlacklist      func(id snowflake.ID) error
	RemoveFromBlacklist func(id snowflake.ID) error
	Close               func()
	UpdateDJRole        func(guild snowflake.ID, role snowflake.ID) error
	GetDJ               func() (map[snowflake.ID]DJ, error)
	GetBlacklist        func() (*sync.Map, error)
	SetDJSettings       func(guild snowflake.ID, enabled bool) error
	AddLinkDB           func(id, link string) error
	GetFavorites        func(userID snowflake.ID) []Favorite
	AddFavorite         func(userID snowflake.ID, favorite Favorite) error
	RemoveFavorite      func(userID snowflake.ID, name string) error
	GetSearch           func(term string) (string, error)
	AddSearch           func(term, link string) error
	RemoveSearch        func(term string) error
	GetPlaylist         func(playlist string) ([]string, error)
	AddPlaylist         func(playlist, entry string, number int) error
	RemovePlaylist      func(playlist 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