Documentation ¶
Index ¶
- func Init() error
- type Database
- func (DB *Database) AddEvents(events *ctftime.Events) error
- func (DB *Database) Close()
- func (DB *Database) DeleteEventByID(eventID int) error
- func (DB *Database) GetEvents() (ctftime.Events, error)
- func (DB *Database) GetEventsByStatus(status utils.Status) (ctftime.Events, error)
- func (DB *Database) GetRegisteredChannels() ([]string, error)
- func (DB *Database) ModifyEventStatus(eventID int, status utils.Status) error
- func (DB *Database) Ping()
- func (DB *Database) RegisterForNotifs(ChannelID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is a wrapper around the SQL database to allow addition of methods
func New ¶
func New() *Database
New returns an instance of Database Use this when you don't want to clear the DB
func (*Database) Close ¶
func (DB *Database) Close()
Close closes the connetion to the database, can call this with defer in main
func (*Database) DeleteEventByID ¶
DeleteEventByID deletes the event with ID eventID
func (*Database) GetEventsByStatus ¶
GetEventsByStatus returns events depending upon the Status attribute
func (*Database) GetRegisteredChannels ¶
GetRegisteredChannels returns all ChannelIDs from the notify table
func (*Database) ModifyEventStatus ¶
ModifyEventStatus modifies the status of the event identified by the eventID
func (*Database) Ping ¶
func (DB *Database) Ping()
Ping allows you to ping the database and check if connection is possible
func (*Database) RegisterForNotifs ¶
RegisterForNotifs adds a Channel to the notify table
Click to show internal directories.
Click to hide internal directories.