Documentation
¶
Overview ¶
Example of basic usage of the dependency injection package
Example of using the generic container from the dependency injection package ¶
Example of using the service container from the dependency injection package
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MyAppConfig ¶
Implement the AppConfig interface
func (*MyAppConfig) GetEnvironment ¶
func (c *MyAppConfig) GetEnvironment() string
func (*MyAppConfig) GetName ¶
func (c *MyAppConfig) GetName() string
func (*MyAppConfig) GetVersion ¶
func (c *MyAppConfig) GetVersion() string
type MyApplicationService ¶
type MyApplicationService struct {
// contains filtered or unexported fields
}
Implement the ApplicationService interface
func NewMyApplicationService ¶
func NewMyApplicationService(domainService *MyDomainService, repo *MyRepository) (*MyApplicationService, error)
func (*MyApplicationService) Execute ¶
func (s *MyApplicationService) Execute() string
func (*MyApplicationService) GetID ¶
func (s *MyApplicationService) GetID() string
type MyConfig ¶
type MyConfig struct {
App *MyAppConfig
Database *MyDatabaseConfig
}
Implement the Config interface
func (*MyConfig) GetDatabase ¶
func (c *MyConfig) GetDatabase() config.DatabaseConfig
type MyDatabaseConfig ¶
type MyDatabaseConfig struct {
DBType string
DBConnectionString string
DBName string
Collections map[string]string
}
Implement the DatabaseConfig interface
func (*MyDatabaseConfig) GetCollectionName ¶
func (c *MyDatabaseConfig) GetCollectionName(entityType string) string
func (*MyDatabaseConfig) GetConnectionString ¶
func (c *MyDatabaseConfig) GetConnectionString() string
func (*MyDatabaseConfig) GetDatabaseName ¶
func (c *MyDatabaseConfig) GetDatabaseName() string
func (*MyDatabaseConfig) GetType ¶
func (c *MyDatabaseConfig) GetType() string
type MyDomainService ¶
type MyDomainService struct {
// contains filtered or unexported fields
}
Implement the DomainService interface
func NewMyDomainService ¶
func NewMyDomainService(repo *MyRepository) (*MyDomainService, error)
func (*MyDomainService) GetID ¶
func (s *MyDomainService) GetID() string
func (*MyDomainService) ProcessData ¶
func (s *MyDomainService) ProcessData() string
type MyRepository ¶
type MyRepository struct {
// contains filtered or unexported fields
}
Implement the Repository interface
func (*MyRepository) GetData ¶
func (r *MyRepository) GetData() string
func (*MyRepository) GetID ¶
func (r *MyRepository) GetID() string
type ProductApplicationService ¶
type ProductApplicationService struct {
// contains filtered or unexported fields
}
Implement the ApplicationService interface
func InitProductApplicationService ¶
func InitProductApplicationService(domainService *ProductDomainService, repo *ProductRepository) (*ProductApplicationService, error)
Initialize application service function
func (*ProductApplicationService) GetID ¶
func (s *ProductApplicationService) GetID() string
func (*ProductApplicationService) GetProductRecommendations ¶
func (s *ProductApplicationService) GetProductRecommendations() []string
type ProductDomainService ¶
type ProductDomainService struct {
// contains filtered or unexported fields
}
Implement the DomainService interface
func InitProductDomainService ¶
func InitProductDomainService(repo *ProductRepository) (*ProductDomainService, error)
Initialize domain service function
func (*ProductDomainService) GetFeaturedProducts ¶
func (s *ProductDomainService) GetFeaturedProducts() []string
func (*ProductDomainService) GetID ¶
func (s *ProductDomainService) GetID() string
type ProductRepository ¶
type ProductRepository struct {
// contains filtered or unexported fields
}
Implement the Repository interface
func InitProductRepository ¶
func InitProductRepository(ctx context.Context, connectionString string, logger *zap.Logger) (*ProductRepository, error)
Initialize repository function
func (*ProductRepository) GetID ¶
func (r *ProductRepository) GetID() string
func (*ProductRepository) GetProducts ¶
func (r *ProductRepository) GetProducts() []string
Click to show internal directories.
Click to hide internal directories.