builders

package
v1.4.2-0...-705e031 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package builders helps you create struct for your unit test while keeping them expressive.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Autolock

func Autolock() func(*swarm.Swarm)

Autolock set the swarm into autolock mode

func Hostname

func Hostname(hostname string) func(*swarm.Node)

Hostname sets the node hostname

func Leader

func Leader() func(*swarm.ManagerStatus)

Leader sets the current node as a leader

func Manager

func Manager(managerStatusBuilders ...func(*swarm.ManagerStatus)) func(*swarm.Node)

Manager set the current node as a manager

func ManagerStatus

func ManagerStatus(managerStatusBuilders ...func(*swarm.ManagerStatus)) *swarm.ManagerStatus

ManagerStatus create a ManageStatus with default values.

func Node

func Node(builders ...func(*swarm.Node)) *swarm.Node

Node creates a node with default values. Any number of node function builder can be pass to augment it.

n1 := Node() // Returns a default node
n2 := Node(NodeID("foo"), NodeHostname("bar"), Leader())

func NodeID

func NodeID(id string) func(*swarm.Node)

NodeID sets the node id

func NodeLabels

func NodeLabels(labels map[string]string) func(*swarm.Node)

NodeLabels sets the node labels

func PortStatus

func PortStatus(portConfigs []swarm.PortConfig) func(*swarm.TaskStatus)

PortStatus sets the tasks port config status FIXME(vdemeester) should be a sub builder 👼

func ServiceID

func ServiceID(id string) func(*swarm.Task)

ServiceID sets the task service's ID

func StatusErr

func StatusErr(err string) func(*swarm.TaskStatus)

StatusErr sets the tasks status error

func Swarm

func Swarm(swarmBuilders ...func(*swarm.Swarm)) *swarm.Swarm

Swarm creates a swarm with default values. Any number of swarm function builder can be pass to augment it.

func Task

func Task(taskBuilders ...func(*swarm.Task)) *swarm.Task

Task creates a task with default values . Any number of task function builder can be pass to augment it.

func TaskID

func TaskID(id string) func(*swarm.Task)

TaskID sets the task ID

func TaskSpec

func TaskSpec(specBuilders ...func(*swarm.TaskSpec)) *swarm.TaskSpec

TaskSpec creates a task spec with default values . Any number of taskSpec function builder can be pass to augment it.

func TaskStatus

func TaskStatus(statusBuilders ...func(*swarm.TaskStatus)) *swarm.TaskStatus

TaskStatus creates a task status with default values . Any number of taskStatus function builder can be pass to augment it.

func Timestamp

func Timestamp(t time.Time) func(*swarm.TaskStatus)

Timestamp sets the task status timestamp

func Volume

func Volume(builders ...func(volume *types.Volume)) *types.Volume

Volume creates a volume with default values. Any number of volume function builder can be pass to augment it.

func VolumeDriver

func VolumeDriver(name string) func(volume *types.Volume)

VolumeDriver sets the volume driver

func VolumeLabels

func VolumeLabels(labels map[string]string) func(volume *types.Volume)

VolumeLabels sets the volume labels

func VolumeName

func VolumeName(name string) func(volume *types.Volume)

VolumeName sets the volume labels

func WithStatus

func WithStatus(statusBuilders ...func(*swarm.TaskStatus)) func(*swarm.Task)

WithStatus sets the task status

Types

This section is empty.

Jump to

Keyboard shortcuts

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