docker: github.com/docker/docker/testutil/fakecontext Index | Files

package fakecontext

import "github.com/docker/docker/testutil/fakecontext"

Index

Package Files

context.go

func WithBinaryFiles Uses

func WithBinaryFiles(files map[string]*bytes.Buffer) func(*Fake) error

WithBinaryFiles adds the specified files in the build context, content is binary

func WithDockerfile Uses

func WithDockerfile(content string) func(*Fake) error

WithDockerfile adds the specified content as Dockerfile in the build context

func WithFile Uses

func WithFile(name, content string) func(*Fake) error

WithFile adds the specified file (with content) in the build context

func WithFiles Uses

func WithFiles(files map[string]string) func(*Fake) error

WithFiles adds the specified files in the build context, content is a string

type Fake Uses

type Fake struct {
    Dir string
}

Fake creates directories that can be used as a build context

func New Uses

func New(t testing.TB, dir string, modifiers ...func(*Fake) error) *Fake

New creates a fake build context

func (*Fake) Add Uses

func (f *Fake) Add(file, content string) error

Add a file at a path, creating directories where necessary

func (*Fake) AsTarReader Uses

func (f *Fake) AsTarReader(t testing.TB) io.ReadCloser

AsTarReader returns a ReadCloser with the contents of Dir as a tar archive.

func (*Fake) Close Uses

func (f *Fake) Close() error

Close deletes the context

func (*Fake) Delete Uses

func (f *Fake) Delete(file string) error

Delete a file at a path

Package fakecontext imports 7 packages (graph) and is imported by 3 packages. Updated 2019-10-16. Refresh now. Tools for package owners.