bufprotopluginos

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package bufprotopluginos does OS-specific generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cleaner added in v1.35.0

type Cleaner interface {
	DeleteOuts(ctx context.Context, pluginOuts []string) error
}

Cleaner deletes output locations prior to generation.

This must be done before any interaction with ResponseWriters, as multiple plugins may output to a single location.

func NewCleaner added in v1.35.0

func NewCleaner(storageosProvider storageos.Provider) Cleaner

NewCleaner returns a new Cleaner.

type ResponseWriter

type ResponseWriter interface {
	// Close writes all of the responses to disk. No further calls can be
	// made to the ResponseWriter after this call.
	io.Closer

	// AddResponse adds the response to the writer, switching on the file extension.
	// If there is a .jar extension, this generates a jar. If there is a .zip
	// extension, this generates a zip. If there is no extension, this outputs
	// to the directory.
	//
	// pluginOut will be unnormalized within this function.
	AddResponse(
		ctx context.Context,
		response *pluginpb.CodeGeneratorResponse,
		pluginOut string,
	) error
}

ResponseWriter writes CodeGeneratorResponses to the OS filesystem.

func NewResponseWriter

func NewResponseWriter(
	logger *zap.Logger,
	storageosProvider storageos.Provider,
	options ...ResponseWriterOption,
) ResponseWriter

NewResponseWriter returns a new ResponseWriter.

type ResponseWriterOption

type ResponseWriterOption func(*responseWriterOptions)

ResponseWriterOption is an option for the ResponseWriter.

func ResponseWriterWithCreateOutDirIfNotExists

func ResponseWriterWithCreateOutDirIfNotExists() ResponseWriterOption

ResponseWriterWithCreateOutDirIfNotExists returns a new ResponseWriterOption that creates the directory if it does not exist.

Jump to

Keyboard shortcuts

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