Documentation
¶
Overview ¶
Package internal contains neuron internal variables and interfaces, used by multiple packages.
Index ¶
Constants ¶
const ( // Create processes ProcessHookBeforeCreate = "hook_before_create" ProcessSetBelongsToRelations = "set_belongs_to_relations" ProcessSetCreatedAt = "set_created_at" ProcessCreate = "create" ProcessStoreScopePrimaries = "store_scope_primaries" ProcessPatchForeignRelations = "patch_foreign_relations" ProcessPatchForeignRelationsSafe = "patch_foreign_relationships_safe" ProcessHookAfterCreate = "hook_after_create" // Get processes ProcessFillEmptyFieldset = "fill_empty_fieldset" ProcessDeletedAtFilter = "deleted_at_filter" ProcessConvertRelationFilters = "convert_relation_filters" ProcessConvertRelationFiltersSafe = "convert_relation_filters_safe" ProcessHookBeforeGet = "hook_before_get" ProcessGet = "get" ProcessGetForeignRelations = "get_foreign_relations" ProcessGetForeignRelationsSafe = "get_foreign_relations_safe" ProcessHookAfterGet = "hook_after_get" // List processes ProcessCheckPagination = "check_pagination" ProcessHookBeforeList = "hook_before_list" ProcessList = "list" ProcessHookAfterList = "hook_after_list" ProcessGetIncluded = "get_included" ProcessGetIncludedSafe = "get_included_safe" // Patch processes ProcessHookBeforePatch = "hook_before_patch" ProcessSetUpdatedAt = "set_updated_at" ProcessPatch = "patch" ProcessHookAfterPatch = "hook_after_patch" ProcessPatchBelongsToRelations = "patch_belongs_to_relations" // Delete processes ProcessReducePrimaryFilters = "reduce_primary_filters" ProcessHookBeforeDelete = "hook_before_delete" ProcessSetDeletedAt = "set_deleted_at" ProcessDelete = "delete" ProcessHookAfterDelete = "hook_after_delete" ProcessDeleteForeignRelations = "delete_foreign_relations" ProcessDeleteForeignRelationsSafe = "delete_foreign_relations_safe" // Transaction processes ProcessTxBegin = "tx_begin" ProcessTxCommitOrRollback = "tx_commit_or_rollback" // Count Processess ProcessHookBeforeCount = "hook_before_ount" ProcessCount = "count" ProcessHookAfterCount = "hook_after_count" )
Processes constant names.
Variables ¶
var ( // ControllerStoreKey is the store key used to store the controller. ControllerStoreKey = ControllerStoreKeyStruct{} // TxStateStoreKey is the store key used to store the scope's transaction. TxStateStoreKey = TxStateStoreStruct{} // ReducedPrimariesStoreKey is the store key used to store the reduced // scope primary values. ReducedPrimariesStoreKey = ReducedPrimariesStoreStruct{} // PrimariesAlreadyChecked is the store key flag value used to notify that // the primaries for given process chain were already checked. PrimariesAlreadyChecked = primariesChecked{} // PreviousProcessStoreKey is the store key used to indicate what was the // previous query process. PreviousProcessStoreKey = PreviousProcess{} // AutoBeginStoreKey is the key that defines if query were started // with begin_transaction process. AutoBeginStoreKey = autoBegin{} // JustCreated is the store key that defines that the root scope's process is just after the creation process. JustCreated = created{} )
Store keys
var Processes = map[string]struct{}{
ProcessHookBeforeCreate: struct{}{},
ProcessSetBelongsToRelations: struct{}{},
ProcessSetCreatedAt: struct{}{},
ProcessCreate: struct{}{},
ProcessStoreScopePrimaries: struct{}{},
ProcessPatchForeignRelations: struct{}{},
ProcessPatchForeignRelationsSafe: struct{}{},
ProcessHookAfterCreate: struct{}{},
ProcessFillEmptyFieldset: struct{}{},
ProcessDeletedAtFilter: struct{}{},
ProcessConvertRelationFilters: struct{}{},
ProcessConvertRelationFiltersSafe: struct{}{},
ProcessHookBeforeGet: struct{}{},
ProcessGet: struct{}{},
ProcessGetForeignRelations: struct{}{},
ProcessGetForeignRelationsSafe: struct{}{},
ProcessHookAfterGet: struct{}{},
ProcessCheckPagination: struct{}{},
ProcessHookBeforeList: struct{}{},
ProcessList: struct{}{},
ProcessHookAfterList: struct{}{},
ProcessGetIncluded: struct{}{},
ProcessGetIncludedSafe: struct{}{},
ProcessSetUpdatedAt: struct{}{},
ProcessHookBeforePatch: struct{}{},
ProcessPatch: struct{}{},
ProcessHookAfterPatch: struct{}{},
ProcessPatchBelongsToRelations: struct{}{},
ProcessReducePrimaryFilters: struct{}{},
ProcessHookBeforeDelete: struct{}{},
ProcessSetDeletedAt: struct{}{},
ProcessDelete: struct{}{},
ProcessHookAfterDelete: struct{}{},
ProcessDeleteForeignRelations: struct{}{},
ProcessDeleteForeignRelationsSafe: struct{}{},
ProcessTxBegin: struct{}{},
ProcessTxCommitOrRollback: struct{}{},
ProcessHookBeforeCount: struct{}{},
ProcessCount: struct{}{},
ProcessHookAfterCount: struct{}{},
}
Processes is a mapping of the already registered query processes name.
Functions ¶
This section is empty.
Types ¶
type AttributeGetter ¶ added in v0.2.1
type AttributeGetter interface {
GetAttribute(name string) interface{}
}
AttributeGetter is the interface used to get the attribute value from the model instance.
type AttributeModel ¶ added in v0.2.1
type AttributeModel interface { AttributeGetter AttributeSetter }
AttributeModel is the interface used for models that are allowed to get and set their attribute fields.
type AttributeSetter ¶ added in v0.2.1
AttributeSetter sets the attribute value for given model instance.
type ControllerStoreKeyStruct ¶ added in v0.2.1
type ControllerStoreKeyStruct struct{}
ControllerStoreKeyStruct is the common struct used as a controller's key in the Stores.
type ForeignKeyGetter ¶ added in v0.2.1
type ForeignKeyGetter interface {
GetForeignKey(name string) interface{}
}
ForeignKeyGetter is the interface used to get the value of the foreign key field with given name from the model instance.
type ForeignKeyModel ¶ added in v0.2.1
type ForeignKeyModel interface { ForeignKeyGetter ForeignKeySetter }
ForeignKeyModel is the interface used for getting and setting the value of foreign key fields for given model.
type ForeignKeySetter ¶ added in v0.2.1
ForeignKeySetter is the interface used to set the value of the foreign key field for the provided name for the model instance
type IDGetter ¶ added in v0.2.1
type IDGetter interface {
GetID() interface{}
}
IDGetter is the interface used to get the ID from the model instance.
type IDModel ¶ added in v0.2.1
IDModel is the interface that is allowed to get and set the ID field.
type IDSetter ¶ added in v0.2.1
type IDSetter interface {
SetID(id interface{}) error
}
IDSetter is the interface used to set the ID for the model instance.
type PreviousProcess ¶ added in v0.2.1
type PreviousProcess struct{}
PreviousProcess is a struct used as the Store key for getting the previous process.
type ReducedPrimariesStoreStruct ¶ added in v0.2.1
type ReducedPrimariesStoreStruct struct{}
ReducedPrimariesStoreStruct is the Store key that keeps the primary values in the patch scope.
type TxStateStoreStruct ¶ added in v0.2.1
type TxStateStoreStruct struct{}
TxStateStoreStruct is the common struct used as a transaction state key in the scope's Store.