Documentation
¶
Index ¶
- Variables
- func Version(ctx context.Context) (string, error)
- type Buf
- func (b Buf) Export(ctx context.Context, protoDir, output string) error
- func (b Buf) Format(ctx context.Context, path string) error
- func (b Buf) Generate(ctx context.Context, protoPath, output, template string, options ...GenOption) (err error)
- func (b Buf) Migrate(ctx context.Context, protoDir string) error
- func (b Buf) Update(ctx context.Context, modDir string) error
- type Command
- type GenOption
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 ¶
Types ¶
type Buf ¶
type Buf struct {
// contains filtered or unexported fields
}
Buf represents the buf application structure.
func (Buf) Generate ¶
func (b Buf) Generate( ctx context.Context, protoPath, output, template string, options ...GenOption, ) (err error)
Generate runs the buf Generate command for each file into the proto directory.
type GenOption ¶
type GenOption func(*genOptions)
GenOption configures code generation.
func ExcludeFiles ¶
ExcludeFiles exclude file names from the generate command using glob.
func FileByFile ¶
func FileByFile() GenOption
FileByFile runs the generate command for each proto file.
func IncludeImports ¶
func IncludeImports() GenOption
IncludeImports also generate all imports except for Well-Known Types.
func IncludeWKT ¶
func IncludeWKT() GenOption
IncludeWKT also generate Well-Known Types. Cannot be set without IncludeImports.
func WithModuleName ¶ added in v29.1.0
WithModuleName sets the module name to filter protos for.
Click to show internal directories.
Click to hide internal directories.