projectconfig

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Overview

Package projectconfig loads .pbflags.yaml project configuration. The CLI discovers the file by walking up from the working directory, similar to buf.yaml or .goreleaser.yaml.

Index

Constants

View Source
const FileName = ".pbflags.yaml"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FeaturesPath    string `yaml:"features_path"`
	DescriptorsPath string `yaml:"descriptors_path"`
	ProtoPath       string `yaml:"proto_path"`
}

Config holds project-level pbflags configuration.

func Discover

func Discover(startDir string) (Config, string, error)

Discover walks up from startDir looking for .pbflags.yaml. Returns the parsed config and the directory it was found in. Returns a zero Config and empty dir if no file is found (not an error).

func (Config) DescriptorsFile added in v0.18.0

func (c Config) DescriptorsFile(projectRoot string) string

DescriptorsFile returns the absolute path to the descriptors file, resolved relative to the project root. Returns empty string if descriptors_path is not configured.

func (Config) FeaturesDir

func (c Config) FeaturesDir(projectRoot string) string

FeaturesDir returns the absolute path to the features directory, resolved relative to the project root. Returns empty string if features_path is not configured.

func (Config) ProtoDir added in v0.18.0

func (c Config) ProtoDir(projectRoot string) string

ProtoDir returns the absolute path to the proto directory, resolved relative to the project root. Returns empty string if proto_path is not configured.

Jump to

Keyboard shortcuts

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