config

package
v0.0.0-...-87e4b86 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists() bool

Exists checks if configuration file exists

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the path to the config file

func PromptForCLIToolPath

func PromptForCLIToolPath() (string, error)

PromptForCLIToolPath prompts the user for the CLI tool path

Types

type Config

type Config struct {
	GitHub struct {
		Token string
		User  string
	}
	Anthropic struct {
		Token string
	}
	CLI struct {
		Command string
		Args    []string
		Timeout int // in seconds
	}
	Budgets struct {
		IssueResponse float64
		PRCreation    float64
		TestRun       float64
		Default       float64
	}
	Monitor struct {
		PollInterval       int      // in minutes
		RepoFilter         []string // optional list of repositories to filter on (empty means all)
		AssignedIssuesOnly bool     // whether to only show issues assigned to the user
		AutoRespond        bool     // whether to automatically respond to issues
	}
	Logging struct {
		Output     io.Writer
		Level      string
		JSONFormat bool
	}
	VCS struct {
		Platform string // "github", "gitlab", "gogs", etc.
	}
}

Config holds the application configuration

func Load

func Load() (*Config, error)

Load loads configuration from files, environment variables, etc.

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads the configuration from standard locations

func (*Config) SaveToFile

func (c *Config) SaveToFile(filePath string) error

SaveToFile saves the configuration to the specified file path

type Configurator

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

Configurator helps build and save configuration

func NewConfigurator

func NewConfigurator() *Configurator

NewConfigurator creates a new configurator

func (*Configurator) Save

func (c *Configurator) Save() error

Save saves the configuration to the user's home directory

func (*Configurator) SetAnthropicToken

func (c *Configurator) SetAnthropicToken(token string)

SetAnthropicToken sets the Anthropic token

func (*Configurator) SetCLIToolPath

func (c *Configurator) SetCLIToolPath(path string)

SetCLIToolPath sets the CLI tool path

func (*Configurator) SetGitHubToken

func (c *Configurator) SetGitHubToken(token string)

SetGitHubToken sets the GitHub token

func (*Configurator) SetGitHubUser

func (c *Configurator) SetGitHubUser(user string)

SetGitHubUser sets the GitHub user

func (*Configurator) SetMonitoringSettings

func (c *Configurator) SetMonitoringSettings(interval int, repoFilter []string, assignedOnly bool)

SetMonitoringSettings sets the issue monitoring settings

func (*Configurator) SetTaskBudgets

func (c *Configurator) SetTaskBudgets(budgets map[string]float64)

SetTaskBudgets sets the task budgets

Jump to

Keyboard shortcuts

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