func (g *Group) ByName(name string) *Application {
	return g.byName(name)
}
ByName returns an application by its name or nil if no such application
exists. ByName returns a defensive copy of the Application object.
package application
import (
	"github.com/Symantec/scotty"
	"github.com/Symantec/scotty/hostid"
	"github.com/Symantec/scotty/namesandports"
	"time"
)
const (
	HealthAgentName = "health agent"
	HealthAgentPort = 6910
)
type EndpointStats struct {
	LastReadTime time.Time
	PollTime time.Duration
	LastError     error
	LastErrorTime time.Time
	InitialMetricCount uint64
	Down bool
	ChangedMetricsSum   uint64
	ChangedMetricsCount uint64
	Status scotty.Status
}
func (e *EndpointStats) Staleness() time.Duration {
	if e.LastReadTime.IsZero() {
		return 0
	}
	return time.Now().Sub(e.LastReadTime)
}
func (e *EndpointStats) AverageChangedMetrics() float64 {
	if e.ChangedMetricsCount == 0 {
		return 0.0
	}
	return float64(e.ChangedMetricsSum) / float64(e.ChangedMetricsCount)
}
func (e *EndpointStats) LastErrorTimeStr() string {
	return e.LastErrorTime.Format("2006-01-02T15:04:05")
}
type Application struct {
	EP *scotty.Endpoint
	Port uint
	IsTLS bool
	EndpointStats
	Active bool
}
type Group struct {
	host              *hostid.HostID
	apps              map[string]*applicationDataType
	countToInactivate int
}
func NewGroup(host *hostid.HostID, countToInactivate int) (
	*Group, *scotty.Endpoint) {
	return newGroup(host, countToInactivate)
}
func (g *Group) SetApplications(namesAndPorts namesandports.NamesAndPorts) (
	newApps, active, inactive []*scotty.Endpoint) {
	return g.setApplications(namesAndPorts)
}
func (g *Group) Applications() []*Application {
	return g.applications()
}