Documentation
¶
Overview ¶
Package embedded provides proto files bundled into the Buffalo binary.
When Buffalo is installed via `go install`, the proto files for buffalo.validate are embedded into the binary and can be extracted to the user's project workspace at any time.
This solves the problem of proto files not being available after `go install`, since Go only installs the compiled binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ProtoFS embed.FS
ProtoFS contains all embedded proto files from the proto/ directory tree. The files are available at runtime and can be extracted to disk via ExtractValidateProto().
Functions ¶
func ExtractAllProtos ¶
ExtractAllProtos extracts every embedded proto file into workspaceDir and returns the root proto_path that should be passed to protoc.
Existing files are overwritten to ensure the version matches the binary.
func ExtractValidateProto ¶
ExtractValidateProto extracts the embedded buffalo/validate/validate.proto into the given workspace directory.
The file is placed at:
<workspaceDir>/proto/buffalo/validate/validate.proto
It returns the absolute path to the directory that should be added to protoc's --proto_path (i.e. <workspaceDir>/proto).
func ListEmbeddedProtos ¶
ListEmbeddedProtos returns a list of all embedded proto file paths.
func ValidateProtoImportPath ¶
ValidateProtoImportPath returns the proto_path that should be added to protoc / Buffalo import paths so that `import "buffalo/validate/validate.proto";` and `import "buffalo/permissions/permissions.proto";` resolve correctly. If any embedded files haven't been extracted yet, it re-extracts them all.
workspaceDir is typically ".buffalo".
Types ¶
This section is empty.