Documentation
¶
Index ¶
- type AppContainer
- type AppContainerOption
- func WithAdminAuth() AppContainerOption
- func WithAiGeneratorService(factory ai_generator.GeneratorFactory, config *ai_generator.GeneratorConfig, ...) AppContainerOption
- func WithAppService(appService any) AppContainerOption
- func WithAuditTrail() AppContainerOption
- func WithAuth() AppContainerOption
- func WithChatBot() AppContainerOption
- func WithCompany() AppContainerOption
- func WithContact() AppContainerOption
- func WithContentManagement() AppContainerOption
- func WithCooperative() AppContainerOption
- func WithCrowdFunding() AppContainerOption
- func WithCustomerRelationship() AppContainerOption
- func WithDistribution() AppContainerOption
- func WithEmailAPIService(from, domain, apiKey, apiSecret string, sender email_api.EmailAPI) AppContainerOption
- func WithEmailSender(smtpServer string, smtpPort int, smtpUsername, smtpPassword string, ...) AppContainerOption
- func WithFCMService(ctx *context.Context, credentialPath *string) AppContainerOption
- func WithFile() AppContainerOption
- func WithFinance() AppContainerOption
- func WithFirestore(ctx context.Context, firebaseCredentialFile, bucket string) AppContainerOption
- func WithFlowEngine() AppContainerOption
- func WithGeminiService(apiKey string) AppContainerOption
- func WithGoogleAPIService(apiKey string) AppContainerOption
- func WithHRIS() AppContainerOption
- func WithIndonesiaReg() AppContainerOption
- func WithInventory() AppContainerOption
- func WithKafkaService(ctx context.Context, server *string) AppContainerOption
- func WithLogistic() AppContainerOption
- func WithManufacture() AppContainerOption
- func WithMedical() AppContainerOption
- func WithMessage() AppContainerOption
- func WithMetaService(facebookBaseURL, storageProvider string) AppContainerOption
- func WithMongoDBService(ctx context.Context, opts ...*options.ClientOptions) AppContainerOption
- func WithNotification() AppContainerOption
- func WithOrder() AppContainerOption
- func WithPermitHub() AppContainerOption
- func WithPlanningBudget() AppContainerOption
- func WithProjectManagement() AppContainerOption
- func WithRBAC() AppContainerOption
- func WithRedisService(ctx context.Context, address, password string, db int) AppContainerOption
- func WithTag() AppContainerOption
- func WithUser() AppContainerOption
- func WithWatzapClient(apiKey, numberKey, mockNumber string, isMock bool, redisKey string) AppContainerOption
- func WithWebsocketService() AppContainerOption
- func WithWhatsmeowService(baseURL, mockNumber string, isMock bool, redisKey string) AppContainerOption
- func WithXenditService(apiKey string) AppContainerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppContainer ¶
type AppContainer struct {
DB *gorm.DB // Database connection
Ctx ctx.Context // Context
Mongo *mongo.Client
Request *http.Request // HTTP request
InventoryService *inventory.InventoryService
ManufactureService *manufacture.ManufactureService
AuthService *auth.AuthService
AdminAuthService *auth.AdminAuthService
RBACService *auth.RBACService
CompanyService *company.CompanyService
ContactService *contact.ContactService
FinanceService *finance.FinanceService
CooperativeService *cooperative.CooperativeService
OrderService *order.OrderService
LogisticService *logistic.LogisticService
DistributionService *distribution.DistributionService
CustomerRelationshipService *customer_relationship.CustomerRelationshipService
FileService *file.FileService
MedicalService *medical.MedicalService
IndonesiaRegService *indonesia_regional.IndonesiaRegService
UserService *user.UserService
ContentManagementService *content_management.ContentManagementService
TagService *tag.TagService
MessageService *message.MessageService
ProjectManagementService *project.ProjectService
PlanningBudgetService *planning_budget.PlanningBudgetService
ChatBotService *chat_bot.ChatBotService
CrowdFundingService *crowd_funding.CrowdFundingService
NotificationService *notification.NotificationService
HRISService *hris.HRISservice
AuditTrailService *audit_trail.AuditTrailService
PermitHubService *permit_hub.PermitHubService
AiGeneratorService *ai_generator.AiGeneratorService
XenditService *xendit.XenditService
MetaService *meta.MetaService
ThirdPartyServices map[string]any
// Add additional services here
EmailSender *thirdparty.SMTPSender
EmailAPIService *email_api.EmailApiService
WatzapClient *thirdparty.WatzapClient
GoogleAPIService *google.GoogleAPIService
GeminiService *google.GeminiService
SkipMigration bool
Firestore *thirdparty.Firestore
WhatsmeowService *whatsmeow_client.WhatsmeowService
FCMService *google.FCMService
RedisService *redis.RedisService
KafkaService *kafka.KafkaService
WebsocketService *websocket.WebsocketService
AppService any // This can be a specific service or a generic interface
// FLOW ENGINE
FlowEngine *flow_engine.FlowEngine
// contains filtered or unexported fields
}
func NewAppContainer ¶
func NewAppContainer(db *gorm.DB, req *http.Request, golangContext *ctx.Context, skipMigrate bool, baseURL string, opts ...AppContainerOption) *AppContainer
type AppContainerOption ¶
type AppContainerOption func(*AppContainer)
func WithAdminAuth ¶
func WithAdminAuth() AppContainerOption
WithAdminAuth adds the AdminAuthService to the AppContainer.
func WithAiGeneratorService ¶ added in v1.0.58
func WithAiGeneratorService(factory ai_generator.GeneratorFactory, config *ai_generator.GeneratorConfig, skipMigration bool) AppContainerOption
WithAiGeneratorService initializes the AiGeneratorService with the given context, database, factory, config, and skipMigration flag.
This option is used to interact with the AI generator service.
It creates an instance of AiGeneratorService with the provided context, database, and skipMigration flag. If the factory is not nil, it sets the factory of the AiGeneratorService to the provided factory. If the config is not nil, it sets the config of the AiGeneratorService to the provided config.
func WithAppService ¶
func WithAppService(appService any) AppContainerOption
WithAppService adds the given AppService to the AppContainer.
It is an optional option.
func WithAuditTrail ¶
func WithAuditTrail() AppContainerOption
WithAuditTrail adds the AuditTrailService to the AppContainer.
It is an optional option.
func WithAuth ¶
func WithAuth() AppContainerOption
WithAuth adds the AuthService to the AppContainer.
It is a required option.
func WithChatBot ¶ added in v1.0.67
func WithChatBot() AppContainerOption
func WithCompany ¶
func WithCompany() AppContainerOption
WithCompany adds the CompanyService to the AppContainer.
It is an optional option.
func WithContact ¶
func WithContact() AppContainerOption
WithContact adds the ContactService to the AppContainer.
It is an optional option. It requires WithCompany to be called before it.
func WithContentManagement ¶
func WithContentManagement() AppContainerOption
WithContentManagement adds the ContentManagementService to the AppContainer.
It is an optional option.
func WithCooperative ¶
func WithCooperative() AppContainerOption
WithCooperative adds the CooperativeService to the AppContainer.
It is an optional option. It requires WithCompany and WithFinance to be called before it.
func WithCrowdFunding ¶
func WithCrowdFunding() AppContainerOption
WithCrowdFunding adds the CrowdFundingService to the AppContainer.
It is an optional option.
func WithCustomerRelationship ¶
func WithCustomerRelationship() AppContainerOption
WithCustomerRelationship adds the CustomerRelationshipService to the AppContainer.
It is an optional option.
func WithDistribution ¶
func WithDistribution() AppContainerOption
func WithEmailAPIService ¶
func WithEmailAPIService(from, domain, apiKey, apiSecret string, sender email_api.EmailAPI) AppContainerOption
WithEmailAPIService initializes the EmailAPIService with the given from address, domain, API key, and EmailAPI sender.
This option is used to send emails using the EmailAPI package.
func WithEmailSender ¶
func WithEmailSender(smtpServer string, smtpPort int, smtpUsername, smtpPassword string, from mail.Address) AppContainerOption
WithEmailSender initializes the EmailSender with the given SMTP server, port, username, password, and from address.
This option is used to send emails using the email package.
func WithFCMService ¶
func WithFCMService(ctx *context.Context, credentialPath *string) AppContainerOption
func WithFile ¶
func WithFile() AppContainerOption
func WithFinance ¶
func WithFinance() AppContainerOption
WithFinance adds the FinanceService to the AppContainer.
It is an optional option.
func WithFirestore ¶
func WithFirestore(ctx context.Context, firebaseCredentialFile, bucket string) AppContainerOption
WithFirestore initializes the Firestore service with the given context, Firebase credential file, and bucket name.
This option is used to interact with the Firestore database.
It panics if the Firestore service cannot be initialized.
func WithFlowEngine ¶
func WithFlowEngine() AppContainerOption
WithFlowEngine initializes the FlowEngine with the given context.
This option is used to interact with the Flow Engine service.
It creates an instance of FlowEngine with the provided context.
func WithGeminiService ¶
func WithGeminiService(apiKey string) AppContainerOption
WithGeminiService initializes the GeminiService with the given API key.
This option is used to interact with the Gemini AI service.
It creates an instance of GeminiService with the provided context and API key. If the API key is empty, it does nothing.
func WithGoogleAPIService ¶
func WithGoogleAPIService(apiKey string) AppContainerOption
WithGoogleAPIService initializes the GoogleAPIService with the given API key.
This option is used to interact with the Google Places API.
It creates an instance of GoogleAPIService with the provided context and API key.
func WithHRIS ¶
func WithHRIS() AppContainerOption
WithHRIS adds the HRISService to the AppContainer.
It is an optional option.
func WithIndonesiaReg ¶
func WithIndonesiaReg() AppContainerOption
WithIndonesiaReg adds the IndonesiaRegService to the AppContainer.
It is an optional option.
func WithInventory ¶
func WithInventory() AppContainerOption
WithInventory adds the InventoryService to the AppContainer.
It is an optional option.
func WithKafkaService ¶ added in v1.0.49
func WithKafkaService(ctx context.Context, server *string) AppContainerOption
func WithLogistic ¶
func WithLogistic() AppContainerOption
WithLogistic adds the LogisticService to the AppContainer.
It is an optional option. It requires WithInventory to be called before it.
func WithManufacture ¶
func WithManufacture() AppContainerOption
WithManufacture adds the ManufactureService to the AppContainer.
It is an optional option. It requires WithInventory to be called before it.
func WithMedical ¶
func WithMedical() AppContainerOption
WithMedical adds the MedicalService to the AppContainer.
It is an optional option.
func WithMessage ¶
func WithMessage() AppContainerOption
WithMessage adds the MessageService to the AppContainer.
It is an optional option.
func WithMetaService ¶ added in v1.0.64
func WithMetaService(facebookBaseURL, storageProvider string) AppContainerOption
func WithMongoDBService ¶ added in v1.0.62
func WithMongoDBService(ctx context.Context, opts ...*options.ClientOptions) AppContainerOption
WithMongoDBService initializes the MongoDBService with the given context, connection string, and database name.
This option is used to interact with the MongoDB database.
It creates an instance of MongoDBService with the provided context, connection string, and database name.
func WithNotification ¶
func WithNotification() AppContainerOption
WithNotification adds the NotificationService to the AppContainer.
It is an optional option.
func WithOrder ¶
func WithOrder() AppContainerOption
func WithPermitHub ¶
func WithPermitHub() AppContainerOption
WithPermitHub adds the PermitHubService to the AppContainer.
It is an optional option.
func WithPlanningBudget ¶ added in v1.0.53
func WithPlanningBudget() AppContainerOption
WithPlanningBudget adds the PlanningBudgetService to the AppContainer.
It is an optional option.
func WithProjectManagement ¶
func WithProjectManagement() AppContainerOption
WithProjectManagement adds the ProjectManagementService to the AppContainer.
It is an optional option.
func WithRBAC ¶
func WithRBAC() AppContainerOption
WithRBAC adds the RBACService to the AppContainer.
It is an optional option.
func WithRedisService ¶
func WithRedisService(ctx context.Context, address, password string, db int) AppContainerOption
WithRedisService initializes the RedisService with the given context, address, password, and database number.
This option is used to interact with the Redis database.
It creates an instance of RedisService with the provided context, address, password, and database number.
func WithTag ¶
func WithTag() AppContainerOption
WithTag adds the TagService to the AppContainer.
It is an optional option.
func WithUser ¶
func WithUser() AppContainerOption
WithUser adds the UserService to the AppContainer.
It is an optional option.
func WithWatzapClient ¶
func WithWatzapClient(apiKey, numberKey, mockNumber string, isMock bool, redisKey string) AppContainerOption
WithWatzapClient initializes the WatzapClient with the given API key, number key, mock number, isMock boolean, and redis key.
This option is used to send WhatsApp messages using the Watzap API.
func WithWebsocketService ¶
func WithWebsocketService() AppContainerOption
WithWebsocketService initializes the WebsocketService with the given context.
This option is used to interact with the Websocket service.
It creates an instance of WebsocketService with the provided context.
func WithWhatsmeowService ¶
func WithWhatsmeowService(baseURL, mockNumber string, isMock bool, redisKey string) AppContainerOption
WithWhatsmeowService initializes the WhatsmeowService with the given base URL, mock number, isMock boolean, and redis key.
This option is used to send WhatsApp messages using the Whatsmeow API.
func WithXenditService ¶ added in v1.0.63
func WithXenditService(apiKey string) AppContainerOption
WithXenditService initializes the XenditService with the given secret key.
This option is used to interact with the Xendit payment service.
It creates an instance of XenditService with the provided secret key.