beerapi: github.com/baruchlubinsky/beerapi/adapters Index | Files

package adapters

import "github.com/baruchlubinsky/beerapi/adapters"

Package adapters contains the interfaces required to define a general database adapter. See beerapi/db for documentation.

Index

Package Files

adapters.go

type Database Uses

type Database interface {
    Table(string) (Table, error)
}

type Model Uses

type Model interface {
    GetId() string
    Attributes() map[string]interface{}
    SetAttributes(map[string]interface{})
    Save() error
    Delete() error
}

type ModelSet Uses

type ModelSet []Model

func (*ModelSet) Add Uses

func (set *ModelSet) Add(model Model)

type Table Uses

type Table interface {
    Find(string) (Model, error)
    // If query == nil, return entire contents of table.
    Search(query interface{}) (result ModelSet)
    NewRecord() Model
    Delete(string) error
    RecordName() string
    RecordSetName() string
}

Package adapters is imported by 4 packages. Updated 2016-07-30. Refresh now. Tools for package owners.