Documentation ¶
Overview ¶
Package autoconfigure implement ConfigurableFactory
Index ¶
- Constants
- Variables
- type ConfigurableFactory
- func (f *ConfigurableFactory) Build(configs []*factory.MetaData)
- func (f *ConfigurableFactory) BuildSystemConfig() (systemConfig *system.Configuration, err error)
- func (f *ConfigurableFactory) Configuration(name string) interface{}
- func (f *ConfigurableFactory) Initialize(configurations cmap.ConcurrentMap) (err error)
- func (f *ConfigurableFactory) Instantiate(configuration interface{}) (err error)
- func (f *ConfigurableFactory) SystemConfiguration() *system.Configuration
Constants ¶
View Source
const ( // System configuration name System = "system" // EnvAppProfilesActive is the environment variable name APP_PROFILES_ACTIVE EnvAppProfilesActive = "APP_PROFILES_ACTIVE" // PostfixConfiguration is the Configuration postfix PostfixConfiguration = "Configuration" )
Variables ¶
View Source
var ( // ErrInvalidMethod method is invalid ErrInvalidMethod = errors.New("[factory] method is invalid") // ErrFactoryCannotBeNil means that the InstantiateFactory can not be nil ErrFactoryCannotBeNil = errors.New("[factory] InstantiateFactory can not be nil") // ErrFactoryIsNotInitialized means that the InstantiateFactory is not initialized ErrFactoryIsNotInitialized = errors.New("[factory] InstantiateFactory is not initialized") // ErrInvalidObjectType means that the Configuration type is invalid, it should embeds app.Configuration ErrInvalidObjectType = errors.New("[factory] invalid Configuration type, one of app.Configuration need to be embedded") // ErrConfigurationNameIsTaken means that the configuration name is already taken ErrConfigurationNameIsTaken = errors.New("[factory] configuration name is already taken") // ErrComponentNameIsTaken means that the component name is already taken ErrComponentNameIsTaken = errors.New("[factory] component name is already taken") )
Functions ¶
This section is empty.
Types ¶
type ConfigurableFactory ¶
type ConfigurableFactory struct { *instantiate.InstantiateFactory // contains filtered or unexported fields }
func (*ConfigurableFactory) Build ¶
func (f *ConfigurableFactory) Build(configs []*factory.MetaData)
Build build all auto configurations
func (*ConfigurableFactory) BuildSystemConfig ¶
func (f *ConfigurableFactory) BuildSystemConfig() (systemConfig *system.Configuration, err error)
BuildSystemConfig build system configuration
func (*ConfigurableFactory) Configuration ¶
func (f *ConfigurableFactory) Configuration(name string) interface{}
Configuration getter
func (*ConfigurableFactory) Initialize ¶
func (f *ConfigurableFactory) Initialize(configurations cmap.ConcurrentMap) (err error)
Initialize initialize ConfigurableFactory
func (*ConfigurableFactory) Instantiate ¶
func (f *ConfigurableFactory) Instantiate(configuration interface{}) (err error)
Instantiate run instantiation by method
func (*ConfigurableFactory) SystemConfiguration ¶
func (f *ConfigurableFactory) SystemConfiguration() *system.Configuration
SystemConfiguration getter
Click to show internal directories.
Click to hide internal directories.