Documentation
¶
Overview ¶
Package ncore is the cloud-native, distributed ORM implementation.
It's design allows to use the separate repository for each model, with a possiblity to have different relationships types between them.
Neuron-core consists of following packages:
ncore - (Neuron Core) the root package that gives easy access to all subpackages.
common - contains common variables and constants for neuron derivates.
controller - is the neuron's core, that registers and stores the models and contains configurations required by other packages.
config - contains the configurations for all packages.
query - used to create queries, filters, sorts, paginations on base of mapped models.
mapping - contains the information about the mapped models their fields and settings.
class - contains errors classification system for the neuron packages.
log - is the logging interface for the neuron based applications.
i18n - is the neuron based application supported internationalization.
repository - is a package used to store and register the repositories.
It is also used to get the repository/factory per model. A modular design allows to use and compile only required repositories.
Index ¶
- func Controller() *controller.Controller
- func InitController(cfg *config.Controller) (*controller.Controller, error)
- func InitDefaultController(cfg *config.Controller) (err error)
- func MustQuery(model interface{}) *query.Scope
- func MustQueryC(c *controller.Controller, model interface{}) *query.Scope
- func Query(model interface{}) (*query.Scope, error)
- func QueryC(c *controller.Controller, model interface{}) (*query.Scope, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitController ¶ added in v0.12.0
func InitController(cfg *config.Controller) (*controller.Controller, error)
InitController creates and initializes new controller for provided 'cfg' config.
func InitDefaultController ¶ added in v0.11.0
func InitDefaultController(cfg *config.Controller) (err error)
InitDefaultController initializes default controller for given configuration.
func MustQuery ¶ added in v0.2.3
MustQuery creates the new query scope for the provided 'model' for the default controller. Panics on error.
func MustQueryC ¶ added in v0.2.3
func MustQueryC(c *controller.Controller, model interface{}) *query.Scope
MustQueryC creates the new query scope for the 'model' and 'c' controller. Panics on error.
func QueryC ¶
func QueryC(c *controller.Controller, model interface{}) (*query.Scope, error)
QueryC creates new query scope for the provided 'model' and controller 'c'.
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
Package annotation contains constans used as mapping annotations.
|
Package annotation contains constans used as mapping annotations. |
Package class contains `github.com/neuronlabs/errors` classes instances used in neuron-core.
|
Package class contains `github.com/neuronlabs/errors` classes instances used in neuron-core. |
Package config contains configuration structures used by all neuron-core packages.
|
Package config contains configuration structures used by all neuron-core packages. |
Package controller contains root neuron structure.
|
Package controller contains root neuron structure. |
Package i18n defines model internationalization support.
|
Package i18n defines model internationalization support. |
Package internal contains neuron internal variables and interfaces, used by multiple packages.
|
Package internal contains neuron internal variables and interfaces, used by multiple packages. |
safemap
Package safemap defines concurrently safe hash map.
|
Package safemap defines concurrently safe hash map. |
Package log contains default neuron logger interface with it's subcomponents.
|
Package log contains default neuron logger interface with it's subcomponents. |
Package mapping contains neuron models mapped structures.
|
Package mapping contains neuron models mapped structures. |
Package namer defines the naming convention functions used to define registered model collection name and it's fields.
|
Package namer defines the naming convention functions used to define registered model collection name and it's fields. |
Package query is the package used that defines the neuron query it's structure, processor, transactions.
|
Package query is the package used that defines the neuron query it's structure, processor, transactions. |
Package repository is the package that defines neuron repositories and it's factories.
|
Package repository is the package that defines neuron repositories and it's factories. |