util

package
v0.0.0-...-c010844 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: AGPL-3.0 Imports: 23 Imported by: 1

Documentation

Overview

Copyright © 2024 Bopmatic, LLC. All Rights Reserved. * * See LICENSE file at the root of this package for license terms

Index

Constants

View Source
const (
	BopmaticImageRepo      = "bopmatic/build"
	BopmaticImageTag       = "latest"
	BopmaticBuildImageName = BopmaticImageRepo + ":" + BopmaticImageTag

	DockerInstallErrMsg = "Could not invoke docker; please double check that you have docker installed: %w"
)

Variables

View Source
var ErrImageNotFound = errors.New("image does not exist")

Functions

func CopyDir

func CopyDir(src string, dst string) error

func CopyFile

func CopyFile(src string, dst string) error

func CopyFileToDir

func CopyFileToDir(src string, dstDir string) error

func DoesLocalImageNeedUpdate

func DoesLocalImageNeedUpdate(repository string, tag string) (bool, error)

func GetLocalImageDigest

func GetLocalImageDigest(repository string, tag string) (string, error)

func GetRemoteImageDigest

func GetRemoteImageDigest(repository string, tag string) (string, error)

@todo investigate whether this is achievable with github.com/docker/docker rather than writing our own custom json parsing logic

func HasBopmaticBuildImage

func HasBopmaticBuildImage() (bool, error)

func HasImage

func HasImage(repository string, tag string) (bool, error)

func NewDaprClient

func NewDaprClient(ctx context.Context) (dapr.Client, error)

NewDaprClient instantiates a Dapr client connected to the default dapr port on localhost. This is an alternative to dapr.NewClient() which has a bug that will DoS callers if the server isn't up yet. Additionally this version replaces the default GRPC exponential backoff strategy that defaults to O(1s) delays with a linear backoff strategy with O(10ms) delays. For our use case we're only ever connecting to localhost and don't want to induce unnecessary latency as this can potentially translate into end-user latency when invoked during an AWS Lambda cold start

func RenameFile

func RenameFile(src string, dst string) error

func RenameFileToDir

func RenameFileToDir(src string, dstDir string) error

func RunContainerCommand

func RunContainerCommand(ctx context.Context, cmdAndArgs []string,
	stdOut io.Writer, stdErr io.Writer) error

func RunHostCommand

func RunHostCommand(ctx context.Context, cmdAndArgs []string,
	stdOut io.Writer, stdErr io.Writer) error

func SymlinkFile

func SymlinkFile(src string, dst string) error

func SymlinkFileToDir

func SymlinkFileToDir(src string, dstDir 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