// OutDated checks whether last fetched feed is out dated
550161
func (f FeedMeta) OutDated() bool {
	return !f.Newly() && f.Hash != f.LatestHash
}
949369
func (m Iteration) GetLastModified() time.Time {
	lastModified := m.UpdatedAt // default value
	// also check the optional 'RelationShipsChangedAt' field
	if m.RelationShipsChangedAt != nil && m.RelationShipsChangedAt.After(lastModified) {
		lastModified = *m.RelationShipsChangedAt
	}
	return lastModified

}
56533
func (h *hawkularSink) recent(live *metrics.MetricDefinition, model *metrics.MetricDefinition) bool {
	recent := true
	for k := range model.Tags {
		if v, found := live.Tags[k]; !found {
			// There's a label that wasn't in our stored definition
			live.Tags[k] = v
			recent = false
		}
	}

	return recent
}
240880
func (r Report) IsDeprecated() bool {
	for _, entry := range r.Entries {
		if entry.Kind == EntryDeprecated {
			return true
		}
	}
	return false
}
242208
func (l *lockServer) Expired(args *dsync.LockArgs, reply *bool) error {
	l.mutex.Lock()
	defer l.mutex.Unlock()
	if lri, ok := l.lockMap[args.Resource]; ok {
		// Check whether uid is still active for this name
		for _, entry := range lri {
			if entry.uid == args.UID {
				*reply = false // When uid found, lock is still active so return not expired
				return nil
			}
		}
	}
	// When we get here, lock is no longer active due to either args.Resource being absent from map
	// or uid not found for given args.Resource
	*reply = true
	return nil
}
346546
func (u *Updater) HasUpdate() (bool, string) {
	return u.currentVersion.LessThan(u.latestVersion), u.latestVersion.String()
}
416023
func (batch *UpdateBatch) GetUpdates(ns string) map[string]*VersionedValue {
	nsUpdates, ok := batch.updates[ns]
	if !ok {
		return nil
	}
	return nsUpdates.m
}
59753
func IgnoreExpired(err error) error {
	vErr, ok := err.(*jwt.ValidationError)
	if ok && vErr.Errors == jwt.ValidationErrorExpired {
		return nil
	}
	return err
}
425192
func (a *API) FeedsUpdate(ctx context.Context, request *feed.Request) (storage.Address, error) {
	return a.feed.Update(ctx, request)
}
525858
func (src Versions) Newest() (version.Number, Versions) {
	var result Versions
	var best version.Number
	for _, agent := range src {
		if best.Compare(agent.AgentVersion()) < 0 {
			// Found new best number; reset result list.
			best = agent.AgentVersion()
			result = append(result[:0], agent)
		} else if agent.AgentVersion() == best {
			result = append(result, agent)
		}
	}
	return best, result
}
1276891
func (ad *ArchiveData) Version() (*version.Number, error) {
	meta, err := ad.Metadata()
	if errors.IsNotFound(err) {
		return &legacyVersion, nil
	}
	if err != nil {
		return nil, errors.Trace(err)
	}

	return &meta.Origin.Version, nil
}
619513
func (s Share) IsExpired() bool {
	t := time.Time(s.b.ss.Expires)
	return !t.IsZero() && clockNow().After(t)
}
426648
func (c *Client) versionMismatch(ctx context.Context) (bool, error) {
	const shortRFC3339 = "2006-01-02"
	version := buildinfo.GitInfo
	if version == "" {
		return false, errors.New("unknown client version")
	}
	version = version[:10] // keep only the date part
	clientDate, err := time.Parse(shortRFC3339, version)
	if err != nil {
		return false, fmt.Errorf("could not parse date from version %q: %v", version, err)
	}
	apiChangeDate, _ := time.Parse(shortRFC3339, "2018-01-13")
	if !clientDate.After(apiChangeDate) {
		// client is old enough, all good.
		return false, nil
	}
	url := c.discoRoot() + "/status/status.json"
	req := c.newRequest(ctx, "GET", url)
	res, err := c.doReqGated(req)
	if err != nil {
		return false, err
	}
	if res.StatusCode != 200 {
		body, _ := ioutil.ReadAll(io.LimitReader(res.Body, 1<<20))
		res.Body.Close()
		return false, fmt.Errorf("got status code %d from URL %s; body %s", res.StatusCode, url, body)
	}
	var status struct {
		Version string `json:"version"`
	}
	if err := httputil.DecodeJSON(res, &status); err != nil {
		return false, fmt.Errorf("error parsing JSON from URL %s: %v", url, err)
	}
	serverVersion := status.Version[:10]
	serverDate, err := time.Parse(shortRFC3339, serverVersion)
	if err != nil {
		return false, fmt.Errorf("could not parse date from server version %q: %v", status.Version, err)
	}
	if serverDate.After(apiChangeDate) {
		// server is recent enough, all good.
		return false, nil
	}
	return true, nil
}
281188
func (bk *Backend) isExpired(bv bucketItem) bool {
	if bv.ExpiryTime.IsZero() {
		return false
	}
	return bk.Clock().Now().After(bv.ExpiryTime)
}
894287
func (h *Handle) LastUpdateVersion() uint64 {
	h.mu.Lock()
	defer h.mu.Unlock()
	return h.mu.lastVersion
}
968189
func (exp *ControlleeExpectations) isExpired() bool {
	return clock.RealClock{}.Since(exp.timestamp) > ExpectationsTimeout
}
376247
func (f FeedMeta) StatusForStdout() string {
	if f.Newly() {
		return "Newly"
	} else if f.OutDated() {
		red := color.New(color.FgRed, color.Bold).SprintFunc()
		return red("Out-Dated")
	} else if f.UpToDate() {
		return color.GreenString("Up-to-Date")
	}
	return "Unknown"
}