app

package
v1.0.45 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 37 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
	CrowdFundingService         *crowd_funding.CrowdFundingService
	NotificationService         *notification.NotificationService
	HRISService                 *hris.HRISservice
	AuditTrailService           *audit_trail.AuditTrailService
	PermitHubService            *permit_hub.PermitHubService

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

func WithAppService(appService any) AppContainerOption

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 string, sender email_api.EmailAPI) AppContainerOption

WithEmailAPIService WithEmailAPIService

func WithEmailSender

func WithEmailSender(smtpServer string, smtpPort int, smtpUsername, smtpPassword string, from mail.Address) AppContainerOption

WithEmailSender WithEmailSender

func WithFCMService

func WithFCMService(ctx *context.Context, credentialPath *string) AppContainerOption

WithFCMService WithFCMService

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 WithFirestore

func WithFlowEngine

func WithFlowEngine() AppContainerOption

func WithGeminiService

func WithGeminiService(apiKey string) AppContainerOption

func WithGoogleAPIService

func WithGoogleAPIService(apiKey string) AppContainerOption

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

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 WithWatzapClient

func WithWebsocketService

func WithWebsocketService() AppContainerOption

func WithWhatsmeowService

func WithWhatsmeowService(baseURL, mockNumber string, isMock bool, redisKey string) AppContainerOption

WithWhatsmeowService WithWhatsmeowService

Directories

Path Synopsis
example command

Jump to

Keyboard shortcuts

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