Documentation ¶
Overview ¶
Package builders helps you create struct for your unit test while keeping them expressive.
Index ¶
- func Autolock() func(*swarm.Swarm)
- func Hostname(hostname string) func(*swarm.Node)
- func Leader() func(*swarm.ManagerStatus)
- func Manager(managerStatusBuilders ...func(*swarm.ManagerStatus)) func(*swarm.Node)
- func ManagerStatus(managerStatusBuilders ...func(*swarm.ManagerStatus)) *swarm.ManagerStatus
- func Node(builders ...func(*swarm.Node)) *swarm.Node
- func NodeID(id string) func(*swarm.Node)
- func NodeLabels(labels map[string]string) func(*swarm.Node)
- func NodeName(name string) func(*swarm.Node)
- func PortStatus(portConfigs []swarm.PortConfig) func(*swarm.TaskStatus)
- func Secret(builders ...func(secret *swarm.Secret)) *swarm.Secret
- func SecretCreatedAt(t time.Time) func(*swarm.Secret)
- func SecretID(ID string) func(secret *swarm.Secret)
- func SecretLabels(labels map[string]string) func(secret *swarm.Secret)
- func SecretName(name string) func(secret *swarm.Secret)
- func SecretUpdatedAt(t time.Time) func(*swarm.Secret)
- func SecretVersion(v swarm.Version) func(*swarm.Secret)
- func Service(builders ...func(*swarm.Service)) *swarm.Service
- func ServiceID(id string) func(*swarm.Task)
- func ServiceName(name string) func(*swarm.Service)
- func StatusErr(err string) func(*swarm.TaskStatus)
- func Swarm(swarmBuilders ...func(*swarm.Swarm)) *swarm.Swarm
- func Task(taskBuilders ...func(*swarm.Task)) *swarm.Task
- func TaskID(id string) func(*swarm.Task)
- func TaskSpec(specBuilders ...func(*swarm.TaskSpec)) *swarm.TaskSpec
- func TaskStatus(statusBuilders ...func(*swarm.TaskStatus)) *swarm.TaskStatus
- func Timestamp(t time.Time) func(*swarm.TaskStatus)
- func Volume(builders ...func(volume *types.Volume)) *types.Volume
- func VolumeDriver(name string) func(volume *types.Volume)
- func VolumeLabels(labels map[string]string) func(volume *types.Volume)
- func VolumeName(name string) func(volume *types.Volume)
- func WithStatus(statusBuilders ...func(*swarm.TaskStatus)) func(*swarm.Task)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 NodeLabels ¶
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 Secret ¶
Secret creates a secret with default values. Any number of secret builder functions can be passed to augment it.
func SecretCreatedAt ¶
SecretCreatedAt sets the creation time for the secret
func SecretLabels ¶
SecretLabels sets the secret's labels
func SecretName ¶
SecretName sets the secret's name
func SecretUpdatedAt ¶
SecretUpdatedAt sets the update time for the secret
func SecretVersion ¶
SecretVersion sets the version for the secret
func Service ¶
Service creates a service with default values. Any number of service builder functions can be passed to augment it. Currently, only ServiceName is implemented
func ServiceName ¶
ServiceName sets the service name
func StatusErr ¶
func StatusErr(err string) func(*swarm.TaskStatus)
StatusErr sets the tasks status error
func Swarm ¶
Swarm creates a swarm with default values. Any number of swarm function builder can be pass to augment it.
func Task ¶
Task creates a task with default values . Any number of task function builder can be pass to augment it.
func 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 ¶
Volume creates a volume with default values. Any number of volume function builder can be pass to augment it.
func VolumeDriver ¶
VolumeDriver sets the volume driver
func VolumeLabels ¶
VolumeLabels sets the volume labels
func VolumeName ¶
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.