resource

package
v0.0.0-...-5001978 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FutureRAM

type FutureRAM struct {
	RAM *RAM
}

func (*FutureRAM) Combine

func (fr *FutureRAM) Combine(f Future) error

func (*FutureRAM) ShouldCombine

func (fr *FutureRAM) ShouldCombine(f Future) bool

commands to FutureRAM should never be combined as it would not be more efficient

func (*FutureRAM) Work

func (fr *FutureRAM) Work(ef *ExecutableFuture)

func (*FutureRAM) WorkFindByIds

func (fr *FutureRAM) WorkFindByIds(ef *ExecutableFuture, req *FutureRequest, k *FutureRequestKindFindByIds)

type FutureSQL

type FutureSQL struct {
	Resource      *SQL
	Children      []*FutureSQL
	Limit, Offset uint
}

func (*FutureSQL) Combine

func (f *FutureSQL) Combine(n Future) error

func (*FutureSQL) PrepareQuery

func (f *FutureSQL) PrepareQuery(parameters ...SQLExpression) (query string, arguments []interface{}, is_single bool)

func (*FutureSQL) RunQuery

func (f *FutureSQL) RunQuery(pf *ExecutableFuture, req *FutureRequest, parameters []SQLExpression) ([]*Record, bool, *OError)

func (*FutureSQL) ShouldCombine

func (f *FutureSQL) ShouldCombine(n Future) bool

func (*FutureSQL) Work

func (f *FutureSQL) Work(pf *ExecutableFuture)

func (*FutureSQL) WorkDeleteByIds

func (f *FutureSQL) WorkDeleteByIds(pf *ExecutableFuture, req *FutureRequest, k *FutureRequestKindDeleteByIds)

func (*FutureSQL) WorkFindByFields

func (f *FutureSQL) WorkFindByFields(pf *ExecutableFuture, req *FutureRequest, k *FutureRequestKindFindByAnyFields)

func (*FutureSQL) WorkFindByIds

func (f *FutureSQL) WorkFindByIds(pf *ExecutableFuture, req *FutureRequest, k *FutureRequestKindFindByIds)

type RAM

type RAM struct {
	Data map[string][]byte
	Type reflect.Type
}

func NewRAM

func NewRAM(datatype interface{}) *RAM

func (*RAM) Get

func (r *RAM) Get(key string) interface{}

func (*RAM) GetFuture

func (r *RAM) GetFuture() Future

func (*RAM) Push

func (r *RAM) Push(key string, value interface{})

type SQL

type SQL struct {
	DB    *sql.DB
	Table string
	Type  reflect.Type
}

func NewSQL

func NewSQL(db *sql.DB, table string, t interface{}) *SQL

func (*SQL) GetFieldByName

func (sr *SQL) GetFieldByName(v interface{}, field string) string

func (*SQL) GetFuture

func (sr *SQL) GetFuture() Future

func (*SQL) GetIdFieldName

func (sr *SQL) GetIdFieldName(v interface{}) string

func (*SQL) GetPromise

func (sr *SQL) GetPromise(r *Request) (LeasedPromise, *SQLPromise)
func(sr *SQL) ParseJSON(r *Request, src *Record, raw []byte) (*Record) {
    return ParseJSONHelper(src, raw, sr.Type);
}

type SQLEquals

type SQLEquals struct {
	Field string
	Value interface{}
}

func NewSQLEquals

func NewSQLEquals(field string, value interface{}) *SQLEquals

func (*SQLEquals) Express

func (equals *SQLEquals) Express(q *SQLQuery)

type SQLExpression

type SQLExpression interface {
	Express(*SQLQuery)
}

type SQLLiteral

type SQLLiteral struct {
	Expression string
}

func (*SQLLiteral) Express

func (literal *SQLLiteral) Express(q *SQLQuery)

type SQLLogic

type SQLLogic struct {
	Expressions []SQLExpression
	Keyword     string
}

func NewSQLAnd

func NewSQLAnd(exprs ...SQLExpression) *SQLLogic

func NewSQLLogic

func NewSQLLogic(keyword string, exprs []SQLExpression) *SQLLogic

func NewSQLOr

func NewSQLOr(exprs ...SQLExpression) *SQLLogic

func (*SQLLogic) Express

func (logic *SQLLogic) Express(q *SQLQuery)

type SQLPromise

type SQLPromise struct {
	Transactions map[*sql.DB]*sql.Tx
}

func (*SQLPromise) Failure

func (rsp *SQLPromise) Failure(r *Request)

func (*SQLPromise) GetSQLTransaction

func (rsp *SQLPromise) GetSQLTransaction(db *sql.DB) (*sql.Tx, error)

func (*SQLPromise) Success

func (rsp *SQLPromise) Success(r *Request)

type SQLQuery

type SQLQuery struct {
	Query        string
	FmtArguments []interface{}
	SqlArguments []interface{}
}

func (*SQLQuery) PrepareQuery

func (q *SQLQuery) PrepareQuery() string

type SQLWhere

type SQLWhere struct {
	Expression SQLExpression
}

func NewSQLWhere

func NewSQLWhere(expr SQLExpression) *SQLWhere

func (*SQLWhere) Express

func (where *SQLWhere) Express(q *SQLQuery)

Jump to

Keyboard shortcuts

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