app

package
v1.0.61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2025 License: MIT Imports: 40 Imported by: 0

Documentation

Index

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
	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
	CrowdFundingService         *crowd_funding.CrowdFundingService
	NotificationService         *notification.NotificationService
	HRISService                 *hris.HRISservice
	AuditTrailService           *audit_trail.AuditTrailService
	PermitHubService            *permit_hub.PermitHubService
	AiGeneratorService          *ai_generator.AiGeneratorService

	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

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 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 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.

Directories

Path Synopsis
example command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL