// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
345758
func (g *Grant) GetUpdatedAt() Timestamp {
	if g == nil || g.UpdatedAt == nil {
		return Timestamp{}
	}
	return *g.UpdatedAt
}
1329692
func (m User) GetETagData() []interface{} {
	// using the 'ID' and 'UpdatedAt' (converted to number of seconds since epoch) fields
	return []interface{}{m.ID, strconv.FormatInt(m.UpdatedAt.Unix(), 10)}
}
555454
func (s *Deployment) SetUpdatedAt(v time.Time) *Deployment {
	s.UpdatedAt = &v
	return s
}
709802
func (m ExternalToken) GetETagData() []interface{} {
	// using the 'ID' and 'UpdatedAt' (converted to number of seconds since epoch) fields
	return []interface{}{m.ID, strconv.FormatInt(m.UpdatedAt.Unix(), 10)}
}
583141
func (g *Gist) GetUpdatedAt() time.Time {
	if g == nil || g.UpdatedAt == nil {
		return time.Time{}
	}
	return *g.UpdatedAt
}
1334525
func (u *Updater) NeedUpdate(ctx Context) (upToDate bool, err error) {
	update, err := u.checkForUpdate(ctx, ctx.UpdateOptions())
	if err != nil {
		return false, err
	}
	return update.NeedUpdate, nil
}
1017510
func (s *Finding) SetUpdatedAt(v string) *Finding {
	s.UpdatedAt = &v
	return s
}
992960
func (p *PagesBuild) GetUpdatedAt() Timestamp {
	if p == nil || p.UpdatedAt == nil {
		return Timestamp{}
	}
	return *p.UpdatedAt
}
1024917
func (s *PlatformDescription) SetDateUpdated(v time.Time) *PlatformDescription {
	s.DateUpdated = &v
	return s
}
47333
func (u *User) GetUpdatedAt() Timestamp {
	if u == nil || u.UpdatedAt == nil {
		return Timestamp{}
	}
	return *u.UpdatedAt
}
196182
func (k LocalUpdateSource) FindUpdate(options updater.UpdateOptions) (*updater.Update, error) {
	jsonFile, err := os.Open(k.jsonPath)
	defer util.Close(jsonFile)
	if err != nil {
		return nil, err
	}

	var update updater.Update
	if err := json.NewDecoder(jsonFile).Decode(&update); err != nil {
		return nil, fmt.Errorf("Invalid update JSON: %s", err)
	}

	update.Asset.URL = fmt.Sprintf("file://%s", k.path)
	// TODO: Only do if version is newer or forced (this source is used for testing, so ok to hardcode NeedUpdate)
	update.NeedUpdate = true
	k.log.Debugf("Returning update: %#v", update)
	return &update, nil
}
1191112
func (s *AwsSecurityFinding) SetUpdatedAt(v string) *AwsSecurityFinding {
	s.UpdatedAt = &v
	return s
}
917443
func (p *Packet) GetUDPData() []byte {
	return p.ipHdr.Buffer[p.ipHdr.ipHeaderLen+UDPDataPos:]
}
1251864
func (s *Note) SetUpdatedAt(v string) *Note {
	s.UpdatedAt = &v
	return s
}
1143678
func GetNeedUpdate() (bool, error) {
	updaterPath, err := UpdaterBinPath()
	if err != nil {
		return false, err
	}
	cmd := exec.Command(updaterPath, "need-update")
	out, err := cmd.Output()
	if err != nil {
		return false, err
	}
	needUpdate, err := strconv.ParseBool(strings.TrimSpace(string(out)))
	if err != nil {
		return false, err
	}
	return needUpdate, nil
}
268697
func (q Query) GetETagData() []interface{} {
	return []interface{}{q.ID, strconv.FormatInt(q.UpdatedAt.Unix(), 10)}
}
1155154
func (r *RTTStats) UpdateRTT(sendDelta, ackDelay time.Duration, now time.Time) {
	if sendDelta == utils.InfDuration || sendDelta <= 0 {
		return
	}

	// Update r.minRTT first. r.minRTT does not use an rttSample corrected for
	// ackDelay but the raw observed sendDelta, since poor clock granularity at
	// the client may cause a high ackDelay to result in underestimation of the
	// r.minRTT.
	if r.minRTT == 0 || r.minRTT > sendDelta {
		r.minRTT = sendDelta
	}

	// Correct for ackDelay if information received from the peer results in a
	// an RTT sample at least as large as minRTT. Otherwise, only use the
	// sendDelta.
	sample := sendDelta
	if sample-r.minRTT >= ackDelay {
		sample -= ackDelay
	}
	r.latestRTT = sample
	// First time call.
	if r.smoothedRTT == 0 {
		r.smoothedRTT = sample
		r.meanDeviation = sample / 2
	} else {
		r.meanDeviation = time.Duration(oneMinusBeta*float32(r.meanDeviation/time.Microsecond)+rttBeta*float32(utils.AbsDuration(r.smoothedRTT-sample)/time.Microsecond)) * time.Microsecond
		r.smoothedRTT = time.Duration((float32(r.smoothedRTT/time.Microsecond)*oneMinusAlpha)+(float32(sample/time.Microsecond)*rttAlpha)) * time.Microsecond
	}
}