database

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

View Source
const (
	TIMEOUT = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	Date      ttime   `bson:"date"`
	Payee     string  `bson:"payee"`
	Desc      string  `bson:"desc"`
	Amount    float32 `bson:"amount"`
	Label     string  `bson:"label"`
	Hash      string  `bson:"hash"`
	Datasheet string  `bson:"datasheet"`
}

type Database

type Database struct {
	Err error
	// contains filtered or unexported fields
}

func New

func New(address, database, collection string) *Database

func (*Database) Content

func (db *Database) Content(filter ...string) ([]Content, error)

func (*Database) Delete

func (db *Database) Delete() (int64, error)

func (*Database) Document

func (db *Database) Document(key, value string) (Content, error)

func (*Database) Hash

func (db *Database) Hash(content interface{}) string

func (*Database) Labels

func (db *Database) Labels(label string) ([]interface{}, error)

func (*Database) Print

func (db *Database) Print(content interface{})

func (*Database) Save

func (db *Database) Save(document Content) error

func (*Database) Update

func (db *Database) Update(old, new Content) error

Jump to

Keyboard shortcuts

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