mongodb

package
v0.0.0-...-07d50f2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

func (*Connection) SavePoll

func (c *Connection) SavePoll(p *poll.Poll) error

SavePoll saves a Poll and corresponding Options

Jump to

Keyboard shortcuts

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