Versions in this module Expand all Collapse all v1 v1.0.0 Jul 17, 2018 Changes in this version + var ErrNotPointer = errors.New("raw resource must be passed by a pointer") + func Finish(testReporter gomock.TestReporter) + func GetSchemaID(schemaID interface{}) goext.SchemaID + func NewController(testReporter gomock.TestReporter) *gomock.Controller + func NewSchema(env IEnvironment, raw *gohan_schema.Schema) goext.ISchema + type Auth struct + func (a *Auth) GetTenantName(context goext.Context) string + func (a *Auth) HasRole(context goext.Context, principal string) bool + func (a *Auth) IsAdmin(context goext.Context) bool + type Config struct + func (config *Config) Config(key string, defaultValue interface{}) interface{} + type Core struct + func NewCore(env *Environment) *Core + func (core *Core) Clone(env *Environment) *Core + func (core *Core) HandleEvent(event string, context goext.Context) error + func (core *Core) RegisterEventHandler(eventName string, handler goext.Handler, priority int) + func (core *Core) RegisterSchemaEventHandler(schemaID goext.SchemaID, eventName string, schemaHandler goext.SchemaHandler, ...) + func (core *Core) TriggerEvent(event string, context goext.Context) error + type Database struct + func NewDatabase(db gohan_db.DB) *Database + func (db *Database) Begin() (goext.ITransaction, error) + func (db *Database) BeginTx(ctx goext.Context, options *goext.TxOptions) (goext.ITransaction, error) + func (db *Database) Clone() *Database + func (db *Database) Options() goext.DbOptions + func (db *Database) Within(context goext.Context, fn func(tx goext.ITransaction) error) error + func (db *Database) WithinTx(context goext.Context, options *goext.TxOptions, ...) error + type Environment struct + func NewEnvironment(name string, beforeStartHook func(env *Environment) error, ...) *Environment + func (env *Environment) Auth() goext.IAuth + func (env *Environment) Clone() extension.Environment + func (env *Environment) Config() goext.IConfig + func (env *Environment) Core() goext.ICore + func (env *Environment) Database() goext.IDatabase + func (env *Environment) HTTP() goext.IHTTP + func (env *Environment) HandleEvent(event string, context map[string]interface{}) error + func (env *Environment) Handlers() EventPrioritizedHandlers + func (env *Environment) IsEventHandled(event string, context map[string]interface{}) bool + func (env *Environment) Load(fileName string) error + func (env *Environment) LoadExtensionsForPath(extensions []*schema.Extension, timeLimit time.Duration, ...) error + func (env *Environment) Logger() goext.ILogger + func (env *Environment) RawTypes() map[goext.SchemaID]reflect.Type + func (env *Environment) RegisterEventHandler(event string, handler goext.Handler, priority int) + func (env *Environment) RegisterRawType(name goext.SchemaID, typeValue interface{}) + func (env *Environment) RegisterSchemaEventHandler(schemaID goext.SchemaID, event string, schemaHandler goext.SchemaHandler, ...) + func (env *Environment) RegisterType(name goext.SchemaID, typeValue interface{}) + func (env *Environment) Reset() + func (env *Environment) SchemaHandlers() EventSchemaPrioritizedSchemaHandlers + func (env *Environment) Schemas() goext.ISchemas + func (env *Environment) SetDatabase(db gohan_db.DB) + func (env *Environment) SetSync(sync gohan_sync.Sync) + func (env *Environment) Start() error + func (env *Environment) Stop() + func (env *Environment) Sync() goext.ISync + func (env *Environment) Types() map[goext.SchemaID]reflect.Type + func (env *Environment) Util() goext.IUtil + type EventPrioritizedHandlers map[string]PrioritizedHandlers + type EventSchemaPrioritizedSchemaHandlers map[string]SchemaPrioritizedSchemaHandlers + type HTTP struct + func (http *HTTP) Request(ctx context.Context, method, rawURL string, headers map[string]interface{}, ...) (*goext.Response, error) + func (http *HTTP) RequestRaw(ctx context.Context, method, rawURL string, headers map[string]string, ...) (*goext.Response, error) + type Handlers []goext.Handler + type IEnvironment interface + RegisterRawType func(name goext.SchemaID, typeValue interface{}) + RegisterSchemaEventHandler func(schemaID goext.SchemaID, event string, schemaHandler goext.SchemaHandler, ...) + RegisterType func(name goext.SchemaID, typeValue interface{}) + type Logger struct + func NewLogger(env IEnvironment) *Logger + func (logger *Logger) Clone(env *Environment) *Logger + func (logger *Logger) Critical(format string) + func (logger *Logger) Criticalf(format string, args ...interface{}) + func (logger *Logger) Debug(format string) + func (logger *Logger) Debugf(format string, args ...interface{}) + func (logger *Logger) Error(format string) + func (logger *Logger) Errorf(format string, args ...interface{}) + func (logger *Logger) Info(format string) + func (logger *Logger) Infof(format string, args ...interface{}) + func (logger *Logger) Notice(format string) + func (logger *Logger) Noticef(format string, args ...interface{}) + func (logger *Logger) Warning(format string) + func (logger *Logger) Warningf(format string, args ...interface{}) + type MockIEnvironment struct + func NewMockIEnvironment(env *Environment, testReporter gomock.TestReporter) *MockIEnvironment + func (mockEnv *MockIEnvironment) Auth() goext.IAuth + func (mockEnv *MockIEnvironment) Clone() extension.Environment + func (mockEnv *MockIEnvironment) Config() goext.IConfig + func (mockEnv *MockIEnvironment) Core() goext.ICore + func (mockEnv *MockIEnvironment) Database() goext.IDatabase + func (mockEnv *MockIEnvironment) GetController() *gomock.Controller + func (mockEnv *MockIEnvironment) HTTP() goext.IHTTP + func (mockEnv *MockIEnvironment) HandleEvent(event string, context map[string]interface{}) error + func (mockEnv *MockIEnvironment) IsEventHandled(event string, context map[string]interface{}) bool + func (mockEnv *MockIEnvironment) LoadExtensionsForPath(extensions []*schema.Extension, timeLimit time.Duration, ...) error + func (mockEnv *MockIEnvironment) Logger() goext.ILogger + func (mockEnv *MockIEnvironment) MockAuth() *goext.MockIAuth + func (mockEnv *MockIEnvironment) MockConfig() *goext.MockIConfig + func (mockEnv *MockIEnvironment) MockCore() *goext.MockICore + func (mockEnv *MockIEnvironment) MockDatabase() *goext.MockIDatabase + func (mockEnv *MockIEnvironment) MockHttp() *goext.MockIHTTP + func (mockEnv *MockIEnvironment) MockLogger() *goext.MockILogger + func (mockEnv *MockIEnvironment) MockSchemas() *goext.MockISchemas + func (mockEnv *MockIEnvironment) MockSync() *goext.MockISync + func (mockEnv *MockIEnvironment) MockUtil() *goext.MockIUtil + func (mockEnv *MockIEnvironment) RegisterRawType(name goext.SchemaID, typeValue interface{}) + func (mockEnv *MockIEnvironment) RegisterSchemaEventHandler(schemaID goext.SchemaID, event string, schemaHandler goext.SchemaHandler, ...) + func (mockEnv *MockIEnvironment) RegisterType(name goext.SchemaID, typeValue interface{}) + func (mockEnv *MockIEnvironment) Reset() + func (mockEnv *MockIEnvironment) Schemas() goext.ISchemas + func (mockEnv *MockIEnvironment) SetMockModules(modules goext.MockModules) + func (mockEnv *MockIEnvironment) Sync() goext.ISync + func (mockEnv *MockIEnvironment) Util() goext.IUtil + type PrioritizedHandlers map[int]Handlers + type PrioritizedSchemaHandlers map[int]SchemaHandlers + type Schema struct + func (schema *Schema) ColumnNames() []string + func (schema *Schema) Count(filter goext.Filter, requestContext goext.Context) (uint64, error) + func (schema *Schema) CreateRaw(rawResource interface{}, context goext.Context) error + func (schema *Schema) DbCreateRaw(rawResource interface{}, context goext.Context) error + func (schema *Schema) DbDeleteFilterRaw(filter goext.Filter, context goext.Context) error + func (schema *Schema) DbDeleteRaw(id string, context goext.Context) error + func (schema *Schema) DbStateUpdateRaw(rawResource interface{}, requestContext goext.Context, ...) error + func (schema *Schema) DbUpdateRaw(rawResource interface{}, context goext.Context) error + func (schema *Schema) DeleteFilterRaw(filter goext.Filter, context goext.Context) error + func (schema *Schema) DeleteRaw(id string, context goext.Context) error + func (schema *Schema) DerivedSchemas() []goext.ISchema + func (schema *Schema) Extends() []goext.SchemaID + func (schema *Schema) Fetch(id string, context goext.Context) (interface{}, error) + func (schema *Schema) FetchFilter(filter goext.Filter, context goext.Context) (interface{}, error) + func (schema *Schema) FetchFilterRaw(filter goext.Filter, context goext.Context) (interface{}, error) + func (schema *Schema) FetchRaw(id string, context goext.Context) (interface{}, error) + func (schema *Schema) ID() goext.SchemaID + func (schema *Schema) List(filter goext.Filter, paginator *goext.Paginator, context goext.Context) ([]interface{}, error) + func (schema *Schema) ListRaw(filter goext.Filter, paginator *goext.Paginator, requestContext goext.Context) ([]interface{}, error) + func (schema *Schema) LockFetch(id string, context goext.Context, policy goext.LockPolicy) (interface{}, error) + func (schema *Schema) LockFetchFilter(filter goext.Filter, context goext.Context, policy goext.LockPolicy) (interface{}, error) + func (schema *Schema) LockFetchFilterRaw(filter goext.Filter, context goext.Context, policy goext.LockPolicy) (interface{}, error) + func (schema *Schema) LockFetchRaw(id string, context goext.Context, policy goext.LockPolicy) (interface{}, error) + func (schema *Schema) LockList(filter goext.Filter, paginator *goext.Paginator, context goext.Context, ...) ([]interface{}, error) + func (schema *Schema) LockListRaw(filter goext.Filter, paginator *goext.Paginator, requestContext goext.Context, ...) ([]interface{}, error) + func (schema *Schema) Properties() []goext.Property + func (schema *Schema) RawSchema() interface{} + func (schema *Schema) RegisterCustomEventHandler(event goext.CustomEvent, handler goext.Handler, priority int) + func (schema *Schema) RegisterRawType(typeValue interface{}) + func (schema *Schema) RegisterResourceEventHandler(event goext.ResourceEvent, schemaHandler goext.SchemaHandler, priority int) + func (schema *Schema) RegisterType(resourceType goext.IResourceBase) + func (schema *Schema) RegisterTypes(rawResourceType interface{}, resourceType goext.IResourceBase) + func (schema *Schema) ResourceFromMap(context map[string]interface{}) (goext.Resource, error) + func (schema *Schema) StateFetchRaw(id string, requestContext goext.Context) (goext.ResourceState, error) + func (schema *Schema) UpdateRaw(rawResource interface{}, context goext.Context) error + type SchemaHandlers []goext.SchemaHandler + type SchemaPrioritizedSchemaHandlers map[goext.SchemaID]PrioritizedSchemaHandlers + type Schemas struct + func NewSchemas(env IEnvironment) *Schemas + func (schemas *Schemas) Clone(env *Environment) *Schemas + func (schemas *Schemas) Find(id goext.SchemaID) goext.ISchema + func (schemas *Schemas) List() []goext.ISchema + func (schemas *Schemas) Relations(id goext.SchemaID) []goext.SchemaRelationInfo + type Sync struct + func NewSync(sync gohan_sync.Sync) *Sync + func (sync *Sync) Clone() *Sync + func (sync *Sync) Delete(path string, prefix bool) error + func (sync *Sync) Fetch(path string) (*goext.Node, error) + func (sync *Sync) Update(path string, json string) error + func (sync *Sync) Watch(ctx context.Context, path string, timeout time.Duration, revision int64) ([]*goext.Event, error) + type Transaction struct + func (t *Transaction) Close() error + func (t *Transaction) Closed() bool + func (t *Transaction) Commit() error + func (t *Transaction) Count(ctx context.Context, schema goext.ISchema, filter goext.Filter) (uint64, error) + func (t *Transaction) Create(ctx context.Context, s goext.ISchema, resource map[string]interface{}) error + func (t *Transaction) Delete(ctx context.Context, schema goext.ISchema, resourceID interface{}) error + func (t *Transaction) Exec(ctx context.Context, query string, args ...interface{}) error + func (t *Transaction) Fetch(ctx context.Context, schema goext.ISchema, filter goext.Filter) (map[string]interface{}, error) + func (t *Transaction) GetIsolationLevel() goext.Type + func (t *Transaction) List(ctx context.Context, schema goext.ISchema, filter goext.Filter, ...) ([]map[string]interface{}, uint64, error) + func (t *Transaction) LockFetch(ctx context.Context, schema goext.ISchema, filter goext.Filter, ...) (map[string]interface{}, error) + func (t *Transaction) LockList(ctx context.Context, schema goext.ISchema, filter goext.Filter, ...) ([]map[string]interface{}, uint64, error) + func (t *Transaction) Query(ctx context.Context, schema goext.ISchema, query string, args []interface{}) (list []map[string]interface{}, err error) + func (t *Transaction) RawTransaction() interface{} + func (t *Transaction) StateFetch(ctx context.Context, schema goext.ISchema, filter goext.Filter) (goext.ResourceState, error) + func (t *Transaction) StateUpdate(ctx context.Context, s goext.ISchema, resource map[string]interface{}, ...) error + func (t *Transaction) Update(ctx context.Context, s goext.ISchema, resource map[string]interface{}) error + type Util struct + func (util *Util) Clone() *Util + func (util *Util) GetTransaction(context goext.Context) (goext.ITransaction, bool) + func (util *Util) NewUUID() string + func (util *Util) ResourceFromMapForType(context map[string]interface{}, rawResource interface{}) (goext.Resource, error) + func (util *Util) ResourceToMap(resource interface{}) map[string]interface{}