config

package
v0.1.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

DefaultPath returns ~/.bbcloud.yaml, or .bbcloud.yaml in the current directory if the home directory cannot be determined.

Types

type Config

type Config struct {
	Workspace string `yaml:"workspace"`
	Repo      string `yaml:"repo"`
	Username  string `yaml:"username"`
	Token     string `yaml:"token"`
}

Config holds all configurable values for bb.

func Load

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

Load reads the config file at path and overlays BITBUCKET_USER / BITBUCKET_TOKEN env vars. If the file does not exist, Load returns a zero-value Config (not an error).

func (*Config) Apply

func (cfg *Config) Apply(workspace, repo, username, token string)

Apply overlays non-empty flag values onto cfg (highest precedence).

func (*Config) Save

func (cfg *Config) Save(path string) error

Save writes cfg to path with 0600 permissions.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate returns an error if required fields are missing.

Jump to

Keyboard shortcuts

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