engine

package
v0.0.0-...-bb172f0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypeFieldRegex = regexp.MustCompile("^([a-zA-Z0-9]+):([a-zA-Z0-9]+)$")

Functions

func Inspect

func Inspect(args ...interface{})

Types

type Config

type Config struct {
	*yamlconfig.Config
}

func NewConfig

func NewConfig(cnfName string) (*Config, error)

//////////////////////////////////////////////////////////////////////////////

func (*Config) GetMongoConfig

func (c *Config) GetMongoConfig() (map[string]interface{}, error)

/////////////////////////////////////////////////////////////////////////////////////////////

func (*Config) Init

func (c *Config) Init(cnfName string) error

//////////////////////////////////////////////////////////////////////////////

type Engine

type Engine struct {
	MongoSessionProvider
	// contains filtered or unexported fields
}

//////////////////////////////////////////////////////////////////////////////

func NewEngine

func NewEngine(cnf *Config) (*Engine, error)

//////////////////////////////////////////////////////////////////////////////

func (*Engine) Execute

func (e *Engine) Execute(fn EngineFunc) error

//////////////////////////////////////////////////////////////////////////////

func (*Engine) FieldCreate

func (e *Engine) FieldCreate(fp, tp string) error

//////////////////////////////////////////////////////////////////////////////

func (*Engine) FieldList

func (e *Engine) FieldList(fp string) error

//////////////////////////////////////////////////////////////////////////////

func (*Engine) FieldRemove

func (e *Engine) FieldRemove(fp string) error

//////////////////////////////////////////////////////////////////////////////

func (*Engine) IsTypePresent

func (e *Engine) IsTypePresent(name string) (bool, error)

//////////////////////////////////////////////////////////////////////////////

func (*Engine) TypeCreate

func (e *Engine) TypeCreate(name string) error

//////////////////////////////////////////////////////////////////////////////

func (*Engine) TypeList

func (e *Engine) TypeList() error

//////////////////////////////////////////////////////////////////////////////

func (*Engine) TypeLoad

func (e *Engine) TypeLoad(name string) (*Type, error)

//////////////////////////////////////////////////////////////////////////////

func (*Engine) TypeRemove

func (e *Engine) TypeRemove(name string) error

//////////////////////////////////////////////////////////////////////////////

type EngineFunc

type EngineFunc func(engine *Engine) error

type Field

type Field struct {
	FieldRecord
}

type FieldRecord

type FieldRecord struct {
	Id     bson.ObjectId `bson:"_id" json:"_id"`
	TypeId bson.ObjectId `bson:"tpid" json:"tpid"`
	Name   string        `bson:"nm" json:"nm"`
}

///////////////////////////////////////////////////////////////////////////////////////////////////

type MongoSessionProvider

type MongoSessionProvider struct {
	Session *mgo.Session
}

func (MongoSessionProvider) GetSystemSession

func (p MongoSessionProvider) GetSystemSession(collName string) (*mgo.Session, *mgo.Collection)

type Type

type Type struct {
	TypeRecord
	Engine *Engine
}

func (*Type) IsFieldPresent

func (t *Type) IsFieldPresent(name string) (bool, error)

//////////////////////////////////////////////////////////////////////////////

type TypeRecord

type TypeRecord struct {
	Id   bson.ObjectId `bson:"_id" json:"_id"`
	Name string        `bson:"nm" json:"nm"`
}

///////////////////////////////////////////////////////////////////////////////////////////////////

Jump to

Keyboard shortcuts

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