services

package
v0.0.0-...-b6fb39f Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserContextInfo

func GetUserContextInfo(ctx context.Context) map[string]string

GetUserContextInfo الحصول على جميع معلومات المستخدم من السياق

func IsAdminUser

func IsAdminUser(ctx context.Context) bool

IsAdminUser التحقق إذا كان المستخدم مسؤولاً

func IsAuthenticated

func IsAuthenticated(ctx context.Context) bool

IsAuthenticated التحقق إذا كان المستخدم مصادقاً

func IsPremiumUser

func IsPremiumUser(ctx context.Context) bool

IsPremiumUser التحقق إذا كان المستخدم من الطبقة الممتازة

func ValidateUserContext

func ValidateUserContext(ctx context.Context) error

ValidateUserContext التحقق من صحة سياق المستخدم

func WithUserContext

func WithUserContext(ctx context.Context, userID, userTier, email, role string) context.Context

WithUserContext إضافة معلومات المستخدم إلى السياق

Types

type AnalysisService

type AnalysisService struct {
	// contains filtered or unexported fields
}

func NewAnalysisService

func NewAnalysisService(provider types.TextProvider) *AnalysisService

func (*AnalysisService) AnalyzeCompetitor

func (s *AnalysisService) AnalyzeCompetitor(ctx context.Context, competitor string, yourCompany string, analysisType string) (*types.TextResponse, error)

func (*AnalysisService) AnalyzeCustomerFeedback

func (s *AnalysisService) AnalyzeCustomerFeedback(ctx context.Context, feedback []string, product string) (*types.AnalysisResponse, error)

func (*AnalysisService) AnalyzeFinancialData

func (s *AnalysisService) AnalyzeFinancialData(ctx context.Context, financialMetrics map[string]interface{}, timeframe string) (*types.TextResponse, error)

func (*AnalysisService) AnalyzeMarketTrends

func (s *AnalysisService) AnalyzeMarketTrends(ctx context.Context, industry string, timeframe string) (*types.TextResponse, error)

AnalyzeMarketTrends تحليل اتجاهات السوق

func (*AnalysisService) AnalyzePerformanceMetrics

func (s *AnalysisService) AnalyzePerformanceMetrics(ctx context.Context, metrics map[string]interface{}, benchmarks map[string]interface{}) (*types.TextResponse, error)

func (*AnalysisService) AnalyzeRisk

func (s *AnalysisService) AnalyzeRisk(ctx context.Context, project string, riskAreas []string) (*types.TextResponse, error)

func (*AnalysisService) AnalyzeSWOT

func (s *AnalysisService) AnalyzeSWOT(ctx context.Context, organization string, industry string) (*types.TextResponse, error)

func (*AnalysisService) AnalyzeSentiment

func (s *AnalysisService) AnalyzeSentiment(ctx context.Context, text string, sourceType string) (*types.AnalysisResponse, error)

func (*AnalysisService) GetServiceStats

func (s *AnalysisService) GetServiceStats(ctx context.Context) map[string]interface{}

type ContentService

type ContentService struct {
	// contains filtered or unexported fields
}

func NewContentService

func NewContentService(provider types.TextProvider) *ContentService

func (*ContentService) GenerateAdCopy

func (s *ContentService) GenerateAdCopy(ctx context.Context, product string, platform string, goal string) (*types.TextResponse, error)

func (*ContentService) GenerateBlogPost

func (s *ContentService) GenerateBlogPost(ctx context.Context, topic string, tone string, wordCount int) (*types.TextResponse, error)

func (*ContentService) GenerateCaseStudy

func (s *ContentService) GenerateCaseStudy(ctx context.Context, client string, challenge string, solution string, results []string) (*types.TextResponse, error)

func (*ContentService) GenerateEmailNewsletter

func (s *ContentService) GenerateEmailNewsletter(ctx context.Context, topic string, audience string, length string) (*types.TextResponse, error)

func (*ContentService) GenerateLandingPageCopy

func (s *ContentService) GenerateLandingPageCopy(ctx context.Context, product string, targetCustomer string, uniqueSellingPoints []string) (*types.TextResponse, error)

func (*ContentService) GeneratePressRelease

func (s *ContentService) GeneratePressRelease(ctx context.Context, company string, announcement string, keyPoints []string) (*types.TextResponse, error)

func (*ContentService) GenerateProductDescription

func (s *ContentService) GenerateProductDescription(ctx context.Context, product string, features []string, targetCustomer string) (*types.TextResponse, error)

func (*ContentService) GenerateSocialMediaPost

