buffetch

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ImageFormatsString is the string representation of all image formats.
	//
	// This does not include deprecated formats.
	ImageFormatsString = formatsToString(imageFormatsNotDeprecated)
	// SourceFormatsString is the string representation of all source formats.
	//
	// This does not include deprecated formats.
	SourceFormatsString = formatsToString(sourceFormatsNotDeprecated)
	// AllFormatsString is the string representation of all formats.
	//
	// This does not include deprecated formats.
	AllFormatsString = formatsToString(allFormatsNotDeprecated)
)

Functions

This section is empty.

Types

type ImageEncoding

type ImageEncoding int

ImageEncoding is the encoding of the image.

const (
	// ImageEncodingBin is the binary image encoding.
	ImageEncodingBin ImageEncoding = iota + 1
	// ImageEncodingJSON is the JSON image encoding.
	ImageEncodingJSON
)

type ImageRef

type ImageRef interface {
	Ref
	ImageEncoding() ImageEncoding
	IsNull() bool
	// contains filtered or unexported methods
}

ImageRef is an image file reference.

type Reader

type Reader interface {
	// GetImageFile gets the image file.
	//
	// The returned file will be uncompressed.
	GetImageFile(
		ctx context.Context,
		container app.EnvStdinContainer,
		imageRef ImageRef,
	) (io.ReadCloser, error)
	// GetSource gets the source bucket.
	//
	// The returned bucket will only have .proto and configuration files.
	GetSourceBucket(
		ctx context.Context,
		container app.EnvStdinContainer,
		sourceRef SourceRef,
	) (storage.ReadBucketCloser, error)
}

Reader is a reader for Buf.

func NewReader

func NewReader(
	logger *zap.Logger,
	httpClient *http.Client,
	httpAuthenticator httpauth.Authenticator,
	gitCloner git.Cloner,
) Reader

NewReader returns a new Reader.

type Ref

type Ref interface {
	PathResolver() bufpath.PathResolver
	// contains filtered or unexported methods
}

Ref is an image file or source bucket reference.

type RefParser

type RefParser interface {
	// GetRef gets the reference for the image file or source bucket.
	GetRef(
		ctx context.Context,
		value string,
	) (Ref, error)
	// GetImageRef gets the reference for the image file.
	GetImageRef(
		ctx context.Context,
		value string,
	) (ImageRef, error)
	// GetSourceRef gets the reference for the source bucket.
	GetSourceRef(
		ctx context.Context,
		value string,
	) (SourceRef, error)
}

RefParser is an ref parser for Buf.

func NewRefParser

func NewRefParser(
	logger *zap.Logger,
) RefParser

NewRefParser returns a new RefParser.

type SourceRef

type SourceRef interface {
	Ref
	// contains filtered or unexported methods
}

SourceRef is a source bucket reference.

type Writer

type Writer interface {
	// PutImageFile puts the image file.
	PutImageFile(
		ctx context.Context,
		container app.EnvStdoutContainer,
		imageRef ImageRef,
	) (io.WriteCloser, error)
}

Writer is a writer for Buf.

func NewWriter

func NewWriter(
	logger *zap.Logger,
) Writer

NewWriter returns a new Writer.

Jump to

Keyboard shortcuts

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