cfgs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatGpt

type ChatGpt struct {
	EndPoint    Expander `yaml:"EndPoint" json:"end_point,omitempty"`
	APIKey      Expander `yaml:"APIKey" json:"api_key,omitempty"`
	AccessToken Expander `yaml:"AccessToken" json:"access_token,omitempty"`
	Model       Expander `yaml:"Model" json:"model,omitempty"`
	Proxy       Expander `yaml:"Proxy" json:"proxy,omitempty"`
}

type Config

type Config struct {
	DebugMode    bool          `yaml:"DebugMode" json:"debug_mode,omitempty"`
	LogPath      Expander      `yaml:"LogPath" json:"log_path,omitempty"`
	ChatGpt      *ChatGpt      `yaml:"ChatGpt" json:"chat_gpt,omitempty"`
	SummaryRules *SummaryRules `yaml:"SummaryRules" json:"summary_rules,omitempty"`
	Prompt       *Prompt       `yaml:"Prompt" json:"prompt,omitempty"`
}

func DefaultConfig

func DefaultConfig() *Config

func LoadConfig

func LoadConfig(fname string) (*Config, error)

func ReadConfig

func ReadConfig(r io.Reader) (*Config, error)

func (*Config) MergeDefault

func (cfg *Config) MergeDefault() error

func (*Config) SaveConfig

func (cfg *Config) SaveConfig(fname string) error

func (*Config) WriteConfig

func (cfg *Config) WriteConfig(w io.Writer) error

type Expander

type Expander = strutil.Expander

type Prompt

type Prompt struct {
	System       Expander `yaml:"System" json:"system,omitempty"`
	CodeSummary  Expander `yaml:"CodeSummary" json:"code_summary,omitempty"`
	SummaryTable Expander `yaml:"SummaryTable" json:"summary_table,omitempty"`
	FinalSummary Expander `yaml:"FinalSummary" json:"final_summary,omitempty"`
}

type SummaryRules

type SummaryRules struct {
	Include     []string `yaml:"Include" json:"include,omitempty"`
	Exclude     []string `yaml:"Exclude" json:"exclude,omitempty"`
	OutDir      Expander `yaml:"OutDir" json:"out_dir,omitempty"`
	OutFileName Expander `yaml:"OutFileName" json:"out_file_name,omitempty"`
}

func (*SummaryRules) GetReportDir

func (rule *SummaryRules) GetReportDir() string

func (*SummaryRules) GetReportPath

func (rule *SummaryRules) GetReportPath(codeFolder string) string

Jump to

Keyboard shortcuts

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