func (s *ContentService) GenerateSocialMediaPost(ctx context.Context, platform string, message string, hashtags []string) (*types.TextResponse, error)

func (*ContentService) GenerateVideoScript

func (s *ContentService) GenerateVideoScript(ctx context.Context, videoType string, topic string, duration int) (*types.TextResponse, error)

func (*ContentService) GenerateWhitepaperOutline

func (s *ContentService) GenerateWhitepaperOutline(ctx context.Context, topic string, targetAudience string) (*types.TextResponse, error)

func (*ContentService) GetServiceStats

func (s *ContentService) GetServiceStats(ctx context.Context) map[string]interface{}

type MediaService

type MediaService struct {
	// contains filtered or unexported fields
}

MediaService خدمة الوسائط المتعددة

func NewMediaService

func NewMediaService(imageProvider types.ImageProvider, textProvider types.TextProvider) *MediaService

NewMediaService إنشاء خدمة وسائط جديدة

func (*MediaService) AnalyzeImage

func (s *MediaService) AnalyzeImage(ctx context.Context, imageData []byte, prompt string) (*types.AnalysisResponse, error)

AnalyzeImage تحليل صورة

func (*MediaService) ApplyFilter

func (s *MediaService) ApplyFilter(ctx context.Context, imageData []byte, filterType string) ([]byte, error)

ApplyFilter تطبيق فلتر على الصورة

func (*MediaService) BatchProcessImages

func (s *MediaService) BatchProcessImages(ctx context.Context, images [][]byte, processFunc func([]byte) ([]byte, error)) ([][]byte, error)

BatchProcessImages معالجة دفعة من الصور

func (*MediaService) CompressImage

func (s *MediaService) CompressImage(ctx context.Context, imageData []byte, quality int) ([]byte, error)

CompressImage ضغط الصورة

func (*MediaService) ConvertImageFormat

func (s *MediaService) ConvertImageFormat(ctx context.Context, imageData []byte, format string) ([]byte, error)

ConvertImageFormat تحويل تنسيق الصورة

func (*MediaService) CreateThumbnail

func (s *MediaService) CreateThumbnail(ctx context.Context, imageData []byte, maxWidth, maxHeight int) ([]byte, error)

CreateThumbnail إنشاء صورة مصغرة

func (*MediaService) ExtractTextFromImage

func (s *MediaService) ExtractTextFromImage(ctx context.Context, imageData []byte) (string, error)

ExtractTextFromImage استخراج نص من صورة (OCR)

func (*MediaService) GenerateImageFromText

func (s *MediaService) GenerateImageFromText(ctx context.Context, prompt string, options types.ImageGenerationOptions) (*types.GeneratedImage, error)

GenerateImageFromText توليد صورة من نص

func (*MediaService) GetImageInfo

func (s *MediaService) GetImageInfo(ctx context.Context, imageData []byte) (*types.ImageInfo, error)

GetImageInfo الحصول على معلومات الصورة

func (*MediaService) GetImageStats

func (s *MediaService) GetImageStats(ctx context.Context) map[string]interface{}

GetImageStats الحصول على إحصائيات الصور

func (*MediaService) GetMaxImageSize

func (s *MediaService) GetMaxImageSize() int64

GetMaxImageSize الحصول على الحد الأقصى لحجم الصورة

func (*MediaService) GetSupportedImageFormats

func (s *MediaService) GetSupportedImageFormats() []string

GetSupportedImageFormats الحصول على التنسيقات المدعومة

func (*MediaService) LoadImageFromStorage

func (s *MediaService) LoadImageFromStorage(ctx context.Context, imageID string) ([]byte, error)

LoadImageFromStorage تحميل الصورة من التخزين

func (*MediaService) ReadImageFromReader

func (s *MediaService) ReadImageFromReader(ctx context.Context, reader io.Reader) ([]byte, error)

ReadImageFromReader قراءة صورة من قارئ

func (*MediaService) RemoveBackground

func (s *MediaService) RemoveBackground(ctx context.Context, imageData []byte) ([]byte, error)

RemoveBackground إزالة خلفية الصورة

func (*MediaService) ResizeImage

func (s *MediaService) ResizeImage(ctx context.Context, imageData []byte, width, height int) ([]byte, error)

ResizeImage تغيير حجم الصورة

func (*MediaService) SaveImageToStorage

func (s *MediaService) SaveImageToStorage(ctx context.Context, imageData []byte, filename string) (string, error)

SaveImageToStorage حفظ الصورة في التخزين

func (*MediaService) ValidateImage

func (s *MediaService) ValidateImage(imageData []byte) error

ValidateImage التحقق من صحة الصورة

func (*MediaService) WriteImageToWriter

