Documentation
¶
Index ¶
- type AccountConfig
- type AdminAuthConfig
- type AdminConfig
- type AuthConfig
- type BillingConfig
- type ChaosConfig
- type ChaosRule
- type ClerkConfig
- type CloudflareConfig
- type ComplianceConfig
- type Config
- type CostConfig
- type DashboardConfig
- type DataPlaneConfig
- type DefaultRetentionConfig
- type DuckDBConfig
- type DynamoDBPricing
- type DynamoDBStoreConfig
- type GatewayConfig
- type IAMConfig
- type IncidentConfig
- type LambdaPricing
- type LoggingConfig
- type MonitorConfig
- type NotificationsConfig
- type NotifyChannelConfig
- type NotifyRouteConfig
- type NotifyRouteMatchConfig
- type OTLPConfig
- type OTelConfig
- type PersistenceConfig
- type PostgreSQLConfig
- type PricingConfig
- type PrometheusConfig
- type ProvisioningConfig
- type RUMConfig
- type RateLimitConfig
- type RegressionConfig
- type S3Pricing
- type SCMConfig
- type SCMRepoConfig
- type SLOConfig
- type SLORule
- type SQSPricing
- type SaaSConfig
- type ServiceConfig
- type StripeConfig
- type TransferPricing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountConfig ¶
AccountConfig defines a pre-provisioned AWS account for multi-account support.
type AdminAuthConfig ¶
type AdminAuthConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
APIKey string `yaml:"api_key" json:"-"` // never serialize the key
}
AdminAuthConfig holds admin API authentication configuration.
type AdminConfig ¶
type AdminConfig struct {
Port int `yaml:"port"`
}
AdminConfig holds admin API configuration.
type AuthConfig ¶
type AuthConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Secret string `yaml:"secret" json:"secret"`
}
AuthConfig holds JWT-based RBAC authentication configuration.
type BillingConfig ¶
type BillingConfig struct {
FreeRequestLimit int64 `yaml:"free_request_limit" json:"free_request_limit"` // Requests/mo before billing kicks in
PricePerTenK float64 `yaml:"price_per_10k" json:"price_per_10k"` // USD per 10K requests over free limit
DefaultInfraType string `yaml:"default_infra_type" json:"default_infra_type"` // "shared" or "dedicated"
UsageWindowDays int `yaml:"usage_window_days" json:"usage_window_days"` // Rolling window for usage chart
MaxAuditEntries int `yaml:"max_audit_entries" json:"max_audit_entries"` // Max entries before truncation
}
BillingConfig holds SaaS billing and usage pricing parameters. These are exposed to the frontend via /api/platform/pricing.
type ChaosConfig ¶
type ChaosConfig struct {
Rules []ChaosRule `yaml:"rules"`
}
ChaosConfig holds chaos/fault injection configuration.
type ChaosRule ¶
type ChaosRule struct {
Service string `yaml:"service"`
Action string `yaml:"action"`
Type string `yaml:"type"`
ErrorCode int `yaml:"error_code"`
ErrorMsg string `yaml:"error_msg"`
LatencyMs int `yaml:"latency_ms"`
Percentage int `yaml:"percentage"`
}
ChaosRule defines a fault injection rule loaded from the config file.
type ClerkConfig ¶
type ClerkConfig struct {
SecretKey string `yaml:"secret_key"`
WebhookSecret string `yaml:"webhook_secret"`
Domain string `yaml:"domain"` // Clerk frontend API domain (e.g. "abc.clerk.accounts.dev")
PublishableKey string `yaml:"publishable_key"` // Clerk publishable key for frontend auth (pk_test_ or pk_live_)
}
ClerkConfig holds Clerk authentication configuration.
type CloudflareConfig ¶
CloudflareConfig holds Cloudflare DNS configuration.
type ComplianceConfig ¶
type ComplianceConfig struct {
// RedactEnabled turns on field-level redaction for stored traces, requests, and audit entries.
RedactEnabled bool `yaml:"redact_enabled" json:"redact_enabled"`
// RedactHeaders is additional header names to redact (beyond defaults).
RedactHeaders []string `yaml:"redact_headers" json:"redact_headers"`
// RedactFields is additional JSON body field names to redact (beyond defaults).
RedactFields []string `yaml:"redact_fields" json:"redact_fields"`
}
ComplianceConfig controls data redaction for HIPAA/PCI/GDPR compliance.
type Config ¶
type Config struct {
Region string `yaml:"region"`
AccountID string `yaml:"account_id"`
Profile string `yaml:"profile"`
IAM IAMConfig `yaml:"iam"`
Persistence PersistenceConfig `yaml:"persistence"`
Gateway GatewayConfig `yaml:"gateway"`
Dashboard DashboardConfig `yaml:"dashboard"`
Admin AdminConfig `yaml:"admin"`
Logging LoggingConfig `yaml:"logging"`
SLO SLOConfig `yaml:"slo"`
AdminAuth AdminAuthConfig `yaml:"admin_auth"`
Auth AuthConfig `yaml:"auth"`
DataPlane DataPlaneConfig `yaml:"dataplane"`
Regression RegressionConfig `yaml:"regression"`
Cost CostConfig `yaml:"cost" json:"cost"`
Incidents IncidentConfig `yaml:"incidents" json:"incidents"`
Monitor MonitorConfig `yaml:"monitor" json:"monitor"`
RateLimit RateLimitConfig `yaml:"rate_limit" json:"rate_limit"`
RUM RUMConfig `yaml:"rum" json:"rum"`
OTLP OTLPConfig `yaml:"otlp" json:"otlp"`
Chaos ChaosConfig `yaml:"chaos" json:"chaos"`
IaCDir string `yaml:"iac_dir" json:"iac_dir"` // Path to Pulumi/Terraform project
IaCEnv string `yaml:"iac_env" json:"iac_env"` // Environment name (dev/stage/prod)
SaaS SaaSConfig `yaml:"saas"`
Compliance ComplianceConfig `yaml:"compliance" json:"compliance"`
Billing BillingConfig `yaml:"billing" json:"billing"`
Retention DefaultRetentionConfig `yaml:"retention" json:"retention"`
Notifications NotificationsConfig `yaml:"notifications" json:"notifications"`
SCM SCMConfig `yaml:"scm" json:"scm"`
Services map[string]ServiceConfig `yaml:"services"`
Accounts []AccountConfig `yaml:"accounts"`
// ServicePrefixes are stripped from topology node labels and recognized as
// caller identifiers in request logs. Empty by default; set to e.g.
// ["mycorp-", "mycorp_"] to recognize your IaC naming convention.
ServicePrefixes []string `yaml:"service_prefixes" json:"service_prefixes"`
// IaCMicroserviceClasses are TypeScript class names whose `new` invocations
// in a Pulumi project denote a Lambda-backed microservice (extracted as a
// MicroserviceDef). Empty by default — set to e.g.
// ["MyCorpLambdaModuleResource"] to wire your own pattern.
IaCMicroserviceClasses []string `yaml:"iac_microservice_classes" json:"iac_microservice_classes"`
}
Config is the top-level configuration for cloudmock.
func LoadFromFile ¶
LoadFromFile loads a Config from a YAML file, using Default() as the base.
func (*Config) ApplyEnv ¶
func (c *Config) ApplyEnv()
ApplyEnv applies environment variable overrides to the Config.
func (*Config) EnabledServices ¶
EnabledServices returns the list of services enabled for the current profile. Returns nil for the "full" profile, meaning all services are enabled.
type CostConfig ¶
type CostConfig struct {
Pricing PricingConfig `yaml:"pricing" json:"pricing"`
}
CostConfig holds cost intelligence engine configuration.
type DashboardConfig ¶
DashboardConfig holds dashboard-related configuration.
type DataPlaneConfig ¶
type DataPlaneConfig struct {
Mode string `yaml:"mode" json:"mode"` // "local", "dynamodb", "production"
DuckDB DuckDBConfig `yaml:"duckdb" json:"duckdb"`
PostgreSQL PostgreSQLConfig `yaml:"postgresql" json:"postgresql"`
Prometheus PrometheusConfig `yaml:"prometheus" json:"prometheus"`
OTel OTelConfig `yaml:"otel" json:"otel"`
DynamoDB DynamoDBStoreConfig `yaml:"dynamodb" json:"dynamodb"`
}
DataPlaneConfig holds data plane configuration for request/trace storage.
type DefaultRetentionConfig ¶
type DefaultRetentionConfig struct {
AuditLog int `yaml:"audit_log" json:"audit_log"`
RequestLog int `yaml:"request_log" json:"request_log"`
StateSnapshot int `yaml:"state_snapshot" json:"state_snapshot"`
}
DefaultRetentionConfig holds default data retention periods (days).
type DuckDBConfig ¶
type DuckDBConfig struct {
Path string `yaml:"path" json:"path"` // default: "cloudmock.duckdb"
}
DuckDBConfig holds DuckDB database configuration.
type DynamoDBPricing ¶
type DynamoDBPricing struct {
PerRCU float64 `json:"perRCU" yaml:"perRCU"`
PerWCU float64 `json:"perWCU" yaml:"perWCU"`
}
DynamoDBPricing holds per-operation pricing for DynamoDB.
type DynamoDBStoreConfig ¶
type DynamoDBStoreConfig struct {
TableName string `yaml:"table_name" json:"table_name"` // default: "cloudmock-data"
Region string `yaml:"region" json:"region"` // default: from AWS env/config
Endpoint string `yaml:"endpoint" json:"endpoint"` // optional: for local DynamoDB
TenantID string `yaml:"tenant_id" json:"tenant_id"` // default tenant for non-SaaS mode
}
DynamoDBStoreConfig holds DynamoDB persistence configuration for the single-table multi-tenant data store.
type GatewayConfig ¶
type GatewayConfig struct {
Port int `yaml:"port"`
}
GatewayConfig holds gateway-related configuration.
type IAMConfig ¶
type IAMConfig struct {
Mode string `yaml:"mode"`
RootAccessKey string `yaml:"root_access_key"`
RootSecretKey string `yaml:"root_secret_key"`
SeedFile string `yaml:"seed_file"`
}
IAMConfig holds IAM-related configuration.
type IncidentConfig ¶
type IncidentConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
GroupWindow string `yaml:"group_window" json:"group_window"`
}
IncidentConfig holds incident management configuration.
type LambdaPricing ¶
type LambdaPricing struct {
PerGBSecond float64 `json:"perGBSecond" yaml:"perGBSecond"`
DefaultMemoryMB float64 `json:"defaultMemoryMB" yaml:"defaultMemoryMB"`
}
LambdaPricing holds per-invocation pricing for AWS Lambda.
type LoggingConfig ¶
LoggingConfig holds logging configuration.
type MonitorConfig ¶
type MonitorConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
EvalInterval string `yaml:"eval_interval" json:"eval_interval"` // Go duration (default "30s")
}
MonitorConfig holds monitoring and alerting configuration.
type NotificationsConfig ¶
type NotificationsConfig struct {
Channels []NotifyChannelConfig `yaml:"channels" json:"channels"`
Routes []NotifyRouteConfig `yaml:"routes" json:"routes"`
}
NotificationsConfig holds alert routing configuration.
type NotifyChannelConfig ¶
type NotifyChannelConfig struct {
Type string `yaml:"type" json:"type"`
Name string `yaml:"name" json:"name"`
WebhookURL string `yaml:"webhook_url,omitempty" json:"webhook_url,omitempty"`
RoutingKey string `yaml:"routing_key,omitempty" json:"routing_key,omitempty"`
SMTPHost string `yaml:"smtp_host,omitempty" json:"smtp_host,omitempty"`
SMTPPort int `yaml:"smtp_port,omitempty" json:"smtp_port,omitempty"`
Username string `yaml:"username,omitempty" json:"username,omitempty"`
Password string `yaml:"password,omitempty" json:"password,omitempty"`
From string `yaml:"from,omitempty" json:"from,omitempty"`
To string `yaml:"to,omitempty" json:"to,omitempty"` // comma-separated
}
NotifyChannelConfig defines a notification channel in config.
type NotifyRouteConfig ¶
type NotifyRouteConfig struct {
Name string `yaml:"name" json:"name"`
Match NotifyRouteMatchConfig `yaml:"match,omitempty" json:"match,omitempty"`
Channels []string `yaml:"channels" json:"channels"` // channel names
}
NotifyRouteConfig defines a routing rule in config.
type NotifyRouteMatchConfig ¶
type NotifyRouteMatchConfig struct {
Services []string `yaml:"services,omitempty" json:"services,omitempty"`
Severities []string `yaml:"severities,omitempty" json:"severities,omitempty"`
Types []string `yaml:"types,omitempty" json:"types,omitempty"`
}
NotifyRouteMatchConfig defines match conditions in config.
type OTLPConfig ¶
type OTLPConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Port int `yaml:"port" json:"port"` // OTLP/HTTP port
GRPCPort int `yaml:"grpc_port" json:"grpc_port"` // OTLP/gRPC port (0 = disabled)
}
OTLPConfig holds OTLP ingestion endpoint configuration.
type OTelConfig ¶
type OTelConfig struct {
CollectorEndpoint string `yaml:"collector_endpoint" json:"collector_endpoint"`
ServiceName string `yaml:"service_name" json:"service_name"`
}
OTelConfig holds OpenTelemetry configuration.
type PersistenceConfig ¶
PersistenceConfig holds persistence-related configuration.
type PostgreSQLConfig ¶
type PostgreSQLConfig struct {
URL string `yaml:"url" json:"url"`
}
PostgreSQLConfig holds PostgreSQL connection configuration.
type PricingConfig ¶
type PricingConfig struct {
Lambda LambdaPricing `json:"lambda" yaml:"lambda"`
DynamoDB DynamoDBPricing `json:"dynamodb" yaml:"dynamodb"`
S3 S3Pricing `json:"s3" yaml:"s3"`
SQS SQSPricing `json:"sqs" yaml:"sqs"`
DataTransfer TransferPricing `json:"dataTransfer" yaml:"dataTransfer"`
}
PricingConfig holds all service pricing configurations.
func DefaultPricingConfig ¶
func DefaultPricingConfig() PricingConfig
DefaultPricingConfig returns a PricingConfig with standard AWS pricing.
type PrometheusConfig ¶
type PrometheusConfig struct {
URL string `yaml:"url" json:"url"`
}
PrometheusConfig holds Prometheus connection configuration.
type ProvisioningConfig ¶
type ProvisioningConfig struct {
FlyAPIToken string `yaml:"fly_api_token"`
FlyOrg string `yaml:"fly_org"`
FlyRegion string `yaml:"fly_region"`
Image string `yaml:"image"`
IdleTimeoutMinutes int `yaml:"idle_timeout_minutes"`
DataRetentionDays int `yaml:"data_retention_days"`
}
ProvisioningConfig holds Fly Machines provisioning configuration.
type RUMConfig ¶
type RUMConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
SampleRate float64 `yaml:"sample_rate" json:"sample_rate"` // 0.0–1.0
MaxEvents int `yaml:"max_events" json:"max_events"` // circular buffer capacity
}
RUMConfig holds Real User Monitoring configuration.
type RateLimitConfig ¶
type RateLimitConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
RequestsPerSecond float64 `yaml:"requests_per_second" json:"requests_per_second"`
Burst int `yaml:"burst" json:"burst"`
}
RateLimitConfig holds rate limiting configuration.
type RegressionConfig ¶
type RegressionConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
ScanInterval string `yaml:"scan_interval" json:"scan_interval"`
Window string `yaml:"window" json:"window"`
}
RegressionConfig holds regression detection configuration.
type S3Pricing ¶
type S3Pricing struct {
PerGET float64 `json:"perGET" yaml:"perGET"`
PerPUT float64 `json:"perPUT" yaml:"perPUT"`
}
S3Pricing holds per-request pricing for S3.
type SCMConfig ¶
type SCMConfig struct {
Provider string `yaml:"provider" json:"provider"`
Token string `yaml:"token" json:"-"` // never serialize the token
Repos []SCMRepoConfig `yaml:"repos" json:"repos"`
}
SCMConfig holds source code management integration configuration.
type SCMRepoConfig ¶
type SCMRepoConfig struct {
Owner string `yaml:"owner" json:"owner"`
Repo string `yaml:"repo" json:"repo"`
PathPrefix string `yaml:"path_prefix" json:"path_prefix"`
}
SCMRepoConfig maps a repository to path-strip rules.
type SLOConfig ¶
type SLOConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Rules []SLORule `yaml:"rules" json:"rules"`
}
SLOConfig holds SLO configuration.
type SLORule ¶
type SLORule struct {
Service string `yaml:"service" json:"service"` // e.g. "dynamodb", "*" for all
Action string `yaml:"action" json:"action"` // e.g. "Query", "*" for all
P50Ms float64 `yaml:"p50_ms" json:"p50_ms"` // target P50 latency
P95Ms float64 `yaml:"p95_ms" json:"p95_ms"` // target P95 latency
P99Ms float64 `yaml:"p99_ms" json:"p99_ms"` // target P99 latency
ErrorRate float64 `yaml:"error_rate" json:"error_rate"` // max acceptable error rate (0.01 = 1%)
}
SLORule defines a latency SLO for a service/action.
type SQSPricing ¶
type SQSPricing struct {
PerRequest float64 `json:"perRequest" yaml:"perRequest"`
}
SQSPricing holds per-request pricing for SQS.
type SaaSConfig ¶
type SaaSConfig struct {
Enabled bool `yaml:"enabled"`
Clerk ClerkConfig `yaml:"clerk"`
Stripe StripeConfig `yaml:"stripe"`
Provisioning ProvisioningConfig `yaml:"provisioning"`
Cloudflare CloudflareConfig `yaml:"cloudflare"`
}
SaaSConfig holds hosted SaaS configuration.
type ServiceConfig ¶
type ServiceConfig struct {
Enabled *bool `yaml:"enabled"`
Port int `yaml:"port"`
Runtimes []string `yaml:"runtimes"`
}
ServiceConfig holds per-service configuration.
type StripeConfig ¶
type StripeConfig struct {
SecretKey string `yaml:"secret_key"`
WebhookSecret string `yaml:"webhook_secret"`
ProPriceID string `yaml:"pro_price_id"`
TeamPriceID string `yaml:"team_price_id"`
}
StripeConfig holds Stripe billing configuration.
type TransferPricing ¶
type TransferPricing struct {
PerKB float64 `json:"perKB" yaml:"perKB"`
}
TransferPricing holds data transfer pricing.