db

package
v0.0.0-...-846776f Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	*sqlx.DB
}

Handler makes grabbing and updating config easier

func (*Handler) AddTeam

func (d *Handler) AddTeam(guildID, name, channel string) error

AddTeam adds a team to the database

func (*Handler) CacheSchedule

func (d *Handler) CacheSchedule(s *schedule.Schedule) (err error)

CacheSchedule adds a new schedule to the cache, or updates an existing cache for the schedule.

func (*Handler) CachedSchedule

func (d *Handler) CachedSchedule(s *schedule.Schedule) (err error)

CachedSchedule returns a cached schedule

func (*Handler) ExecJSON

func (d *Handler) ExecJSON(query string, v interface{}) error

ExecJSON runs a query with a JSON representation of v.

func (*Handler) GetName

func (d *Handler) GetName(channelID string) (string, error)

GetName returns the name of a team in a given channel

func (*Handler) SpreadsheetID

func (d *Handler) SpreadsheetID(teamID int) (id string, err error)

SpreadsheetID returns the spreadsheet ID for the team with the given ID.

Jump to

Keyboard shortcuts

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