Documentation ¶
Index ¶
- Variables
- func CmdSetForeground(cmd *exec.Cmd)
- func ComputeDirHash(path string) (string, error)
- func ComputeFileHash(filePath string) (string, error)
- func ComputeHash(t interface{}) (string, error)
- func DecryptYaml(ctx context.Context, filename string) ([]byte, error)
- func FilterMap(data map[string]any, skipKeys []string) map[string]any
- func GetTerraformOutputs(ctx context.Context, path string) (cty.Value, error)
- func RenderGoTemplate(t string, data any) (string, error)
- func RunInteractive(ctx context.Context, catchOutputs bool, command string, cwd string, ...) (string, error)
- func RunSops(ctx context.Context, cwd string, args ...string) ([]byte, error)
- func RunTerraform(ctx context.Context, cwd string, catchOutputs bool, args ...string) (string, error)
- func StopProcess(cmd *exec.Cmd) error
- func TrimIndent(data string) string
- type LogTransport
- type OnceMap
Constants ¶
This section is empty.
Variables ¶
View Source
var DebugTransport = &LogTransport{ transport: http.DefaultTransport, }
Functions ¶
func CmdSetForeground ¶
func ComputeDirHash ¶
func ComputeFileHash ¶
func ComputeHash ¶
func DecryptYaml ¶
decryptYaml takes a filename and returns the decrypted yaml. This command directly calls the sops binary instead of using the go.mozilla.org/sops/v3/decrypt package since that adds numerous dependencies and adds ~19mb to the generated binary
func GetTerraformOutputs ¶
func RunInteractive ¶
func RunTerraform ¶
func RunTerraform(ctx context.Context, cwd string, catchOutputs bool, args ...string) (string, error)
RunTerraform will execute a terraform command with the given arguments in the given directory.
func StopProcess ¶
func TrimIndent ¶
Types ¶
type LogTransport ¶
type LogTransport struct {
// contains filtered or unexported fields
}
type OnceMap ¶
type OnceMap[K comparable] map[K]*sync.Once
OnceMap allows for creating a map of sync.Once elements. This allows for running multiple different processes only once.
A use case is for example a list of downloads, where we only want to run every unique download only once.
var downloadFiles = utils.OnceMap{}
for _, file := files { downloadFiles.Get(file).Do(func() { downloadFile(ctx, file) }) }
Click to show internal directories.
Click to hide internal directories.