func SampleConfig() {
	c := &Config{
		RemotePeers: []RaftPeer{
			{
				ID:      "server2",
				Address: "192.168.0.2",
				Port:    10000,
			},
			{
				ID:      "server3",
				Address: "192.168.0.3",
				Port:    10000,
			},
		},
		LocalPeer: RaftPeer{
			ID:      "server1",
			Address: "192.168.0.1",
			Port:    10000,
		},
		VIP: "192.168.0.100",
		Interface: "eth0",
		LoadBalancers: []LoadBalancer{
			{
				Name:      "Kubernetes Control Plane",
				Type:      "http",
				Port:      6443,
				BindToVip: true,
				Backends: []BackEnd{
					{
						Address: "192.168.0.100",
						Port:    6443,
					},
					{
						Address: "192.168.0.101",
						Port:    6443,
					},
					{
						Address: "192.168.0.102",
						Port:    6443,
					},
				},
			},
		},
	}
	b, _ := yaml.Marshal(c)
	fmt.Print(string(b))
}
SampleConfig will create an example configuration and write it to the specified [path]
package kubevip
import (
	"fmt"
	"io/ioutil"
	"os"
	"strconv"
	"strings"
	"github.com/ghodss/yaml"
	log "github.com/sirupsen/logrus"
)
var endPointIndex int  
func ParseBackendConfig(ep string) (*BackEnd, error) {
	endpoint := strings.Split(ep, ":")
	if len(endpoint) != 2 {
		return nil, fmt.Errorf("Ensure a backend is in in the format address:port, e.g. 10.0.0.1:8080")
	}
	p, err := strconv.Atoi(endpoint[1])
	if err != nil {
		return nil, err
	}
	return &BackEnd{Address: endpoint[0], Port: p}, nil
}
func ParsePeerConfig(ep string) (*RaftPeer, error) {
	endpoint := strings.Split(ep, ":")
	if len(endpoint) != 3 {
		return nil, fmt.Errorf("Ensure a peer is in in the format id:address:port, e.g. server1:10.0.0.1:8080")
	}
	p, err := strconv.Atoi(endpoint[2])
	if err != nil {
		return nil, err
	}
	return &RaftPeer{ID: endpoint[0], Address: endpoint[1], Port: p}, nil
}
func OpenConfig(path string) (*Config, error) {
	if path == "" {
		return nil, fmt.Errorf("Path cannot be blank")
	}
	log.Infof("Reading configuration from [%s]", path)
	if _, err := os.Stat(path); !os.IsNotExist(err) {
		configData, err := ioutil.ReadFile(path)
		if err != nil {
			return nil, err
		}
		var c Config
		err = yaml.Unmarshal(configData, &c)
		if err != nil {
			return nil, err
		}
		return &c, nil
	}
	return nil, fmt.Errorf("Error reading [%s]", path)
}
func (c *Config) PrintConfig() {
	b, _ := yaml.Marshal(c)
	fmt.Print(string(b))
}
func (c *Config) ParseFlags(localPeer string, remotePeers, backends []string) error {
	p, err := ParsePeerConfig(localPeer)
	if err != nil {
		return err
	}
	c.LocalPeer = *p
	for i := range remotePeers {
		p, err := ParsePeerConfig(remotePeers[i])
		if err != nil {
			return err
		}
		c.RemotePeers = append(c.RemotePeers, *p)
	}
	for i := range backends {
		b, err := ParseBackendConfig(backends[i])
		if err != nil {
			return err
		}
		c.LoadBalancers[0].Backends = append(c.LoadBalancers[0].Backends, *b)
	}
	return nil
}