Documentation ¶
Overview ¶
Package bufconfig contains the configuration functionality.
Index ¶
Constants ¶
View Source
const ConfigFilePath = "buf.yaml"
ConfigFilePath is the default config file path within a bucket.
TODO: make sure copied for git
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExternalConfig ¶
type ExternalConfig struct { Build bufmod.ExternalConfig `json:"build,omitempty" yaml:"build,omitempty"` Breaking bufbreaking.ExternalConfig `json:"breaking,omitempty" yaml:"breaking,omitempty"` Lint buflint.ExternalConfig `json:"lint,omitempty" yaml:"lint,omitempty"` }
ExternalConfig is an external config.
type Provider ¶
type Provider interface { // GetConfig gets the Config for the given JSON or YAML data. // // If the data is of length 0, returns the default config. GetConfig(ctx context.Context, readBucket storage.ReadBucket) (*Config, error) // GetConfig gets the Config for the given JSON or YAML data. // // If the data is of length 0, returns the default config. GetConfigForData(data []byte) (*Config, error) }
Provider is a provider.
func NewProvider ¶
func NewProvider(logger *zap.Logger, options ...ProviderOption) Provider
NewProvider returns a new Provider.
type ProviderOption ¶
type ProviderOption func(*provider)
ProviderOption is an option for a new Provider.
func ProviderWithExternalConfigModifier ¶
func ProviderWithExternalConfigModifier(externalConfigModifier func(*ExternalConfig) error) ProviderOption
ProviderWithExternalConfigModifier returns a new ProviderOption that applies the following external config modifier before processing an ExternalConfig.
Useful for testing.
Click to show internal directories.
Click to hide internal directories.