dockergen

package
v0.0.0-...-1e4e419 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContainerFilters

func WithContainerFilters(filters ...string) tc.CustomizeRequestOption

WithContainerFilters sets the DOCKER_CONTAINER_FILTERS environment variable in the container to the given filters.

func WithCustomTemplate

func WithCustomTemplate(templatePath string) tc.CustomizeRequestOption

WithCustomTemplate mounts a custom template file at /etc/docker-gen/templates/test.tmpl in the container.

The templatePath must be an absolute or relative path to the template file on the host.

func WithDockerSocketBind

func WithDockerSocketBind(dockerSocketPath string) tc.CustomizeRequestOption

WithDockerSocketBind mounts the Docker socket from the host into the container at /tmp/docker.sock (read-only).

The dockerSocketPath must be an absolute path to the Docker socket on the host.

Types

type Container

type Container struct {
	tc.Container
}

Container represents the docker-gen container type.

func Run

func Run(ctx context.Context, img string, opts ...tc.ContainerCustomizer) (*Container, error)

Run creates an instance of the docker-gen container type.

func (*Container) RenderedTemplate

func (c *Container) RenderedTemplate(ctx context.Context) ([]byte, error)

RenderedTemplate returns the content of the rendered template file from the container.

func (*Container) UnmarshalRenderedTemplate

func (c *Container) UnmarshalRenderedTemplate(ctx context.Context, pointer any) error

UnmarshalRenderedTemplate unmarshals (as JSON) the content of the rendered template file from the container into the provided pointer.

Jump to

Keyboard shortcuts

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