Back to godoc.org

Package bufconfig

v0.20.5
Latest Go to latest

The latest major version is .

Published: Jul 24, 2020 | License: Apache-2.0 | Module: github.com/bufbuild/buf

Overview

Package bufconfig contains the configuration functionality.

Index

Constants

const ConfigFilePath = "buf.yaml"

ConfigFilePath is the default config file path within a bucket.

TODO: make sure copied for git

type Config

type Config struct {
	Build    *bufmod.Config
	Breaking *bufbreaking.Config
	Lint     *buflint.Config
}

Config is the user config.

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(ctx context.Context, 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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier