util

package
v0.0.0-...-60f4931 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeTestDirectory

func MakeTestDirectory(files map[string]string) (string, error)

func Run

func Run(ctx context.Context, command ...string) ([]byte, error)

Run runs the given Blimp command, and returns its stdout.

func Start

func Start(ctx context.Context, args ...string) (io.Reader, chan error, error)

Start starts the given Blimp command. It returns a thread-safe reader for the stdout output, and a channel for obtaining any errors after starting the command, and any errors from starting the command.

func TestWithRetry

func TestWithRetry(ctx context.Context, trigger chan struct{}, test func() bool) bool

func Up

func Up(ctx context.Context, args ...string) (chan error, error)

Up runs `blimp up` with the given arguments, and waits until the development environment is ready for use.

Types

type ReadResult

type ReadResult struct {
	Bytes []byte
	Error error
}

type StreamReader

type StreamReader struct {
	// contains filtered or unexported fields
}

StreamReader provides convenience methods for reading from io streams.

func NewStreamReader

func NewStreamReader(stream io.Reader) StreamReader

NewStreamReader returns a new StreamReader

func (StreamReader) Read

func (sr StreamReader) Read(ctx context.Context) chan ReadResult

Read reads from the stream and sends the result on the channel.

func (StreamReader) ReadUntilTimeout

func (sr StreamReader) ReadUntilTimeout(ctx context.Context, timeout time.Duration) ([]byte, error)

ReadUntilTimeout reads from the stream until nothing new has been written in `timeout`.

Jump to

Keyboard shortcuts

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