openstack-operator/builders/mcrouter_pool_spec.go
okozachenko 491c48ab7d mcrouter builder to merge CR labels
Change-Id: I03898d3a759bfd73a7adeefc7ea89c8252c73633
2020-04-08 09:07:42 -07:00

32 lines
872 B
Go

package builders
import (
infrastructurev1alpha1 "opendev.org/vexxhost/openstack-operator/api/v1alpha1"
)
// McrouterPoolSpecBuilder defines the interface to build a McrouterPoolSpec
type McrouterPoolSpecBuilder struct {
obj *infrastructurev1alpha1.McrouterPoolSpec
}
// McrouterPoolSpec returns a new mcrouterPoolSpec builder
func McrouterPoolSpec() *McrouterPoolSpecBuilder {
poolSpec := &infrastructurev1alpha1.McrouterPoolSpec{
Servers: []string{},
}
return &McrouterPoolSpecBuilder{
obj: poolSpec,
}
}
// Servers specifies servers for the McrouterPoolSpec
func (ps *McrouterPoolSpecBuilder) Servers(servers []string) *McrouterPoolSpecBuilder {
ps.obj.Servers = servers
return ps
}
// Build returns a complete McrouterPoolSpec object
func (ps *McrouterPoolSpecBuilder) Build() (infrastructurev1alpha1.McrouterPoolSpec, error) {
return *ps.obj, nil
}