bufpolicyconfig

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PutBufPolicyYAMLFile

func PutBufPolicyYAMLFile(
	ctx context.Context,
	bucket storage.WriteBucket,
	path string,
	bufYAMLFile BufPolicyYAMLFile,
) error

PutBufPolicyYAMLFile puts the PolicyYAMLFile at the given bucket path.

The PolicyYAMLFile file will be attempted to be written to filePath. The PolicyYAMLFile file will be written atomically.

func WriteBufPolicyYAMLFile

func WriteBufPolicyYAMLFile(writer io.Writer, bufPolicyYAMLFile BufPolicyYAMLFile) error

WriteBufPolicyYAMLFile writes the BufPolicyYAMLFile to the io.Writer.

Types

type BufPolicyYAMLFile

type BufPolicyYAMLFile interface {
	File

	// Name returns the name for the File.
	Name() string
	// LintConfig returns the LintConfig for the File.
	LintConfig() bufconfig.LintConfig
	// BreakingConfig returns the BreakingConfig for the File.
	BreakingConfig() bufconfig.BreakingConfig
	// PluginConfigs returns the PluginConfigs for the File.
	PluginConfigs() []bufconfig.PluginConfig
	// contains filtered or unexported methods
}

BufPolicyYAMLFile represents a Policy config file.

func GetBufPolicyYAMLFile

func GetBufPolicyYAMLFile(
	ctx context.Context,
	bucket storage.ReadBucket,
	path string,
) (BufPolicyYAMLFile, error)

GetBufPolicyYAMLFile gets the PolicyYAMLFile at the given bucket path.

func NewBufPolicyYAMLFile

func NewBufPolicyYAMLFile(
	name string,
	lintConfig bufconfig.LintConfig,
	breakingConfig bufconfig.BreakingConfig,
	pluginConfigs []bufconfig.PluginConfig,
) (BufPolicyYAMLFile, error)

NewBufPolicyYAMLFile returns a new validated BufPolicyYAMLFile.

func ReadBufPolicyYAMLFile

func ReadBufPolicyYAMLFile(reader io.Reader, fileName string) (BufPolicyYAMLFile, error)

ReadBufPolicyYAMLFile reads the BufPolicyYAMLFile from the io.Reader.

type File

type File interface {
	// FileVersion returns the file version.
	FileVersion() bufconfig.FileVersion
	// ObjectData returns the underlying ObjectData.
	//
	// This is non-nil on Files if they were created from storage.ReadBuckets. It is nil
	// if the File was created via a New constructor or Read method.
	//
	// This ObjectData is used for digest calculations.
	ObjectData() bufconfig.ObjectData
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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