buf: github.com/bufbuild/buf/internal/buf/bufwire Index | Files

package bufwire

import "github.com/bufbuild/buf/internal/buf/bufwire"

Package bufwire wires everything together.

TODO: This package should be split up into individual functionality.

Index

Package Files

bufwire.go env.go env_reader.go file_lister.go image_reader.go image_writer.go

type Env Uses

type Env interface {
    Image() bufimage.Image
    Config() *bufconfig.Config
}

Env is an environment.

type EnvReader Uses

type EnvReader interface {
    // GetEnv gets an environment for the fetch value.
    //
    // If externalFilePaths is empty, this builds all files under Buf control.
    GetEnv(
        ctx context.Context,
        container app.EnvStdinContainer,
        ref buffetch.Ref,
        configOverride string,
        externalFilePaths []string,
        externalFileFilePathsAllowNotExist bool,
        excludeSourceCodeInfo bool,
    ) (Env, []bufanalysis.FileAnnotation, error)
    // GetSourceOrModuleEnv is the same as GetEnv, but only allows source or module values, and always builds.
    GetSourceOrModuleEnv(
        ctx context.Context,
        container app.EnvStdinContainer,
        sourceOrModuleRef buffetch.SourceOrModuleRef,
        configOverride string,
        externalFilePaths []string,
        externalFileFilePathsAllowNotExist bool,
        excludeSourceCodeInfo bool,
    ) (Env, []bufanalysis.FileAnnotation, error)
}

EnvReader is an environment reader.

func NewEnvReader Uses

func NewEnvReader(
    logger *zap.Logger,
    fetchReader buffetch.Reader,
    configProvider bufconfig.Provider,
    moduleBucketBuilder bufmodulebuild.ModuleBucketBuilder,
    moduleFileSetBuilder bufmodulebuild.ModuleFileSetBuilder,
    imageBuilder bufimagebuild.Builder,
) EnvReader

NewEnvReader returns a new EnvReader.

type FileLister Uses

type FileLister interface {
    // ListFiles lists the files.
    ListFiles(
        ctx context.Context,
        container app.EnvStdinContainer,
        ref buffetch.Ref,
        configOverride string,
    ) ([]bufcore.FileInfo, error)
}

FileLister lists files.

func NewFileLister Uses

func NewFileLister(
    logger *zap.Logger,
    fetchReader buffetch.Reader,
    configProvider bufconfig.Provider,
    moduleBucketBuilder bufmodulebuild.ModuleBucketBuilder,
    imageBuilder bufimagebuild.Builder,
) FileLister

NewFileLister returns a new FileLister.

type ImageReader Uses

type ImageReader interface {
    // GetImage reads the image from the value.
    GetImage(
        ctx context.Context,
        container app.EnvStdinContainer,
        imageRef buffetch.ImageRef,
        externalFilePaths []string,
        externalFileFilePathsAllowNotExist bool,
        excludeSourceCodeInfo bool,
    ) (bufimage.Image, error)
}

ImageReader is an image reader.

func NewImageReader Uses

func NewImageReader(
    logger *zap.Logger,
    fetchReader buffetch.ImageReader,
) ImageReader

NewImageReader returns a new ImageReader.

type ImageWriter Uses

type ImageWriter interface {
    // PutImage writes the image to the value.
    //
    // The file must be an image format.
    // This is a no-np if value is the equivalent of /dev/null.
    PutImage(
        ctx context.Context,
        container app.EnvStdoutContainer,
        imageRef buffetch.ImageRef,
        image bufimage.Image,
        asFileDescriptorSet bool,
        excludeImports bool,
    ) error
}

ImageWriter is an image writer.

func NewImageWriter Uses

func NewImageWriter(
    logger *zap.Logger,
    fetchWriter buffetch.Writer,
) ImageWriter

NewImageWriter returns a new ImageWriter.

Package bufwire imports 19 packages (graph). Updated 2020-10-20. Refresh now. Tools for package owners.