Documentation ¶
Index ¶
- type Connection
- func (c *Connection) AddPollVote(pollID string, optionID string) (bool, error)
- func (c *Connection) Close() error
- func (c *Connection) Connect(config *config.Config) error
- func (c *Connection) DeletePoll(p *poll.Poll) (bool, error)
- func (c *Connection) DeletePollByID(pollID string) (bool, error)
- func (c *Connection) GetConnectionString(config *config.Config) string
- func (c *Connection) GetPollByID(pollID string) (*poll.Poll, error)
- func (c *Connection) Ping() error
- func (c *Connection) SavePoll(p *poll.Poll) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection represents a new MySQL database connection
func (*Connection) AddPollVote ¶
func (c *Connection) AddPollVote(pollID string, optionID string) (bool, error)
AddPollVote adds a vote to a particular option for a poll
func (*Connection) Close ¶
func (c *Connection) Close() error
Close will close the database connection
func (*Connection) Connect ¶
func (c *Connection) Connect(config *config.Config) error
Connect will establish a database connection
func (*Connection) DeletePoll ¶
func (c *Connection) DeletePoll(p *poll.Poll) (bool, error)
DeletePoll will delete a poll from the database
func (*Connection) DeletePollByID ¶
func (c *Connection) DeletePollByID(pollID string) (bool, error)
DeletePollByID deletes a poll from the database
func (*Connection) GetConnectionString ¶
func (c *Connection) GetConnectionString(config *config.Config) string
GetConnectionString builds and returns an appropriate connection string
func (*Connection) GetPollByID ¶
func (c *Connection) GetPollByID(pollID string) (*poll.Poll, error)
GetPollByID fetches a poll from the database by ID
func (*Connection) Ping ¶
func (c *Connection) Ping() error
Ping pings the database to verify that the database connection is alive
Click to show internal directories.
Click to hide internal directories.