compose

package module
v0.0.0-...-0458b32 Latest Latest
Warning

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

Go to latest
Published: May 29, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

README

Libkermit

GoDoc Build Status Go Report Card License

When libkermit/compose meet with go-check.

Note: This is experimental and not even implemented yet. You are on your own right now

Package compose

This package map the compose package but takes a *check.C struct on all methods. The idea is to write even less. Let's write the same example as above.

package yours

import (
    "testing"

	"github.com/go-check/check"
    "github.com/libkermit/compose-check"
)

// Hook up gocheck into the "go test" runner
func Test(t *testing.T) { check.TestingT(t) }

type CheckSuite struct{}

var _ = check.Suite(&CheckSuite{})

func (s *CheckSuite) TestItMyFriend(c *check.C) {
    project := compose.CreateProject(c, "simple", "./assets/simple.yml")
    project.Start(c)

    // Do your stuff

    project.Stop(c)
}

Other packages to come

  • suite : functions and structs to setup tests suites.

Documentation

Overview

Package compose aims to provide simple "helper" methods to ease the use of compose (through libcompose) in (integration) tests using the go-check package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

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

Project holds compose related project attributes

func CreateProject

func CreateProject(c *check.C, name string, composeFiles ...string) *Project

CreateProject creates a compose project with the given name based on the specified compose files

func (*Project) Container

func (p *Project) Container(c *check.C, service string) types.ContainerJSON

Container return the one and only container for a given services. It fails if there is more than one container for the service.

func (*Project) Containers

func (p *Project) Containers(c *check.C, service string) []types.ContainerJSON

Containers lists containers for a given services.

func (*Project) Scale

func (p *Project) Scale(c *check.C, service string, count int)

Scale scale a service up

func (*Project) Start

func (p *Project) Start(c *check.C)

Start creates and starts the compose project.

func (*Project) Stop

func (p *Project) Stop(c *check.C)

Stop shuts down and clean the project

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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