cardsmysql

package
v0.0.0-...-ee591bf Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sql.DB
}

func Open

func Open(dataSourceName string) (*DB, error)

Open returns a DB reference for a data source.

func (*DB) Begin

func (db *DB) Begin() (*Tx, error)

Begin starts an returns a new transaction.

type Tx

type Tx struct {
	*sql.Tx
}

func (*Tx) CreateCard

func (tx *Tx) CreateCard(c *cs.Card) (string, error)

CreateCard creates a new card. Returns the id of the card that was created or an error if the tx fails.

func (*Tx) DeleteCard

func (tx *Tx) DeleteCard(c *cs.Card) (int64, error)

DeleteCard deletes a card based on its id. Returns the number of records deleted or an error if the tx fails.

func (*Tx) EmbedCard

func (tx *Tx) EmbedCard(p, c *cs.Card) (int64, error)

EmbedCard embeds one card inside another. Returns the number of records ammended or an error if the tx fails.

func (*Tx) GetCard

func (tx *Tx) GetCard(c *cs.Card) (*cs.Card, error)

GetCard returns a card based on its identifier. Returns the card or an error if the tx fails.

func (*Tx) RemoveCard

func (tx *Tx) RemoveCard(p, c *cs.Card) (int64, error)

RemoveCard embeds one card inside another. Returns the number of records ammended or an error if the tx fails.

Jump to

Keyboard shortcuts

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