func (s *MediaService) WriteImageToWriter(ctx context.Context, imageData []byte, writer io.Writer) error

WriteImageToWriter كتابة صورة إلى كاتب

type ServiceError

type ServiceError struct {
	Code    string
	Message string
}

ServiceError تعريف خطأ الخدمة

func (*ServiceError) Error

func (e *ServiceError) Error() string

type StrategyService

type StrategyService struct {
	// contains filtered or unexported fields
}

func NewStrategyService

func NewStrategyService(provider types.TextProvider) *StrategyService

func (*StrategyService) GenerateBrandPositioning

func (s *StrategyService) GenerateBrandPositioning(ctx context.Context, brand string, targetCustomer string, competitors []string) (*types.TextResponse, error)

func (*StrategyService) GenerateBusinessPlan

func (s *StrategyService) GenerateBusinessPlan(ctx context.Context, businessIdea string, industry string) (*types.TextResponse, error)

func (*StrategyService) GenerateCompetitiveAnalysis

func (s *StrategyService) GenerateCompetitiveAnalysis(ctx context.Context, company string, competitors []string) (*types.TextResponse, error)

func (*StrategyService) GenerateContentStrategy

func (s *StrategyService) GenerateContentStrategy(ctx context.Context, brand string, platforms []string, goals []string) (*types.TextResponse, error)

func (*StrategyService) GenerateCrisisManagementPlan

func (s *StrategyService) GenerateCrisisManagementPlan(ctx context.Context, organization string, potentialCrises []string) (*types.TextResponse, error)

func (*StrategyService) GenerateDigitalTransformationStrategy

func (s *StrategyService) GenerateDigitalTransformationStrategy(ctx context.Context, company string, currentState string, goals []string) (*types.TextResponse, error)

func (*StrategyService) GenerateMarketingStrategy

func (s *StrategyService) GenerateMarketingStrategy(ctx context.Context, product string, targetAudience string, budget string) (*types.TextResponse, error)

func (*StrategyService) GenerateOKRs

func (s *StrategyService) GenerateOKRs(ctx context.Context, department string, timeframe string, companyGoals []string) (*types.TextResponse, error)

func (*StrategyService) GenerateProductLaunchPlan

func (s *StrategyService) GenerateProductLaunchPlan(ctx context.Context, product string, targetMarket string, launchDate string) (*types.TextResponse, error)

func (*StrategyService) GenerateSWOTAnalysis

func (s *StrategyService) GenerateSWOTAnalysis(ctx context.Context, company string, industry string) (*types.TextResponse, error)

func (*StrategyService) GetServiceStats

func (s *StrategyService) GetServiceStats(ctx context.Context) map[string]interface{}

type TranslationService

type TranslationService struct {
	// contains filtered or unexported fields
}

func NewTranslationService

func NewTranslationService(provider types.TextProvider) *TranslationService

func (*TranslationService) BatchTranslate

func (s *TranslationService) BatchTranslate(ctx context.Context, texts []string, sourceLang string, targetLang string) ([]*types.TranslationResponse, error)

func (*TranslationService) DetectLanguage

func (s *TranslationService) DetectLanguage(ctx context.Context, text string) (string, float64, error)

func (*TranslationService) GetServiceStats

func (s *TranslationService) GetServiceStats(ctx context.Context) map[string]interface{}

func (*TranslationService) GetSupportedLanguages

func (s *TranslationService) GetSupportedLanguages(ctx context.Context) ([]string, error)

func (*TranslationService) GetTranslationQuality

func (s *TranslationService) GetTranslationQuality(ctx context.Context, original string, translated string, sourceLang string, targetLang string) (float64, error)

func (*TranslationService) Translate

func (s *TranslationService) Translate(ctx context.Context, text string, sourceLang string, targetLang string) (*types.TranslationResponse, error)

func (*TranslationService) TranslateDocument

func (s *TranslationService) TranslateDocument(ctx context.Context, document string, sourceLang string, targetLang string, format string) (*types.TranslationResponse, error)

func (*TranslationService) TranslateWithGlossary

func (s *TranslationService) TranslateWithGlossary(ctx context.Context, text string, sourceLang string, targetLang string, glossary map[string]string) (*types.TranslationResponse, error)

type UserContextKey

type UserContextKey string

UserContextKey مفتاح سياق المستخدم

const (
	UserIDKey    UserContextKey = "user_id"
	UserTierKey  UserContextKey = "user_tier"
	UserEmailKey UserContextKey = "user_email"
	UserRoleKey  UserContextKey = "user_role"
)

Jump to

Keyboard shortcuts

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