Documentation ¶
Index ¶
- func ArgsFromAny(in []any) []string
- func BinGolangCILint() *bintool.BinTool
- func BinGovulncheck() *bintool.BinTool
- func BinProtoc() *bintool.BinTool
- func BinProtocGenGo() *bintool.BinTool
- func BinProtocGenGoGRPC() *bintool.BinTool
- func BinProtocGenGoTwirp() *bintool.BinTool
- func DownloadToCache(src string) (string, error)
- func ExtractArchive(src, dest string) error
- func FileAppendLine(filename string, fileperm os.FileMode, line string) error
- func FileExists(path string) bool
- func FileLastRune(filename string) (rune, error)
- func FileLineExists(filename, targetLine string) bool
- func FileNameModify(target string, fn func(string) []string) []string
- func FileNameModifyReplace(from string, to ...string) func(string) []string
- func FilesMatch(baseDir, pattern string) []string
- func FilterCoverageOutput(filename string) error
- func GetEnv(key, fallback string) string
- func GetModuleName() (string, error)
- func GetProtobufVersion() string
- func GetProtocVersion() string
- func GitHash() string
- func GitHeadRev() string
- func GitHeadTag() string
- func GitHeadTagDescribe() string
- func GitSemver() string
- func GitSemverRaw() string
- func GitSlug() string
- func GitURL() string
- func GolangVersion() string
- func GolangVersionRaw() string
- func HTTPGetLatestGitHubVersion(slug string) (string, error)
- func HTTPWriteFile(rawURL, filename string, fileperm os.FileMode) error
- func LDFlags(debug bool) []string
- func MustCommandPaths() []string
- func MustGetGoBin() string
- func MustGetHomeDir(path ...string) string
- func MustGetOutput(cmd string) string
- func MustGetProtobufPath() string
- func MustGetVSCodePath(path ...string) string
- func MustGetWD(path ...string) string
- func MustMakeDir(path string, fileperm os.FileMode)
- func MustModuleName() string
- func PanicIfError(err error, prependStr string)
- func PrintDebug(format string, v ...any)
- func PrintInfo(format string, v ...any)
- func PrintWarning(format string, v ...any)
- func ProtobufIncludePaths() []string
- func SanitizeArchivePath(dest, target string) (string, error)
- func SemverBumpPatch(v string) string
- func SetEnv(key, value string) func()
- func TargetNeedRefresh(target string, src ...string) bool
- func Unzip(src, dest string) error
- type BuildPlatform
- type CommandEnv
- type CommandTemplate
- type DockerConfig
- type Module
- type ModuleError
- type ProtobufTargetFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgsFromAny ¶ added in v0.1.4
func BinGolangCILint ¶ added in v0.1.3
func BinGovulncheck ¶ added in v0.1.3
func BinProtocGenGo ¶ added in v0.1.3
func BinProtocGenGoGRPC ¶ added in v0.1.3
func BinProtocGenGoTwirp ¶ added in v0.1.3
func DownloadToCache ¶
func ExtractArchive ¶
func FileExists ¶
func FileLastRune ¶
func FileLineExists ¶
func FileNameModifyReplace ¶
func FilesMatch ¶
func FilterCoverageOutput ¶
FilterCoverageOutput filters the coverage output by removing any lines that contain generated protobuf files `.pg.go`.
func GetModuleName ¶
func GetProtobufVersion ¶
func GetProtobufVersion() string
func GetProtocVersion ¶ added in v0.1.3
func GetProtocVersion() string
func GitHeadRev ¶
func GitHeadRev() string
func GitHeadTag ¶
func GitHeadTag() string
func GitHeadTagDescribe ¶ added in v0.1.4
func GitHeadTagDescribe() string
func GitSemverRaw ¶ added in v0.1.4
func GitSemverRaw() string
func GolangVersion ¶ added in v0.1.5
func GolangVersion() string
func GolangVersionRaw ¶ added in v0.1.5
func GolangVersionRaw() string
func MustCommandPaths ¶
func MustCommandPaths() []string
func MustGetGoBin ¶
func MustGetGoBin() string
MustGetGoBin get GOBIN.
if GOBIN is not set then attempt to derive its value using GOPATH.
if GOPATH is not set, use (pwd)/artifacts/bin .
func MustGetHomeDir ¶
MustGetHomeDir get user home directory or panic if unable to.
func MustGetOutput ¶
func MustGetProtobufPath ¶
func MustGetProtobufPath() string
func MustGetVSCodePath ¶ added in v0.1.4
MustGetVSCodePath get generated .vscode directory.
if the directory does not exist then it will be created.
if the directory cannot be created then panic.
func MustMakeDir ¶
MustMakeDir make directory, including parents if required.
if unable to make directory then panic.
func MustModuleName ¶ added in v0.1.1
func MustModuleName() string
func PanicIfError ¶
PanicIfError panics if passed error is not nil.
prependStr is optional string to prepend to panic error.
func PrintDebug ¶
PrintDebug prints the passed debug message to stdout in white text with blue chevron.
func PrintInfo ¶
PrintInfo prints the passed info message to stdout in white text with green chevron.
func PrintWarning ¶
PrintWarn prints the passed warning message to stdout in white text with yellow chevron.
func ProtobufIncludePaths ¶
func ProtobufIncludePaths() []string
func SanitizeArchivePath ¶
Sanitize archive file pathing from "G305: Zip Slip vulnerability".
func SemverBumpPatch ¶ added in v0.1.4
func TargetNeedRefresh ¶
Types ¶
type BuildPlatform ¶ added in v0.1.4
type CommandEnv ¶
type CommandEnv struct {
// contains filtered or unexported fields
}
func (*CommandEnv) Revert ¶
func (e *CommandEnv) Revert()
type CommandTemplate ¶
type CommandTemplate struct { Debug bool CGO string GoOS string GoArch string GoArm string GitRev string GitHash string GitHeadTag string GitSlug string LDFlags string CWD string OutputArtifact string TargetPath string CommandDir string CommandName string HomeDir string }
func NewCommandTemplate ¶
func NewCommandTemplate(debug bool, commandDir string) *CommandTemplate
type DockerConfig ¶ added in v0.1.4
type DockerConfig struct { Image string `yaml:"image,omitempty"` Platforms []string `yaml:"platforms,omitempty"` Tag interface{} `yaml:"tag,omitempty"` BlockedTags []string `yaml:"blocked_tags,omitempty"` BuildArgs map[string]string `yaml:"build_args,omitempty"` }
func DockerLoadConfig ¶ added in v0.1.4
func DockerLoadConfig() (*DockerConfig, error)
func MustDockerLoadConfig ¶ added in v0.1.4
func MustDockerLoadConfig() *DockerConfig
func (DockerConfig) Args ¶ added in v0.1.4
func (d DockerConfig) Args() []string
func (DockerConfig) ArgsTag ¶ added in v0.1.4
func (d DockerConfig) ArgsTag(tag string) (string, error)
func (DockerConfig) GetImage ¶ added in v0.1.5
func (d DockerConfig) GetImage() string
func (DockerConfig) GetTags ¶ added in v0.1.4
func (d DockerConfig) GetTags() []string
func (DockerConfig) IsBlocked ¶ added in v0.1.4
func (d DockerConfig) IsBlocked(in string) bool
func (DockerConfig) OSArch ¶ added in v0.1.4
func (d DockerConfig) OSArch() []BuildPlatform
type Module ¶
type Module struct { Path string `json:"Path"` // module path Query string `json:"Query"` // version query corresponding to this version Version string `json:"Version"` // module version Versions []string `json:"Versions"` // available module versions Replace *Module `json:"Replace"` // replaced by this module Time *time.Time `json:"Time"` // time version was created Update *Module `json:"Update"` // available update (with -u) Main bool `json:"Main"` // is this the main module? Indirect bool `json:"Indirect"` // module is only indirectly needed by main module Dir string `json:"Dir"` // directory holding local copy of files, if any GoMod string `json:"GoMod"` // path to go.mod file describing module, if any GoVersion string `json:"GoVersion"` // go version used in module Retracted []string `json:"Retracted"` // retraction information, if any (with -retracted or -u) Deprecated string `json:"Deprecated"` // deprecation message, if any (with -u) Error *ModuleError `json:"Error"` // error loading module Origin any `json:"Origin"` // provenance of module Reuse bool `json:"Reuse"` // reuse of old module info is safe }
func GolangListModules ¶
type ModuleError ¶
type ModuleError struct {
Err string `json:"Err"` // the error itself
}
type ProtobufTargetFunc ¶ added in v0.1.2
type ProtobufTargetFunc func() []string
func ProtobufTargets ¶
func ProtobufTargets() []ProtobufTargetFunc