cosmosbuf

package
v28.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInvalidCommand indicates an invalid command name.
	ErrInvalidCommand = errors.New("invalid command name")

	// ErrProtoFilesNotFound indicates that no ".proto" files were found.
	ErrProtoFilesNotFound = errors.New("no proto files found")
)

Functions

This section is empty.

Types

type Buf

type Buf struct {
	// contains filtered or unexported fields
}

Buf represents the buf application structure.

func New

func New() (Buf, error)

New creates a new Buf based on the installed binary.

func (Buf) Cleanup

func (b Buf) Cleanup() error

Cleanup deletes temporary files and directories.

func (Buf) Export

func (b Buf) Export(ctx context.Context, protoDir, output string) error

Export runs the buf Export command for the files in the proto directory.

func (Buf) Generate

func (b Buf) Generate(
	ctx context.Context,
	protoDir,
	output,
	template string,
	excludeFilename ...string,
) (err error)

Generate runs the buf Generate command for each file into the proto directory.

func (Buf) Update

func (b Buf) Update(ctx context.Context, modDir string, dependencies ...string) error

Update updates module dependencies. By default updates all dependencies unless one or more dependencies are specified.

type Command

type Command string

Command represents a high level command under buf.

const (

	// CMDGenerate generate command.
	CMDGenerate Command = "generate"
	CMDExport   Command = "export"
	CMDMod      Command = "mod"
)

func (Command) String

func (c Command) String() string

String returns the command name.

Jump to

Keyboard shortcuts

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