dal

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2014 License: Apache-2.0 Imports: 3 Imported by: 16

README

dal

Data access layer abstraction for go incremental applications. Currently only supports mongo via mgo.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("ErrNotFound")

Functions

This section is empty.

Types

type BSON

type BSON map[string]interface{}

type Collection

type Collection interface {
	Find(BSON) Query
}

type DAL

type DAL interface {
	Connect(string) (Session, error)
}

func NewDAL

func NewDAL() DAL

type Database

type Database interface {
	C(string) Collection
}

type Iter

type Iter interface {
	Next(interface{}) bool
}

type ObjectId

type ObjectId string

func (ObjectId) GetBSON

func (id ObjectId) GetBSON() (interface{}, error)

func (ObjectId) Hex

func (id ObjectId) Hex() string

func (ObjectId) Valid

func (id ObjectId) Valid() bool

type Query

type Query interface {
	One(interface{}) error
	Sort(...string) Query
	Iter() Iter
}

type Session

type Session interface {
	Clone() Session
	Close()
	DB(s string) Database
}

Jump to

Keyboard shortcuts

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