appprotoos

package
v0.0.0-...-26f4575 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package appprotoos does OS-specific generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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