config

package
v0.0.0-...-27b1c5b Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	BaseURL         string            `json:"base_url"`
	Timeout         time.Duration     `json:"timeout"`
	RetryCount      int               `json:"retry_count"`
	RetryDelay      time.Duration     `json:"retry_delay"`
	DefaultHeaders  map[string]string `json:"default_headers"`
	Auth            *AuthConfig       `json:"auth,omitempty"`
	TLSConfig       *TLSConfig        `json:"tls_config,omitempty"`
	MaxConnections  int               `json:"max_connections"`
	KeepAlive       bool              `json:"keep_alive"`
	FollowRedirects bool              `json:"follow_redirects"`
}

APIConfig holds API testing configuration

type AppiumServerConfig

type AppiumServerConfig struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

AppiumServerConfig holds Appium server configuration

type AuthConfig

type AuthConfig struct {
	Type     string            `json:"type"` // basic, bearer, oauth2, api_key
	Username string            `json:"username,omitempty"`
	Password string            `json:"password,omitempty"`
	Token    string            `json:"token,omitempty"`
	APIKey   string            `json:"api_key,omitempty"`
	Headers  map[string]string `json:"headers,omitempty"`
}

AuthConfig holds authentication configuration

type BrowserConfig

type BrowserConfig struct {
	Browser        string        `json:"browser"`
	Headless       bool          `json:"headless"`
	WindowSize     string        `json:"window_size"`
	Timeout        time.Duration `json:"timeout"`
	ScreenshotPath string        `json:"screenshot_path"`
	DownloadPath   string        `json:"download_path"`
	UserAgent      string        `json:"user_agent"`
	DisableImages  bool          `json:"disable_images"`
	DisableCSS     bool          `json:"disable_css"`
	DisableJS      bool          `json:"disable_js"`
	MaxInstances   int           `json:"max_instances"`
	ReuseInstances bool          `json:"reuse_instances"`
	BrowserArgs    []string      `json:"browser_args"`
	Extensions     []string      `json:"extensions"`
	Proxy          *ProxyConfig  `json:"proxy,omitempty"`
}

BrowserConfig holds browser-specific configuration

type Config

type Config struct {
	BrowserConfig  *BrowserConfig  `json:"browser_config"`
	APIConfig      *APIConfig      `json:"api_config"`
	DatabaseConfig *DatabaseConfig `json:"database_config"`
	ReportConfig   *ReportConfig   `json:"report_config"`
	MobileConfig   *MobileConfig   `json:"mobile_config"`
	Parallel       bool            `json:"parallel"`
	MaxWorkers     int             `json:"max_workers"`
	Timeout        time.Duration   `json:"timeout"`
}

Config represents the main configuration for the Gowright framework

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default configuration

type ConfigBuilder

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

ConfigBuilder provides a fluent interface for building configurations

func NewConfigBuilder

func NewConfigBuilder() *ConfigBuilder

NewConfigBuilder creates a new configuration builder

func (*ConfigBuilder) Build

func (cb *ConfigBuilder) Build() *Config

Build returns the built configuration

func (*ConfigBuilder) WithAPIConfig

func (cb *ConfigBuilder) WithAPIConfig(baseURL string, timeout time.Duration) *ConfigBuilder

WithAPIConfig configures API settings

func (*ConfigBuilder) WithBrowser

func (cb *ConfigBuilder) WithBrowser(browser string, headless bool) *ConfigBuilder

WithBrowser configures browser settings

func (*ConfigBuilder) WithBrowserTimeout

func (cb *ConfigBuilder) WithBrowserTimeout(timeout time.Duration) *ConfigBuilder

WithBrowserTimeout sets browser timeout

func (*ConfigBuilder) WithDatabaseConfig

func (cb *ConfigBuilder) WithDatabaseConfig(maxOpen, maxIdle int) *ConfigBuilder

WithDatabaseConfig configures database settings

func (*ConfigBuilder) WithParallel

func (cb *ConfigBuilder) WithParallel(enabled bool, maxWorkers int) *ConfigBuilder

WithParallel configures parallel execution

func (*ConfigBuilder) WithTimeout

func (cb *ConfigBuilder) WithTimeout(timeout time.Duration) *ConfigBuilder

WithTimeout sets global timeout

type DatabaseConfig

type DatabaseConfig struct {
	Connections        map[string]*DatabaseConnection `json:"connections"`
	DefaultConn        string                         `json:"default_connection"`
	MaxOpenConns       int                            `json:"max_open_connections"`
	MaxIdleConns       int                            `json:"max_idle_connections"`
	ConnMaxLife        time.Duration                  `json:"connection_max_lifetime"`
	QueryTimeout       time.Duration                  `json:"query_timeout"`
	TransactionTimeout time.Duration                  `json:"transaction_timeout"`
}

DatabaseConfig holds database configuration

type DatabaseConnection

type DatabaseConnection struct {
	Driver   string            `json:"driver"` // mysql, postgres, sqlite3
	Host     string            `json:"host"`
	Port     int               `json:"port"`
	Database string            `json:"database"`
	Username string            `json:"username"`
	Password string            `json:"password"`
	SSLMode  string            `json:"ssl_mode,omitempty"`
	Options  map[string]string `json:"options,omitempty"`
}

DatabaseConnection represents a single database connection configuration

type DeviceConfig

type DeviceConfig struct {
	Name         string                 `json:"name"`
	PlatformName string                 `json:"platform_name"` // iOS, Android
	DeviceName   string                 `json:"device_name"`
	UDID         string                 `json:"udid,omitempty"`
	Version      string                 `json:"version"`
	Capabilities map[string]interface{} `json:"capabilities,omitempty"`
}

DeviceConfig holds device-specific configuration

type MobileConfig

type MobileConfig struct {
	AppiumServer   *AppiumServerConfig `json:"appium_server"`
	DefaultDevice  *DeviceConfig       `json:"default_device"`
	Devices        []*DeviceConfig     `json:"devices"`
	AppPath        string              `json:"app_path"`
	Timeout        time.Duration       `json:"timeout"`
	ImplicitWait   time.Duration       `json:"implicit_wait"`
	ScreenshotPath string              `json:"screenshot_path"`
}

MobileConfig holds mobile testing configuration

type ProxyConfig

type ProxyConfig struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

ProxyConfig holds proxy configuration

type ReportConfig

type ReportConfig struct {
	Enabled     bool                   `json:"enabled"`
	OutputDir   string                 `json:"output_dir"`
	Formats     []string               `json:"formats"` // html, json, xml, junit
	Template    string                 `json:"template,omitempty"`
	IncludeLogs bool                   `json:"include_logs"`
	Compress    bool                   `json:"compress"`
	Reporters   map[string]interface{} `json:"reporters,omitempty"`
}

ReportConfig holds reporting configuration

type TLSConfig

type TLSConfig struct {
	InsecureSkipVerify bool   `json:"insecure_skip_verify"`
	CertFile           string `json:"cert_file,omitempty"`
	KeyFile            string `json:"key_file,omitempty"`
	CAFile             string `json:"ca_file,omitempty"`
}

TLSConfig holds TLS configuration

Jump to

Keyboard shortcuts

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