Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(o *Options)
Option is the function that sets the options for the service.
type Options ¶
type Options struct { Name string Version string NamingConvention mapping.NamingConvention DefaultRepository repository.Repository RepositoryModels map[repository.Repository][]mapping.Model DefaultStore store.Store Stores map[string]store.Store Collections []database.Collection Models []mapping.Model MigrateModels []mapping.Model DefaultNotNull bool Server server.Server Verifier auth.Verifier Authenticator auth.Authenticator Tokener auth.Tokener HandleSignals bool Context context.Context SynchronousORM bool UTCTimestamps bool }
Options is the structure that contains service options.
type Service ¶
type Service struct { Options *Options // Controller controls service model definitions, repositories and configuration. Controller *controller.Controller // Server serves defined models. Server server.Server DB database.DB Verifier auth.Verifier Authenticator auth.Authenticator Tokener auth.Tokener }
Service is the neuron service struct definition.
func (*Service) CloseAll ¶
CloseAll closes all connections with the repositories, proxies and services.
func (*Service) Initialize ¶
Initialize registers all repositories and models, establish the connection for each repository.
type ServiceVersion ¶
ServiceVersion is a structure that maps the service with it's version.
type VersionedOption ¶
type VersionedOption func(o *VersionedOptions)
VersionedOption is an option that changes VersionedOptions.
type VersionedOptions ¶
type VersionedOptions struct { HandleSignals bool Versions []ServiceVersion Server server.VersionedServer }
VersionedOptions are the multi version service options.
type VersionedService ¶
type VersionedService struct {
Options *VersionedOptions
}
VersionedService is a service that supports multiple versions for the models server by single server.
func NewVersioned ¶
func NewVersioned(options ...VersionedOption) *VersionedService
NewVersioned creates new versioned service.
func (*VersionedService) CloseAll ¶
func (v *VersionedService) CloseAll(ctx context.Context) error
CloseAll closes all connections with the repositories, proxies and services.
func (*VersionedService) Initialize ¶
func (v *VersionedService) Initialize(ctx context.Context) error
Initialize sets up all version services, register their models and repositories, and establish their connections.