Documentation
¶
Index ¶
- func GoogleAuth()
- func ORMTest()
- func TestAPIGen()
- func TestAmplifyFuncs()
- func TestDBConnection()
- func TestECSIntegration()
- func TestGeminiImageGen()
- func TestImageGen()
- func TestKAIEmbeddingGeneration()
- func TestKai()
- func TestKarmaErrorPackage()
- func TestKarmaFiles()
- func TestMCPServer(auth bool)
- func TestNanoBananaImageGen()
- func TestParser()
- func TestS3Upload()
- func TestSendingSingleMail()
- type Article
- type Author
- type BedrockRequest
- type Booking
- type CalculatorInput
- type DaySlot
- type GitLabIssue
- type GitLabIssueResponse
- type JoinedBookingResult
- type JoinedResult
- type LoginBody
- type LoginSuccess
- type LoginSuccessData
- type Message
- type MyClaims
- type Product
- type Section
- type SentimentAnalysis
- type Service
- type ServicePolicies
- type ServiceProvider
- type Slot
- type User
- type Users
- type UsersB
- type Venue
- type VerifyOTPBody
- type VerifyOTPSuccess
- type VerifySuccessData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GoogleAuth ¶
func GoogleAuth()
func TestAPIGen ¶ added in v1.8.71
func TestAPIGen()
func TestAmplifyFuncs ¶ added in v1.6.58
func TestAmplifyFuncs()
func TestDBConnection ¶ added in v1.6.63
func TestDBConnection()
func TestECSIntegration ¶ added in v1.6.60
func TestECSIntegration()
func TestGeminiImageGen ¶ added in v1.16.59
func TestGeminiImageGen()
func TestImageGen ¶ added in v1.15.2
func TestImageGen()
func TestKAIEmbeddingGeneration ¶ added in v1.16.40
func TestKAIEmbeddingGeneration()
func TestKarmaErrorPackage ¶ added in v1.2.24
func TestKarmaErrorPackage()
func TestKarmaFiles ¶ added in v1.3.26
func TestKarmaFiles()
func TestMCPServer ¶ added in v1.15.0
func TestMCPServer(auth bool)
func TestNanoBananaImageGen ¶ added in v1.16.22
func TestNanoBananaImageGen()
func TestParser ¶ added in v1.16.40
func TestParser()
func TestS3Upload ¶ added in v1.7.67
func TestS3Upload()
func TestSendingSingleMail ¶ added in v1.4.37
func TestSendingSingleMail()
Types ¶
type Article ¶ added in v1.16.40
type Article struct {
Title string `json:"title" description:"Article title"`
Summary string `json:"summary" description:"Brief summary"`
Author Author `json:"author" description:"Author information"`
Tags []string `json:"tags" description:"Article tags"`
Sections []Section `json:"sections" description:"Article sections"`
}
Example 2: Complex nested structure
type BedrockRequest ¶ added in v1.11.84
type BedrockRequest struct {
Messages []Message `json:"messages"`
AnthropicVersion string `json:"anthropic_version,omitempty"` // For Claude models
MaxTokens int `json:"max_tokens,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
TopP float64 `json:"top_p,omitempty"`
}
BedrockRequest represents the request structure for Bedrock API
type Booking ¶ added in v1.5.49
type Booking struct {
TableName string `karma_table:"bookings"`
BookingId string `json:"booking_id"`
UserId string `json:"user_id"`
ServiceProviderId string `json:"service_provider_id"`
ServiceId string `json:"service_id"`
VenueId string `json:"venue_id"`
BookingDate time.Time `json:"booking_date"`
Status string `json:"status"`
AdvancePaid int `json:"advance_paid"`
PlanId string `json:"plan_id"`
}
type CalculatorInput ¶ added in v1.15.0
type CalculatorInput struct {
Operation string `json:"operation" jsonschema_description:"The arithmetic operation to perform (add, subtract, multiply, divide)"`
X float64 `json:"x" jsonschema_description:"First number" required:"true"`
Y float64 `json:"y" jsonschema_description:"Second number" required:"true"`
Z *float64 `json:"z,omitempty" jsonschema_description:"Third number" required:"false"`
}
type GitLabIssue ¶ added in v1.8.71
type GitLabIssue struct {
Name string `json:"name" description:"Issue name"`
Description string `json:"description" description:"Issue description"`
Labels []string `json:"labels" description:"Issue labels"`
Assignees []string `json:"assignees,omitempty" description:"Users assigned to this issue"`
DueDate string `json:"due_date,omitempty" description:"Issue due date (YYYY-MM-DD)"`
}
type GitLabIssueResponse ¶ added in v1.8.71
type GitLabIssueResponse struct {
ID int `json:"id" description:"Issue ID"`
Name string `json:"name" description:"Issue name"`
Description string `json:"description" description:"Issue description"`
Labels []string `json:"labels" description:"Issue labels"`
Assignees []string `json:"assignees" description:"Users assigned to this issue"`
DueDate string `json:"due_date" description:"Issue due date (YYYY-MM-DD)"`
CreatedAt string `json:"created_at" description:"Creation timestamp"`
UpdatedAt string `json:"updated_at" description:"Last update timestamp"`
WebURL string `json:"web_url" description:"URL to view the issue in browser"`
}
type JoinedBookingResult ¶ added in v1.5.49
type JoinedBookingResult struct {
Users map[string]interface{} `json:"users"`
Bookings map[string]interface{} `json:"bookings"`
}
func GetBookingsWithUsers ¶ added in v1.5.49
func GetBookingsWithUsers(serviceProviderId string) ([]*JoinedBookingResult, error)
type JoinedResult ¶ added in v1.5.49
type JoinedResult struct {
ServiceProviders ServiceProvider `json:"service_providers" db:"service_providers"`
Venues Venue `json:"venues" db:"venues"`
}
func GetVenues ¶ added in v1.5.49
func GetVenues(serviceProviderId string) ([]*JoinedResult, error)
type LoginBody ¶ added in v1.8.71
type LoginBody struct {
Phone string `json:"phone" description:"Phone number of the user"`
}
type LoginSuccess ¶ added in v1.8.71
type LoginSuccess struct {
Success bool `json:"success" description:"Success status"`
Message string `json:"message" description:"Message"`
Data LoginSuccessData `json:"data" description:"Data"`
}
type LoginSuccessData ¶ added in v1.8.71
type MyClaims ¶ added in v1.15.0
type Product ¶ added in v1.16.40
type Product struct {
Name string `json:"name" description:"Product name"`
Price float64 `json:"price" description:"Price in USD"`
Category string `json:"category" description:"Product category"`
Features []string `json:"features" description:"List of key features"`
InStock bool `json:"in_stock" description:"Availability status"`
Rating float64 `json:"rating,omitempty" description:"User rating out of 5"`
}
Example 1: Simple structured data extraction
type SentimentAnalysis ¶ added in v1.16.40
type SentimentAnalysis struct {
OverallSentiment string `json:"overall_sentiment" description:"positive, negative, or neutral"`
Score float64 `json:"score" description:"Sentiment score from -1 to 1"`
KeyPhrases []string `json:"key_phrases" description:"Important phrases"`
Emotions map[string]float64 `json:"emotions" description:"Emotion scores"`
}
Example 3: Data analysis result
type Service ¶ added in v1.3.30
type Service struct {
TableName string `karma_table:"services"`
ServiceId string `json:"service_id" karma:"primary;unique"`
Type string `json:"type"` //"local", "online", "offline"
Name string `json:"name"`
Icon string `json:"icon"`
Banner string `json:"banner"`
Category string `json:"category"` // "food", "clothing", "electronics", "services", "entertainment", "education", "health", "beauty", "travel", "venues
OfferedBy string `json:"offered_by"` // "global", "service_provider_id"
Timestamp time.Time `json:"timestamp"`
}
type ServicePolicies ¶ added in v1.5.49
type ServiceProvider ¶ added in v1.5.49
type ServiceProvider struct {
TableName string `karma_table:"service_providers"`
Id string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"password"`
Phone string `json:"phone"`
LogoImage string `json:"logo_image"`
BannerImage string `json:"banner_image"`
Address string `json:"address"`
RegionsAvailable []string `json:"regions_available" db:"regions_available"`
LegalName string `json:"legal_name"`
LegalDocuments []string `json:"legal_documents" db:"legal_documents"`
Policies ServicePolicies `json:"policies" db:"policies"`
}
type User ¶ added in v1.5.49
type User struct {
TableName string `karma_table:"users"`
Id string `json:"id"`
Email string `json:"email"`
Phone string `json:"phone"`
Region string `json:"region"`
Address string `json:"address"`
Password string `json:"password"`
Name string `json:"name"`
Age int `json:"age"`
ProfileImage string `json:"profile_image"`
Location string `json:"location"`
ReferralCode string `json:"referral_code"`
}
type Users ¶ added in v1.3.30
type Users struct {
TableName string `karma_table:"users"`
Id string `json:"id"`
Email string `json:"email"`
Username string `json:"username"`
Name string `json:"name"`
Phone string `json:"phone"`
Profile string `json:"profile"`
Bio string `json:"bio"`
College string `json:"college"`
Year int `json:"year"`
Branch string `json:"branch"`
Roll string `json:"roll"`
JoinedAt time.Time `json:"joined_at"`
}
type UsersB ¶ added in v1.8.71
type UsersB struct {
TableName struct{} `karma_table:"users"`
Id string `json:"id" karma:"primary"`
Username string `json:"username"`
Email string `json:"email"`
Name string `json:"name"`
Phone string `json:"phone"`
Bio string `json:"bio"`
ProfileImage string `json:"profile_image"`
Socials map[string]string `json:"socials" db:"socials"`
DateOfBirth time.Time `json:"date_of_birth"`
Gender string `json:"gender"`
CreatedAt time.Time `json:"created_at"`
DeviceId string `json:"device_id"`
PasswordHash string `json:"password_hash"`
}
type Venue ¶ added in v1.5.49
type Venue struct {
TableName string `karma_table:"venues"`
Id string `json:"id"`
ServiceProvider string `json:"service_provider"`
Name string `json:"name"`
Address string `json:"address"`
Description string `json:"description"`
Media []string `json:"media" db:"media"`
Location string `json:"location"`
Slots []DaySlot `json:"slots" db:"slots"`
PricePerSlot int `json:"price_per_slot"`
MaxCapacity int `json:"max_capacity"`
Region string `json:"region"`
Essentials []string `json:"essentials" db:"essentials"`
Accessibility bool `json:"accessibility"`
Catering bool `json:"catering"`
Dining bool `json:"dining"`
Type string `json:"type"`
}
type VerifyOTPBody ¶ added in v1.8.71
type VerifyOTPSuccess ¶ added in v1.8.71
type VerifyOTPSuccess struct {
Success bool `json:"success" description:"Success status"`
Message string `json:"message" description:"Message"`
Data VerifySuccessData `json:"data" description:"Data"`
}
type VerifySuccessData ¶ added in v1.8.71
Click to show internal directories.
Click to hide internal directories.