{"modulePath":"github.com/AlaudaDevops/toolbox/pr-cli","version":"v0.0.0-20261019083812-38d5e0ad0d24","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package config\n\nPackage config provides configuration management for the PR CLI application\n\n## Variables\n\n```go\nvar (\n\tErrMissingPlatform       = errors.New(\"platform is required\")\n\tErrMissingToken          = errors.New(\"token is required\")\n\tErrMissingOwner          = errors.New(\"repository owner is required\")\n\tErrMissingRepo           = errors.New(\"repository name is required\")\n\tErrInvalidPRNum          = errors.New(\"PR number must be greater than 0\")\n\tErrMissingCommentSender  = errors.New(\"comment sender is required\")\n\tErrMissingTriggerComment = errors.New(\"trigger comment is required\")\n)\n```\nConfiguration validation errors\n\n## Types\n\n```go\ntype Config struct {\n\t// Platform configuration\n\tPlatform     string `json:\"platform\" yaml:\"platform\" mapstructure:\"platform\"`\n\tToken        string `json:\"token\" yaml:\"token\" mapstructure:\"token\"`\n\tCommentToken string `json:\"comment_token,omitempty\" yaml:\"comment_token,omitempty\" mapstructure:\"comment-token\"`\n\tBaseURL      string `json:\"base_url,omitempty\" yaml:\"base_url,omitempty\" mapstructure:\"base-url\"`\n\n\t// Repository configuration\n\tOwner string `json:\"owner\" yaml:\"owner\" mapstructure:\"repo-owner\"`\n\tRepo  string `json:\"repo\" yaml:\"repo\" mapstructure:\"repo-name\"`\n\n\t// PR configuration\n\tPRNum         int    `json:\"pr_num\" yaml:\"pr_num\" mapstructure:\"pr-num\"`\n\tCommentSender string `json:\"comment_sender\" yaml:\"comment_sender\" mapstructure:\"comment-sender\"`\n\n\t// CLI-specific configuration\n\tTriggerComment string `json:\"trigger_comment,omitempty\" yaml:\"trigger_comment,omitempty\" mapstructure:\"trigger-comment\"`\n\tDebug          bool   `json:\"debug,omitempty\" yaml:\"debug,omitempty\" mapstructure:\"debug\"`\n\tVerbose        bool   `json:\"verbose,omitempty\" yaml:\"verbose,omitempty\" mapstructure:\"verbose\"`\n\tLogFormat      string `json:\"log_format,omitempty\" yaml:\"log_format,omitempty\" mapstructure:\"log-format\"`\n\tResultsDir     string `json:\"results_dir,omitempty\" yaml:\"results_dir,omitempty\" mapstructure:\"results-dir\"`\n\n\t// LGTM configuration\n\tLGTMThreshold   int      `json:\"lgtm_threshold\" yaml:\"lgtm_threshold\" mapstructure:\"lgtm-threshold\"`\n\tLGTMPermissions []string `json:\"lgtm_permissions\" yaml:\"lgtm_permissions\" mapstructure:\"lgtm-permissions\"`\n\tLGTMReviewEvent string   `json:\"lgtm_review_event,omitempty\" yaml:\"lgtm_review_event,omitempty\" mapstructure:\"lgtm-review-event\"`\n\tRobotAccounts   []string `json:\"robot_accounts,omitempty\" yaml:\"robot_accounts,omitempty\" mapstructure:\"robot-accounts\"`\n\n\t// Merge configuration\n\tMergeMethod string `json:\"merge_method\" yaml:\"merge_method\" mapstructure:\"merge-method\"`\n\n\t// Check configuration\n\tSelfCheckName string `json:\"self_check_name,omitempty\" yaml:\"self_check_name,omitempty\" mapstructure:\"self-check-name\"`\n\n\t// Cherry-pick configuration\n\tUseGitCLIForCherryPick bool `json:\"use_git_cli_for_cherrypick,omitempty\" yaml:\"use_git_cli_for_cherrypick,omitempty\" mapstructure:\"use-git-cli-for-cherrypick\"`\n\n\t// Logging configuration\n\tLogLevel string `json:\"log_level\" yaml:\"log_level\" mapstructure:\"log-level\"`\n}\n```\nConfig holds the configuration for PR CLI operations\n\n```go\nfunc NewDefaultConfig() *Config\n```\nNewDefaultConfig returns a new Config with default values\n\n```go\nfunc (c *Config) DebugString() string\n```\nDebugString returns a JSON representation of the config with sensitive information redacted\n\n```go\nfunc (c *Config) HasLGTMPermission(userPerm string) bool\n```\nHasLGTMPermission checks if the given permission is in the LGTM permissions list\n\n```go\nfunc (c *Config) IsRobotUser(user string) bool\n```\nIsRobotUser checks if the user is a robot user that should be excluded from LGTM status\n\n```go\nfunc (c *Config) Validate() error\n```\nValidate checks if the configuration is valid\n\n```go\ntype WebhookConfig struct {\n\t// Server settings\n\tListenAddr  string `json:\"listen_addr\" yaml:\"listen_addr\" mapstructure:\"listen-addr\"`\n\tWebhookPath string `json:\"webhook_path\" yaml:\"webhook_path\" mapstructure:\"webhook-path\"`\n\tHealthPath  string `json:\"health_path\" yaml:\"health_path\" mapstructure:\"health-path\"`\n\tMetricsPath string `json:\"metrics_path\" yaml:\"metrics_path\" mapstructure:\"metrics-path\"`\n\n\t// Security\n\tWebhookSecret    string   `json:\"-\" yaml:\"-\" mapstructure:\"webhook-secret\"`\n\tAllowedRepos     []string `json:\"allowed_repos\" yaml:\"allowed_repos\" mapstructure:\"allowed-repos\"`\n\tRequireSignature bool     `json:\"require_signature\" yaml:\"require_signature\" mapstructure:\"require-signature\"`\n\n\t// TLS\n\tTLSEnabled  bool   `json:\"tls_enabled\" yaml:\"tls_enabled\" mapstructure:\"tls-enabled\"`\n\tTLSCertFile string `json:\"tls_cert_file\" yaml:\"tls_cert_file\" mapstructure:\"tls-cert-file\"`\n\tTLSKeyFile  string `json:\"tls_key_file\" yaml:\"tls_key_file\" mapstructure:\"tls-key-file\"`\n\n\t// Processing\n\tAsyncProcessing bool `json:\"async_processing\" yaml:\"async_processing\" mapstructure:\"async-processing\"`\n\tWorkerCount     int  `json:\"worker_count\" yaml:\"worker_count\" mapstructure:\"worker-count\"`\n\tQueueSize       int  `json:\"queue_size\" yaml:\"queue_size\" mapstructure:\"queue-size\"`\n\n\t// Rate limiting\n\tRateLimitEnabled  bool `json:\"rate_limit_enabled\" yaml:\"rate_limit_enabled\" mapstructure:\"rate-limit-enabled\"`\n\tRateLimitRequests int  `json:\"rate_limit_requests\" yaml:\"rate_limit_requests\" mapstructure:\"rate-limit-requests\"`\n\n\t// Pull Request event configuration\n\tPREventEnabled bool     `json:\"pr_event_enabled\" yaml:\"pr_event_enabled\" mapstructure:\"pr-event-enabled\"`\n\tPREventActions []string `json:\"pr_event_actions\" yaml:\"pr_event_actions\" mapstructure:\"pr-event-actions\"`\n\n\t// Workflow dispatch configuration\n\tWorkflowFile   string            `json:\"workflow_file\" yaml:\"workflow_file\" mapstructure:\"workflow-file\"`\n\tWorkflowRepo   string            `json:\"workflow_repo\" yaml:\"workflow_repo\" mapstructure:\"workflow-repo\"`\n\tWorkflowRef    string            `json:\"workflow_ref\" yaml:\"workflow_ref\" mapstructure:\"workflow-ref\"`\n\tWorkflowInputs map[string]string `json:\"workflow_inputs\" yaml:\"workflow_inputs\" mapstructure:\"workflow-inputs\"`\n\n\t// Base PR CLI configuration\n\tBaseConfig *Config `json:\"-\" yaml:\"-\"`\n}\n```\nWebhookConfig holds webhook server configuration\n\n```go\nfunc NewDefaultWebhookConfig() *WebhookConfig\n```\nNewDefaultWebhookConfig returns default webhook configuration\n\n```go\nfunc (wc *WebhookConfig) DebugString() string\n```\nDebugString returns a string representation with sensitive data redacted\n\n```go\nfunc (wc *WebhookConfig) LoadFromEnv() error\n```\nLoadFromEnv loads webhook configuration from environment variables\n\n```go\nfunc (wc *WebhookConfig) Validate() error\n```\nValidate checks if the webhook configuration is valid\n\n","path":"github.com/AlaudaDevops/toolbox/pr-cli/pkg/config","name":"config","synopsis":"Package config provides configuration management for the PR CLI application","isRedistributable":true}
