Documentation
¶
Overview ¶
Package neuron is the cloud-native, distributed ORM implementation.
It's design allows to use the separate repository for each model, with a possibility to have different relationships types between them.
neuron consists of following packages: - auth - defines basic interfaces and structures used for neuron authentication and authorization. - codec - is a set structures and interfaces used on marshal process. - controller - defines a structure that keeps and maps all models to related repositories. - core - contains core neuron service definitions. - database - defines interfaces, functions and structures that allows to execute queries. - errors - neuron defined errors. - log - is the neuron service logging interface structure for the neuron based applications. - mapping - contains the information about the mapped models their fields and settings. - query - contains structures used to create queries, sort, pagination on base of mapped models. - query/filters - contains query filters structures and implementations. - repository - is a package used to store and register the repositories. - server - defines interfaces used as the servers.
It is also used to get the repository/factory per model. A modular design allows to use and compile only required repositories.
Index ¶
- func Authenticator(authenticator auth.Authenticator) core.Option
- func Collections(collections ...database.Collection) core.Option
- func DefaultNotNullFields(o *core.Options)
- func DefaultRepository(r repository.Repository) core.Option
- func DefaultStore(s store.Store) core.Option
- func HandleSignal(handle bool) core.Option
- func MigrateModels(models ...mapping.Model) core.Option
- func Models(models ...mapping.Model) core.Option
- func Name(name string) core.Option
- func NamingConvention(convention mapping.NamingConvention) core.Option
- func New(options ...core.Option) *core.Service
- func NewVersioned(options ...core.VersionedOption) *core.VersionedService
- func RepositoryModels(r repository.Repository, models ...mapping.Model) core.Option
- func Server(s server.Server) core.Option
- func ServiceVersion(version string, service *core.Service) core.VersionedOption
- func Store(name string, s store.Store) core.Option
- func SynchronousConnections(sync bool) core.Option
- func Tokener(tokener auth.Tokener) core.Option
- func UTCTimestamps(utcTimestamps bool) core.Option
- func Verifier(authorizer auth.Verifier) core.Option
- func VersionedHandleSignal(handle bool) core.VersionedOption
- func VersionedServer(s server.VersionedServer) core.VersionedOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticator ¶ added in v0.16.0
func Authenticator(authenticator auth.Authenticator) core.Option
Authenticator sets the authenticator option.
func Collections ¶ added in v0.16.0
func Collections(collections ...database.Collection) core.Option
Collections adds the collections to the initialization process.
func DefaultNotNullFields ¶ added in v0.17.0
DefaultNotNullFields sets the non-pointer model fields to not null by default. By default all fields are set as nullable in the model's definition. This might be helpful in the model migration.
func DefaultRepository ¶ added in v0.16.0
func DefaultRepository(r repository.Repository) core.Option
DefaultRepository sets the default repository for all models without specified repository.
func DefaultStore ¶ added in v0.17.0
DefaultStore sets the default store for the service.
func HandleSignal ¶ added in v0.16.0
HandleSignal is the option that determines if the os signals should be handled by the service.
func MigrateModels ¶ added in v0.16.0
MigrateModels is the option that sets the models to migrate in their repositories.
func NamingConvention ¶ added in v0.16.0
func NamingConvention(convention mapping.NamingConvention) core.Option
NamingConvention sets the naming convention option.
func NewVersioned ¶ added in v0.16.0
func NewVersioned(options ...core.VersionedOption) *core.VersionedService
NewVersioned creates a new service that handles multiple versions as a single service. VersionedService uses single server that handles different services with different controllers.
func RepositoryModels ¶ added in v0.16.0
func RepositoryModels(r repository.Repository, models ...mapping.Model) core.Option
RepositoryModels maps the repository 'r' to provided 'models'.
func ServiceVersion ¶ added in v0.16.0
func ServiceVersion(version string, service *core.Service) core.VersionedOption
ServiceVersion is an option used for VersionedService that adds the 'service' mapped with it's 'version' to the VersionedService.
func SynchronousConnections ¶ added in v0.16.0
SynchronousConnections defines if the service should query repositories synchronously.
func UTCTimestamps ¶ added in v0.16.0
UTCTimestamps would set the timestamps of the service to UTC time zoned.
func VersionedHandleSignal ¶ added in v0.16.0
func VersionedHandleSignal(handle bool) core.VersionedOption
VersionedHandleSignal is the option that determines if the os signals should be handled by the versioned service.
func VersionedServer ¶ added in v0.16.0
func VersionedServer(s server.VersionedServer) core.VersionedOption
VersionedServer is an option used for VersionedService that sets the VersionedServer.
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
Package auth contains interfaces that defines basic authentication and authorization structures.
|
Package auth contains interfaces that defines basic authentication and authorization structures. |
Package controller contains root neuron structure.
|
Package controller contains root neuron structure. |
Package errors provides lightweight error handling and classification primitives.
|
Package errors provides lightweight error handling and classification primitives. |
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 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. |
Package store defines basic key value store for neuron services.
|
Package store defines basic key value store for neuron services. |
memory
Package memory contains in-memory store implementation for neuron framework.
|
Package memory contains in-memory store implementation for neuron framework. |