utils

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyToContainer added in v1.4.0

func CopyToContainer(
	ctx context.Context,
	docker *client.Client,
	cid string,
	file struct {
		Data []byte
		Path string // absolute path inside container, e.g. "/etc/postgresql-custom/postgresql.custom.conf"
	},
) error

CopyToContainer copies a single file's contents into a docker container at file.Path. It creates any missing parent directories with mode 0755 and writes the file as 0644. Ownership will be the container default (usually root:root).

func ExecInContainer

func ExecInContainer(ctx context.Context, docker *client.Client, cid string, cmd []string) (string, error)

ExecInContainer runs "cmd" inside container cid and streams output to stdout/stderr

func Pointer

func Pointer[T any](value T) *T

func RandomString

func RandomString(n int) string

RandomString returns a secure random string of length n.

func ShortStr

func ShortStr(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL