files

package
v0.0.0-...-ae6075c Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package files provides config files and customizations for buf.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAModule = errors.New("not a go module")
)

Functions

func ModuleRoot

func ModuleRoot() (string, error)

func WriteBufGenYaml

func WriteBufGenYaml(path string, config *BufGenYaml) error

func WriteBufWorkYaml

func WriteBufWorkYaml(path string, dirs ...string) error

func WriteBufYaml

func WriteBufYaml(path string) error

Types

type BreakingRuleSet

type BreakingRuleSet struct {
	RulesUsed []string `yaml:"use"`
}

type BufGenYaml

type BufGenYaml struct {
	Version   string
	Managed   ManagedRules
	Plugins   []GenerationPlugin
	UseGoGrpc bool
	UseGoJson bool
	GoOut     string
}

func (*BufGenYaml) BoolManagedValue

func (r *BufGenYaml) BoolManagedValue(key string) (bool, bool)

func (*BufGenYaml) DefaultGoPrefix

func (r *BufGenYaml) DefaultGoPrefix() string

func (*BufGenYaml) HasPlugins

func (r *BufGenYaml) HasPlugins() bool

func (*BufGenYaml) IsManaged

func (r *BufGenYaml) IsManaged() bool

func (*BufGenYaml) SetDefaultGoPrefix

func (r *BufGenYaml) SetDefaultGoPrefix(outputDir string) error

func (*BufGenYaml) StringManagedValue

func (r *BufGenYaml) StringManagedValue(key string) (string, bool)

type BufWorkYaml

type BufWorkYaml struct {
	Version     string   `yaml:"version"`
	Directories []string `yaml:"directories"`
}

type BufYaml

type BufYaml struct {
	Version       string          `yaml:"version"`
	LintRules     LintRuleSet     `yaml:"lint"`
	BreakingRules BreakingRuleSet `yaml:"breaking"`
}

type GenerationPlugin

type GenerationPlugin struct {
	Name       string   `yaml:"name"`
	OutputPath string   `yaml:"out"`
	Options    []string `yaml:"opt,omitempty"`
}

func (*GenerationPlugin) OptionString

func (p *GenerationPlugin) OptionString() string

type LintRuleSet

type LintRuleSet struct {
	RulesUsed     []string `yaml:"use"`
	RulesExcluded []string `yaml:"except"`
	IgnoredPaths  []string `yaml:"ignore"`
}

type ManagedRules

type ManagedRules = map[string]interface{}

Jump to

Keyboard shortcuts

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