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 {
	// Initializers.
	Initializers []core.Initializer
	// Repositories and mapped models.
	DefaultRepository repository.Repository
	RepositoryModels  map[repository.Repository][]mapping.Model
	// Key-value stores.
	DefaultStore store.Store
	Stores       map[string]store.Store
	// File stores.
	DefaultFileStore filestore.Store
	FileStores       map[string]filestore.Store
	// Model options.
	NamingConvention mapping.NamingConvention
	AccountModel     auth.Account
	Models           []mapping.Model
	MigrateModels    []mapping.Model
	DefaultNotNull   bool
	// Service server.
	Server server.Server
	// Auth abstractions.
	Verifier      auth.Verifier
	Authenticator auth.Authenticator
	Tokener       auth.Tokener
	// Service detailed options.
	HandleSignals  bool
	SynchronousORM bool
	// UTCTimestamps sets the timestamps to be in UTC timezone.
	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 *core.Controller
	// Server serves defined models.
	Server server.Server
}
    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 VersionedOption ¶
type VersionedOption func(o *VersionedOptions)
VersionedOption is an option that changes VersionedOptions.
type VersionedOptions ¶
type VersionedOptions struct {
	HandleSignals bool
	Versions      []Version
	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.