boxutil

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 2 Imported by: 6

Documentation

Overview

Package boxutil provides some helpful utilities for consuming Machine Box services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReady

func IsReady(status string) bool

IsReady gets whether the box info status is ready or not.

func StatusChan

func StatusChan(ctx context.Context, i Box) <-chan string

StatusChan gets a channel that periodically gets the box info and sends a message whenever the status changes.

func WaitForReady

func WaitForReady(ctx context.Context, i Box) error

WaitForReady blocks until the Box is ready.

Types

type Box

type Box interface {
	Info() (*Info, error)
}

Box represents a box client capable of returning Info.

type Info

type Info struct {
	Name    string
	Version int
	Build   string
	Status  string
}

Info describes box information.

Jump to

Keyboard shortcuts

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