sqlite

package
v0.0.0-...-bc78d29 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DSN string `json:"dsn"`
}

Config contains the configuration values for the SQLite database connection.

type SQLite

type SQLite struct {
	// contains filtered or unexported fields
}

SQLite maintains the connection to the sqlite database file.

func (*SQLite) AddLogEntry

func (s *SQLite) AddLogEntry(sle *database.SoundLogEntry) error

func (*SQLite) AddSoundStatsCount

func (s *SQLite) AddSoundStatsCount(guildID, sound string) error

func (*SQLite) Close

func (s *SQLite) Close()

Close the connection to the database.

func (*SQLite) Connect

func (s *SQLite) Connect(params ...interface{}) error

Connect opens the database file and sets up database structure.

func (*SQLite) GetAuthToken

func (s *SQLite) GetAuthToken(userID string) (*database.AuthTokenEntry, error)

func (*SQLite) GetConfigStructure

func (s *SQLite) GetConfigStructure() interface{}

GetConfigStructure returns an example object of the configuration structure for setting up the SQLite connection

func (*SQLite) GetFastTrigger

func (s *SQLite) GetFastTrigger(userID string) (string, error)

func (*SQLite) GetFavorites

func (s *SQLite) GetFavorites(userID string) ([]string, error)

func (*SQLite) GetGuildPrefix

func (s *SQLite) GetGuildPrefix(guildID string) (string, error)

GetGuildPrefix returns the individual prefix for a guild by its ID.

func (*SQLite) GetGuildVolume

func (s *SQLite) GetGuildVolume(guildID string) (int, error)

func (*SQLite) GetLogEntries

func (s *SQLite) GetLogEntries(guildID string, from, limit int) ([]*database.SoundLogEntry, error)

func (*SQLite) GetLogLen

func (s *SQLite) GetLogLen(guildID string) (int, error)

func (*SQLite) GetSoundStats

func (s *SQLite) GetSoundStats(guildID string, limit int) ([]*database.SoundStatsEntry, error)

func (*SQLite) GetUserPermissionLevel

func (s *SQLite) GetUserPermissionLevel(userID string, roles []string) (int, error)

GetUserPermissionLevel returns the individual permission level by the users ID and/or the users role IDs.

func (*SQLite) SetAuthToken

func (s *SQLite) SetAuthToken(userID, tokenHash string, expires ...time.Time) error

func (*SQLite) SetFastTrigger

func (s *SQLite) SetFastTrigger(userID, val string) error

func (*SQLite) SetFavorite

func (s *SQLite) SetFavorite(userID, sound string) error

func (*SQLite) SetGuildPrefix

func (s *SQLite) SetGuildPrefix(guildID, prefix string) error

SetGuildPrefix sets a prefix for a specific guild.

func (*SQLite) SetGuildVolume

func (s *SQLite) SetGuildVolume(guildID string, volume int) error

func (*SQLite) UnsetFavorite

func (s *SQLite) UnsetFavorite(userID, sound string) error

Jump to

Keyboard shortcuts

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