tests

package
v1.16.63 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoogleAuth

func GoogleAuth()

func ORMTest added in v1.3.30

func ORMTest()

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 TestKai added in v1.5.38

func TestKai()

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 Author added in v1.16.40

type Author struct {
	Name  string `json:"name" description:"Author name"`
	Email string `json:"email,omitempty" description:"Author email"`
}

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 DaySlot added in v1.5.49

type DaySlot struct {
	WeekDay string `json:"week_day"`
	Slots   []Slot `json:"slots"`
}

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 LoginSuccessData struct {
	AccountExists bool `json:"account_exists" description:"If Account exists"`
	TestPhone     bool `json:"test_phone" description:"Is it a Test phone"`
}

type Message added in v1.11.84

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

Message represents a single message in the conversation

type MyClaims added in v1.15.0

type MyClaims struct {
	UserID      string `json:"uid"`
	Phone       string `json:"phone"`
	Email       string `json:"email"`
	Gender      string `json:"gender"`
	DateOfBirth string `json:"date_of_birth"`
	Name        string `json:"name"`
	Pfp         string `json:"pfp"`
	Role        string `json:"role"`
	jwt.StandardClaims
}

func (*MyClaims) GetEmail added in v1.15.0

func (c *MyClaims) GetEmail() string

func (*MyClaims) GetRole added in v1.15.0

func (c *MyClaims) GetRole() string

func (*MyClaims) GetUserID added in v1.15.0

func (c *MyClaims) GetUserID() string

func (*MyClaims) IsExpired added in v1.15.0

func (c *MyClaims) IsExpired() bool

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 Section added in v1.16.40

type Section struct {
	Heading string `json:"heading" description:"Section heading"`
	Content string `json:"content" description:"Section content"`
}

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 ServicePolicies struct {
	Cancellation   int  `json:"cancellation"`
	AdvanceBooking int  `json:"advance_booking"`
	AdvancePayment int  `json:"advance_payment"`
	Refund         bool `json:"refund"`
}

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 Slot added in v1.5.49

type Slot struct {
	StartTime string `json:"start_time"`
	EndTime   string `json:"end_time"`
}

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 VerifyOTPBody struct {
	Phone string `json:"phone" description:"Phone number of the user"`
	OTP   string `json:"otp" description:"OTP sent to the user"`
}

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

type VerifySuccessData struct {
	AccountExists bool   `json:"account_exists" description:"If Account exists"`
	Token         string `json:"token" description:"JWT Token"`
}

Jump to

Keyboard shortcuts

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