Documentation ¶
Index ¶
- Constants
- Variables
- func AppendFileName(dir string, fileName string) string
- func CheckModDepWithPin(mod string) (err error)
- func Marshal(path string, in interface{}) (err error)
- func ReadFile(path string) (b []byte, err error)
- func Unmarshal(expectedName, path string, out interface{}, unsafe bool) (err error)
- type BreakingPolicy
- type DepMetadata
- type GenConfig
- type GoPackageMetadata
- type LintPolicy
- type LockConfig
- type ManagedOptimizeType
- type ManagedPolicy
- type ModConfig
- type PluginPolicy
- type WorkspaceConfig
Constants ¶
View Source
const (
GenFileName = "buf.gen.yaml"
)
View Source
const (
LockFileName = "buf.lock"
)
View Source
const (
ModFileName = "buf.yaml"
)
View Source
const (
WorkspaceFileName = "buf.work.yaml"
)
Variables ¶
View Source
var ( DefaultGenVersion = "v1" DefaultPlugins = []*PluginPolicy{ { Remote: "buf.build/library/plugins/go:v1.27.1-1", Out: "gen/go", Opt: []string{"paths=source_relative"}, }, { Remote: "buf.build/library/plugins/go-grpc:v1.1.0-2", Out: "gen/go", Opt: []string{"paths=source_relative", "require_unimplemented_servers=false"}, }, } )
View Source
var ( DefaultLockVersion = "v1" DefaultLockCachePath = "/module/data" DefaultHomeCachePath = "/.cache/buf" )
View Source
var ( DefaultModVersion = "v1" DefaultLintPolicy = &LintPolicy{ Use: []string{"DEFAULT"}, } DefaultBreakingPolicy = &BreakingPolicy{ Use: []string{"FILE"}, } )
View Source
var (
DefaultWorkspaceVersion = "v1"
)
Functions ¶
func AppendFileName ¶
func CheckModDepWithPin ¶
Types ¶
type BreakingPolicy ¶
type BreakingPolicy struct { Use []string `yaml:"use,omitempty"` Except []string `yaml:"except,omitempty"` Ignore []string `yaml:"ignore,omitempty"` }
func ParseModBreakingPolicy ¶
func ParseModBreakingPolicy(path string) (breaking *BreakingPolicy, err error)
type DepMetadata ¶
type DepMetadata struct { Remote string `yaml:"remote" yaml:"remote"` Owner string `yaml:"owner" yaml:"owner"` Repository string `yaml:"repository" yaml:"repository"` Branch string `yaml:"branch" yaml:"branch"` Commit string `yaml:"commit" yaml:"commit"` Digest string `yaml:"digest" yaml:"digest"` CreateTime time.Time `yaml:"create_time" yaml:"create_time"` }
func (*DepMetadata) IsValid ¶
func (m *DepMetadata) IsValid() bool
func (*DepMetadata) Resolve ¶
func (m *DepMetadata) Resolve(str string)
type GenConfig ¶
type GenConfig struct { Version string `yaml:"version"` Plugins []*PluginPolicy `yaml:"plugins,omitempty"` Managed *ManagedPolicy `yaml:"managed,omitempty"` }
func (*GenConfig) UnsafeParse ¶
type GoPackageMetadata ¶
type LintPolicy ¶
type LintPolicy struct { Use []string `yaml:"use,omitempty"` Except []string `yaml:"except,omitempty"` Ignore []string `yaml:"ignore,omitempty"` AllowCommentIgnores bool `yaml:"allow_comment_ignores,omitempty"` EnumZeroValueSuffix string `yaml:"enum_zero_value_suffix,omitempty"` ServiceSuffix string `yaml:"service_suffix,omitempty"` }
func ParseModLintPolicy ¶
func ParseModLintPolicy(path string) (lint *LintPolicy, err error)
type LockConfig ¶
type LockConfig struct { Version string `yaml:"version"` Deps []*DepMetadata `yaml:"deps"` }
func (*LockConfig) Generate ¶
func (cfg *LockConfig) Generate(dir string) (err error)
func (*LockConfig) Link ¶
func (cfg *LockConfig) Link(target string, dirs ...string) (err error)
Link looks up the buf module cache with specified commit hash, then it creates symbolic link to the target The built-in cache directories will be looked up in order by following https://docs.buf.build/bsr/overview#module-cache
func (*LockConfig) Parse ¶
func (cfg *LockConfig) Parse(path string) (err error)
func (*LockConfig) UnsafeParse ¶
func (cfg *LockConfig) UnsafeParse(path string) (err error)
type ManagedOptimizeType ¶
type ManagedOptimizeType string
const ( OptimizeSpeed ManagedOptimizeType = "SPEED" OptimizeCodeSize ManagedOptimizeType = "CODE_SIZE" OptimizeLiteRuntime ManagedOptimizeType = "LITE_RUNTIME" )
type ManagedPolicy ¶
type ManagedPolicy struct { Enabled bool `yaml:"enabled"` CCEnabledArenas bool `yaml:"cc_enabled_arenas"` JavaMultipleFiles bool `yaml:"java_multiple_files"` JavaPackagePrefix string `yaml:"java_package_prefix"` JavaStringCheckUtf8 bool `yaml:"java_string_check_utf_8"` OptimizeFor ManagedOptimizeType `yaml:"optimize_for"` GoPackagePrefix *GoPackageMetadata `yaml:"go_package_prefix,omitempty"` }
func ParseGenManagedPolicy ¶
func ParseGenManagedPolicy(path string) (managed *ManagedPolicy, err error)
type ModConfig ¶
type ModConfig struct { Version string `yaml:"version"` Name string `yaml:"name,omitempty"` Deps []string `yaml:"deps,omitempty"` Lint *LintPolicy `yaml:"lint"` Breaking *BreakingPolicy `yaml:"breaking"` }
func (*ModConfig) UnsafeParse ¶
type PluginPolicy ¶
type PluginPolicy struct { Name string `yaml:"name,omitempty"` Remote string `yaml:"remote,omitempty"` Out string `yaml:"out,omitempty"` Path string `yaml:"path,omitempty"` Strategy string `yaml:"strategy,omitempty"` Opt []string `yaml:"opt,omitempty"` }
func ParseGenPluginsPolicy ¶
func ParseGenPluginsPolicy(path string) (plugins []*PluginPolicy, err error)
type WorkspaceConfig ¶
type WorkspaceConfig struct { Version string `yaml:"version"` Directories []string `yaml:"directories"` }
func (*WorkspaceConfig) Generate ¶
func (cfg *WorkspaceConfig) Generate(dir string) (err error)
func (*WorkspaceConfig) Parse ¶
func (cfg *WorkspaceConfig) Parse(path string) (err error)
func (*WorkspaceConfig) UnsafeParse ¶
func (cfg *WorkspaceConfig) UnsafeParse(path string) (err error)
Click to show internal directories.
Click to hide internal directories.