Documentation
¶
Index ¶
- Variables
- 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
- type Config
- type 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
- 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
- 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
- type EventSchemaPrioritizedSchemaHandlers
- type HTTP
- type Handlers
- type IEnvironment
- type 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
- 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
- type PrioritizedSchemaHandlers
- type Schema
- 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
- type SchemaPrioritizedSchemaHandlers
- type Schemas
- type 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
- 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
- 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{}
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotPointer indicates that a resource was not passed by a pointer ErrNotPointer = errors.New("raw resource must be passed by a pointer") )
Functions ¶
func Finish ¶
func Finish(testReporter gomock.TestReporter)
func GetSchemaID ¶
func NewController ¶
func NewController(testReporter gomock.TestReporter) *gomock.Controller
func NewSchema ¶
func NewSchema(env IEnvironment, raw *gohan_schema.Schema) goext.ISchema
NewSchema allocates a new Schema
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core is an implementation of ICore interface
func (*Core) Clone ¶
func (core *Core) Clone(env *Environment) *Core
Clone allocates a clone of Core; object may be nil
func (*Core) HandleEvent ¶
HandleEvent Causes the given event to be handled within the same environment
func (*Core) RegisterEventHandler ¶
RegisterEventHandler registers a global handler
func (*Core) RegisterSchemaEventHandler ¶
func (core *Core) RegisterSchemaEventHandler(schemaID goext.SchemaID, eventName string, schemaHandler goext.SchemaHandler, priority int)
RegisterSchemaEventHandler registers a schema handler
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database in an implementation of IDatabase
func NewDatabase ¶
NewDatabase creates new database implementation
func (*Database) Begin ¶
func (db *Database) Begin() (goext.ITransaction, error)
Begin starts a new transaction
func (*Database) BeginTx ¶
func (db *Database) BeginTx(ctx goext.Context, options *goext.TxOptions) (goext.ITransaction, error)
BeginTx starts a new transaction with options
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment golang based environment for gohan extensions
func NewEnvironment ¶
func NewEnvironment(name string, beforeStartHook func(env *Environment) error, afterStopHook func(env *Environment)) *Environment
NewEnvironment create new gohan extension rawEnvironment based on context
func (*Environment) Auth ¶
func (env *Environment) Auth() goext.IAuth
Auth returns an implementation of IAuth interface
func (*Environment) Clone ¶
func (env *Environment) Clone() extension.Environment
Clone makes a clone of the rawEnvironment
func (*Environment) Config ¶
func (env *Environment) Config() goext.IConfig
Config returns an implementation of IConfig interface
func (*Environment) Core ¶
func (env *Environment) Core() goext.ICore
Core returns an implementation of ICore interface
func (*Environment) Database ¶
func (env *Environment) Database() goext.IDatabase
Database returns an implementation of IDatabase interface
func (*Environment) HTTP ¶
func (env *Environment) HTTP() goext.IHTTP
HTTP returns an implementation of IHTTP interface
func (*Environment) HandleEvent ¶
func (env *Environment) HandleEvent(event string, context map[string]interface{}) error
HandleEvent handles an event
func (*Environment) Handlers ¶
func (env *Environment) Handlers() EventPrioritizedHandlers
Handlers returns a copy of handlers - used for testing
func (*Environment) IsEventHandled ¶
func (env *Environment) IsEventHandled(event string, context map[string]interface{}) bool
IsEventHandled returns whether a given event is handled by this environment
func (*Environment) Load ¶
func (env *Environment) Load(fileName string) error
Load loads script into the environment
func (*Environment) LoadExtensionsForPath ¶
func (env *Environment) LoadExtensionsForPath(extensions []*schema.Extension, timeLimit time.Duration, timeLimits []*schema.PathEventTimeLimit, path string) error
LoadExtensionsForPath for returns extensions for specific path
func (*Environment) Logger ¶
func (env *Environment) Logger() goext.ILogger
Logger returns an implementation of ILogger interface
func (*Environment) RawTypes ¶
func (env *Environment) RawTypes() map[goext.SchemaID]reflect.Type
RawTypes returns raw types
func (*Environment) RegisterEventHandler ¶
func (env *Environment) RegisterEventHandler(event string, handler goext.Handler, priority int)
RegisterEventHandler registers an event handler
func (*Environment) RegisterRawType ¶
func (env *Environment) RegisterRawType(name goext.SchemaID, typeValue interface{})
RegisterRawType registers a runtime type of raw resource for a given name
func (*Environment) RegisterSchemaEventHandler ¶
func (env *Environment) RegisterSchemaEventHandler(schemaID goext.SchemaID, event string, schemaHandler goext.SchemaHandler, priority int)
RegisterSchemaEventHandler register an event handler for a schema
func (*Environment) RegisterType ¶
func (env *Environment) RegisterType(name goext.SchemaID, typeValue interface{})
RegisterType registers a runtime type of resource for a given name
func (*Environment) Reset ¶
func (env *Environment) Reset()
Reset clear the environment to its initial state
func (*Environment) SchemaHandlers ¶
func (env *Environment) SchemaHandlers() EventSchemaPrioritizedSchemaHandlers
SchemaHandlers returns a copy of handlers - used for testing
func (*Environment) Schemas ¶
func (env *Environment) Schemas() goext.ISchemas
Schemas returns an implementation of ISchemas interface
func (*Environment) SetDatabase ¶
func (env *Environment) SetDatabase(db gohan_db.DB)
SetDatabase sets and binds database implementation
func (*Environment) SetSync ¶
func (env *Environment) SetSync(sync gohan_sync.Sync)
SetSync sets and binds sync implementation
func (*Environment) Start ¶
func (env *Environment) Start() error
Start starts already loaded environment
func (*Environment) Stop ¶
func (env *Environment) Stop()
Stop stops the environment to its initial state
func (*Environment) Sync ¶
func (env *Environment) Sync() goext.ISync
Sync returns an implementation of ISync interface
func (*Environment) Types ¶
func (env *Environment) Types() map[goext.SchemaID]reflect.Type
Types returns types
func (*Environment) Util ¶
func (env *Environment) Util() goext.IUtil
type EventPrioritizedHandlers ¶
type EventPrioritizedHandlers map[string]PrioritizedHandlers
EventPrioritizedHandlers is a per-event prioritized list of generic handlers
type EventSchemaPrioritizedSchemaHandlers ¶
type EventSchemaPrioritizedSchemaHandlers map[string]SchemaPrioritizedSchemaHandlers
EventSchemaPrioritizedSchemaHandlers is a per-event per-schema prioritized list of schema handlers
type HTTP ¶
type HTTP struct{}
HTTP is an implementation of IHTTP
type IEnvironment ¶
type IEnvironment interface { goext.IEnvironment extension.Environment RegisterSchemaEventHandler(schemaID goext.SchemaID, event string, schemaHandler goext.SchemaHandler, priority int) RegisterRawType(name goext.SchemaID, typeValue interface{}) RegisterType(name goext.SchemaID, typeValue interface{}) // contains filtered or unexported methods }
Internal interface for goplugin environment
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is an implementation of ILogger
func (*Logger) Clone ¶
func (logger *Logger) Clone(env *Environment) *Logger
Clone allocates a clone of Logger; object may be nil
type MockIEnvironment ¶
type MockIEnvironment struct {
// contains filtered or unexported fields
}
func NewMockIEnvironment ¶
func NewMockIEnvironment(env *Environment, testReporter gomock.TestReporter) *MockIEnvironment
func (*MockIEnvironment) Auth ¶
func (mockEnv *MockIEnvironment) Auth() goext.IAuth
func (*MockIEnvironment) Clone ¶
func (mockEnv *MockIEnvironment) Clone() extension.Environment
func (*MockIEnvironment) Config ¶
func (mockEnv *MockIEnvironment) Config() goext.IConfig
func (*MockIEnvironment) Core ¶
func (mockEnv *MockIEnvironment) Core() goext.ICore
func (*MockIEnvironment) Database ¶
func (mockEnv *MockIEnvironment) Database() goext.IDatabase
func (*MockIEnvironment) GetController ¶
func (mockEnv *MockIEnvironment) GetController() *gomock.Controller
func (*MockIEnvironment) HTTP ¶
func (mockEnv *MockIEnvironment) HTTP() goext.IHTTP
func (*MockIEnvironment) HandleEvent ¶
func (mockEnv *MockIEnvironment) HandleEvent(event string, context map[string]interface{}) error
func (*MockIEnvironment) IsEventHandled ¶
func (mockEnv *MockIEnvironment) IsEventHandled(event string, context map[string]interface{}) bool
func (*MockIEnvironment) LoadExtensionsForPath ¶
func (mockEnv *MockIEnvironment) LoadExtensionsForPath(extensions []*schema.Extension, timeLimit time.Duration, timeLimits []*schema.PathEventTimeLimit, path string) error
func (*MockIEnvironment) Logger ¶
func (mockEnv *MockIEnvironment) Logger() goext.ILogger
func (*MockIEnvironment) MockAuth ¶
func (mockEnv *MockIEnvironment) MockAuth() *goext.MockIAuth
func (*MockIEnvironment) MockConfig ¶
func (mockEnv *MockIEnvironment) MockConfig() *goext.MockIConfig
func (*MockIEnvironment) MockCore ¶
func (mockEnv *MockIEnvironment) MockCore() *goext.MockICore
func (*MockIEnvironment) MockDatabase ¶
func (mockEnv *MockIEnvironment) MockDatabase() *goext.MockIDatabase
func (*MockIEnvironment) MockHttp ¶
func (mockEnv *MockIEnvironment) MockHttp() *goext.MockIHTTP
func (*MockIEnvironment) MockLogger ¶
func (mockEnv *MockIEnvironment) MockLogger() *goext.MockILogger
func (*MockIEnvironment) MockSchemas ¶
func (mockEnv *MockIEnvironment) MockSchemas() *goext.MockISchemas
func (*MockIEnvironment) MockSync ¶
func (mockEnv *MockIEnvironment) MockSync() *goext.MockISync
func (*MockIEnvironment) MockUtil ¶
func (mockEnv *MockIEnvironment) MockUtil() *goext.MockIUtil
func (*MockIEnvironment) RegisterRawType ¶
func (mockEnv *MockIEnvironment) RegisterRawType(name goext.SchemaID, typeValue interface{})
func (*MockIEnvironment) RegisterSchemaEventHandler ¶
func (mockEnv *MockIEnvironment) RegisterSchemaEventHandler(schemaID goext.SchemaID, event string, schemaHandler goext.SchemaHandler, priority int)
func (*MockIEnvironment) RegisterType ¶
func (mockEnv *MockIEnvironment) RegisterType(name goext.SchemaID, typeValue interface{})
func (*MockIEnvironment) Reset ¶
func (mockEnv *MockIEnvironment) Reset()
func (*MockIEnvironment) Schemas ¶
func (mockEnv *MockIEnvironment) Schemas() goext.ISchemas
func (*MockIEnvironment) SetMockModules ¶
func (mockEnv *MockIEnvironment) SetMockModules(modules goext.MockModules)
func (*MockIEnvironment) Sync ¶
func (mockEnv *MockIEnvironment) Sync() goext.ISync
func (*MockIEnvironment) Util ¶
func (mockEnv *MockIEnvironment) Util() goext.IUtil
type PrioritizedHandlers ¶
PrioritizedHandlers is a prioritized list of generic handlers
type PrioritizedSchemaHandlers ¶
type PrioritizedSchemaHandlers map[int]SchemaHandlers
PrioritizedSchemaHandlers is a prioritized list of schema handlers
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is an implementation of ISchema
func (*Schema) ColumnNames ¶
ColumnNames generates an array that has Gohan style column names
func (*Schema) DbCreateRaw ¶
DbCreateRaw creates a resource without triggering events
func (*Schema) DbDeleteFilterRaw ¶
DbDeleteFilterRaw deletes resource by filter without triggering events
func (*Schema) DbDeleteRaw ¶
DbDeleteRaw deletes resource by ID without triggering events
func (*Schema) DbStateUpdateRaw ¶
func (schema *Schema) DbStateUpdateRaw(rawResource interface{}, requestContext goext.Context, state *goext.ResourceState) error
DbStateUpdateRaw updates states of a raw resource
func (*Schema) DbUpdateRaw ¶
DbUpdateRaw updates a raw resource without triggering events
func (*Schema) DeleteFilterRaw ¶
DeleteFilterRaw deletes resource by filter
func (*Schema) DerivedSchemas ¶
DerivedSchemas returns list of schemas that extend schema with given id
func (*Schema) Fetch ¶
Fetch fetches a resource by ID. Schema, Logger, Environment and pointer to raw resource are required fields in the resource
func (*Schema) FetchFilter ¶
FetchFilter returns a pointer to resource derived from BaseResource Schema, Logger, Environment and pointer to raw resource are required fields in the resource
func (*Schema) FetchFilterRaw ¶
func (schema *Schema) FetchFilterRaw(filter goext.Filter, context goext.Context) (interface{}, error)
FetchFilterRaw returns a pointer to raw resource, containing db annotations
func (*Schema) List ¶
func (schema *Schema) List(filter goext.Filter, paginator *goext.Paginator, context goext.Context) ([]interface{}, error)
List returns list of resources. Schema, Logger, Environment and pointer to raw resource are required fields in the resource
func (*Schema) ListRaw ¶
func (schema *Schema) ListRaw(filter goext.Filter, paginator *goext.Paginator, requestContext goext.Context) ([]interface{}, error)
ListRaw lists schema raw resources
func (*Schema) LockFetch ¶
func (schema *Schema) LockFetch(id string, context goext.Context, policy goext.LockPolicy) (interface{}, error)
LockFetch fetches a resource by ID. Schema, Logger, Environment and pointer to raw resource are required fields in the resource
func (*Schema) LockFetchFilter ¶
func (schema *Schema) LockFetchFilter(filter goext.Filter, context goext.Context, policy goext.LockPolicy) (interface{}, error)
LockFetchFilter returns a pointer to locked resource derived from BaseResource, containing db annotations Schema, Logger, Environment and pointer to raw resource are required fields in the resource
func (*Schema) LockFetchFilterRaw ¶
func (schema *Schema) LockFetchFilterRaw(filter goext.Filter, context goext.Context, policy goext.LockPolicy) (interface{}, error)
LockFetchFilterRaw returns a pointer to locked raw resource, containing db annotations
func (*Schema) LockFetchRaw ¶
func (schema *Schema) LockFetchRaw(id string, context goext.Context, policy goext.LockPolicy) (interface{}, error)
LockFetchRaw locks and fetches resource by ID
func (*Schema) LockList ¶
func (schema *Schema) LockList(filter goext.Filter, paginator *goext.Paginator, context goext.Context, policy goext.LockPolicy) ([]interface{}, error)
LockList locks and returns list of resources. Schema, Logger, Environment and pointer to raw resource are required fields in the resource
func (*Schema) LockListRaw ¶
func (schema *Schema) LockListRaw(filter goext.Filter, paginator *goext.Paginator, requestContext goext.Context, policy goext.LockPolicy) ([]interface{}, error)
LockListRaw locks and returns raw resources
func (*Schema) Properties ¶
Properties returns properties of schema
func (*Schema) RegisterCustomEventHandler ¶
func (schema *Schema) RegisterCustomEventHandler(event goext.CustomEvent, handler goext.Handler, priority int)
RegisterCustomEventHandler registers an event handler without resource for a custom event with given priority
func (*Schema) RegisterRawType ¶
func (schema *Schema) RegisterRawType(typeValue interface{})
RegisterRawType registers a runtime type for a raw resource
func (*Schema) RegisterResourceEventHandler ¶
func (schema *Schema) RegisterResourceEventHandler(event goext.ResourceEvent, schemaHandler goext.SchemaHandler, priority int)
RegisterResourceEventHandler registers a schema handler
func (*Schema) RegisterType ¶
func (schema *Schema) RegisterType(resourceType goext.IResourceBase)
RegisterType registers a runtime type for a resource
func (*Schema) RegisterTypes ¶
func (schema *Schema) RegisterTypes(rawResourceType interface{}, resourceType goext.IResourceBase)
RegisterTypes registers both resource types derived from IResourceBase and raw containing db annotations
func (*Schema) ResourceFromMap ¶
ResourceFromMap converts mapped representation to structure representation of the resource registered for schema
func (*Schema) StateFetchRaw ¶
func (schema *Schema) StateFetchRaw(id string, requestContext goext.Context) (goext.ResourceState, error)
StateFetchRaw returns a resource state
type SchemaHandlers ¶
type SchemaHandlers []goext.SchemaHandler
SchemaHandlers is a list of schema handlers
type SchemaPrioritizedSchemaHandlers ¶
type SchemaPrioritizedSchemaHandlers map[goext.SchemaID]PrioritizedSchemaHandlers
SchemaPrioritizedSchemaHandlers is a per-schema prioritized list of schema handlers
type Schemas ¶
type Schemas struct {
// contains filtered or unexported fields
}
Schemas in an implementation of ISchemas
func (*Schemas) Clone ¶
func (schemas *Schemas) Clone(env *Environment) *Schemas
Clone allocates a clone of Schemas; object may be nil
type Sync ¶
type Sync struct {
// contains filtered or unexported fields
}
Sync is an implementation of ISync
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction is common interface for handling transaction
func (*Transaction) Closed ¶
func (t *Transaction) Closed() bool
Closed return whether the transaction is closed
func (*Transaction) Commit ¶
func (t *Transaction) Commit() error
Commit performs a commit of the transaction
func (*Transaction) Create ¶
func (t *Transaction) Create(ctx context.Context, s goext.ISchema, resource map[string]interface{}) error
Create creates a new resource
func (*Transaction) Delete ¶
func (t *Transaction) Delete(ctx context.Context, schema goext.ISchema, resourceID interface{}) error
Delete deletes an existing resource
func (*Transaction) Exec ¶
func (t *Transaction) Exec(ctx context.Context, query string, args ...interface{}) error
Exec performs an exec in transaction
func (*Transaction) Fetch ¶
func (t *Transaction) Fetch(ctx context.Context, schema goext.ISchema, filter goext.Filter) (map[string]interface{}, error)
Fetch fetches an existing resource
func (*Transaction) GetIsolationLevel ¶
func (t *Transaction) GetIsolationLevel() goext.Type
GetIsolationLevel returns the isolation level of the transaction
func (*Transaction) List ¶
func (t *Transaction) List(ctx context.Context, schema goext.ISchema, filter goext.Filter, listOptions *goext.ListOptions, paginator *goext.Paginator) ([]map[string]interface{}, uint64, error)
List lists existing resources
func (*Transaction) LockFetch ¶
func (t *Transaction) LockFetch(ctx context.Context, schema goext.ISchema, filter goext.Filter, lockPolicy goext.LockPolicy) (map[string]interface{}, error)
LockFetch locks and fetches an existing resource
func (*Transaction) LockList ¶
func (t *Transaction) LockList(ctx context.Context, schema goext.ISchema, filter goext.Filter, listOptions *goext.ListOptions, paginator *goext.Paginator, lockingPolicy goext.LockPolicy) ([]map[string]interface{}, uint64, error)
LockList locks and lists existing resources
func (*Transaction) Query ¶
func (t *Transaction) Query(ctx context.Context, schema goext.ISchema, query string, args []interface{}) (list []map[string]interface{}, err error)
Query executes a query
func (*Transaction) RawTransaction ¶
func (t *Transaction) RawTransaction() interface{}
RawTransaction returns the raw transaction
func (*Transaction) StateFetch ¶
func (t *Transaction) StateFetch(ctx context.Context, schema goext.ISchema, filter goext.Filter) (goext.ResourceState, error)
StateFetch fetches the state of an existing resource
func (*Transaction) StateUpdate ¶
func (t *Transaction) StateUpdate(ctx context.Context, s goext.ISchema, resource map[string]interface{}, resourceState *goext.ResourceState) error
StateUpdate updates state of an existing resource
type Util ¶
type Util struct { }
func (*Util) GetTransaction ¶
func (*Util) ResourceFromMapForType ¶
func (util *Util) ResourceFromMapForType(context map[string]interface{}, rawResource interface{}) (goext.Resource, error)
ResourceFromMapForType converts mapped representation to structure representation of the resource for given type
func (*Util) ResourceToMap ¶
ResourceToMap converts structure representation of the resource to mapped representation