config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath added in v0.5.0

func DefaultPath() (string, error)

DefaultPath returns the default config file path: ~/.config/ccpr/config.yaml.

func Write added in v0.5.0

func Write(path string, cfg *Config) error

Write generates a config file with comments and writes it to the given path. It creates parent directories as needed.

Types

type Config

type Config struct {
	Profile      string            `yaml:"profile"`
	Region       string            `yaml:"region"`
	RepoMappings map[string]string `yaml:"repoMappings"`
}

Config holds application configuration loaded from file.

func Load

func Load(path string) (*Config, string, error)

Load searches for a configuration file and returns the parsed Config along with the resolved file path. Search order:

  1. explicit path (if non-empty)
  2. .ccpr.yaml in current directory
  3. ~/.config/ccpr/config.yaml

func (*Config) ResolveProfile

func (c *Config) ResolveProfile(flagProfile string) string

ResolveProfile returns the AWS profile to use. Priority: flagProfile > config file > AWS_PROFILE env > "default".

func (*Config) ResolveRegion added in v0.2.1

func (c *Config) ResolveRegion(flagRegion string) string

ResolveRegion returns the AWS region to use. Priority: flagRegion > config file > "".

func (*Config) ResolveRepoPath

func (c *Config) ResolveRepoPath(repoName string) (string, error)

ResolveRepoPath returns the local filesystem path for a CodeCommit repository name. Returns an error if no mapping is configured for the given name.

Jump to

Keyboard shortcuts

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