buf

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFromPath

func GenerateFromPath(ctx context.Context, apiPath string) error

GenerateFromPath 从指定路径生成 Protobuf 代码。

func RunBufDepUpdate

func RunBufDepUpdate(ctx context.Context, apiPath string) error

RunBufDepUpdate 在指定目录执行 `buf dep update`,并将输出转发到标准输出/错误。

func RunBufGenerate

func RunBufGenerate(ctx context.Context, apiPath, template string) error

RunBufGenerate 在指定目录执行 `buf generate --template <template>`。 如果 template 为空,使用常量 `defaultBufGenConfigFile`。 在执行前会调用 ensureBufInstalled 确保 buf 可用,命令输出会直接写入标准输出/错误。

func RunGenerate

func RunGenerate(cmd *cobra.Command, args []string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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