func parseSflow(config string) bool {
	matched, _ := regexp.MatchString("no sflow", config)
	return !matched
}
parseSflow parses the given config(string) and returns true(bool)
if sflow configured
package module
import (
	"regexp"
	"strconv"
	"strings"
	"github.com/aristanetworks/goeapi"
)
var validInterfaces = map[string]bool{
	"Ethernet":     true,
	"Management":   true,
	"Loopback":     true,
	"Vlan":         true,
	"Port-Channel": true,
	"Vxlan":        true,
}
type InterfaceConfig map[string]string
type BaseInterfaceEntity struct {
	*AbstractBaseEntity
}
func Interface(node *goeapi.Node) *BaseInterfaceEntity {
	return &BaseInterfaceEntity{&AbstractBaseEntity{node}}
}
func isValidInterface(value string) bool {
	var validIntf = regexp.MustCompile(`([EPVLM][a-z-C]+)`)
	match := validIntf.FindString(value)
	if match == "" {
		return false
	}
	_, found := validInterfaces[match]
	return found
}
func (i *BaseInterfaceEntity) Get(name string) InterfaceConfig {
	parent := `interface\s+` + name
	config, _ := i.GetBlock(parent)
	return InterfaceConfig{
		"name":        name,
		"type":        "generic",
		"shutdown":    strconv.FormatBool(i.parseShutdown(config)),
		"description": i.parseDescription(config),
	}
}
func (i *BaseInterfaceEntity) parseShutdown(config string) bool {
	matched, _ := regexp.MatchString(`(?m)no shutdown`, config)
	return !matched
}
func (i *BaseInterfaceEntity) parseDescription(config string) string {
	re := regexp.MustCompile(`(?m)description (.+)$`)
	match := re.FindStringSubmatch(config)
	if match == nil {
		return ""
	}
	return match[1]
}
func (i *BaseInterfaceEntity) Create(name string) bool {
	return i.Configure("interface " + name)
}
func (i *BaseInterfaceEntity) Delete(name string) bool {
	return i.Configure("no interface " + name)
}
func (i *BaseInterfaceEntity) Default(name string) bool {
	return i.Configure("default interface " + name)
}
func (i *BaseInterfaceEntity) SetDescription(name string, value string) bool {
	cmd := i.CommandBuilder("description", value, false, true)
	return i.ConfigureInterface(name, cmd)
}
func (i *BaseInterfaceEntity) SetDescriptionDefault(name string) bool {
	cmd := i.CommandBuilder("description", "", true, false)
	return i.ConfigureInterface(name, cmd)
}
func (i *BaseInterfaceEntity) SetShutdown(name string, shut bool) bool {
	cmd := i.CommandBuilder("shutdown", "", false, shut)
	return i.ConfigureInterface(name, cmd)
}
func (i *BaseInterfaceEntity) SetShutdownDefault(name string) bool {
	cmd := i.CommandBuilder("shutdown", "", true, false)
	return i.ConfigureInterface(name, cmd)
}
type EthernetInterfaceEntity struct {
	*BaseInterfaceEntity
}
func EthernetInterface(node *goeapi.Node) *EthernetInterfaceEntity {
	return &EthernetInterfaceEntity{&BaseInterfaceEntity{&AbstractBaseEntity{node}}}
}
func (e *EthernetInterfaceEntity) Get(name string) InterfaceConfig {
	parent := `interface\s+` + name
	config, _ := e.GetBlock(parent)
	resource := e.BaseInterfaceEntity.Get(name)
	resource["type"] = "ethernet"
	resource["sflow"] = strconv.FormatBool(parseSflow(config))
	resource["flowcontrol_send"] = parseFlowControlSend(config)
	resource["flowcontrol_receive"] = parseFlowControlReceive(config)
	return resource
}