MCPcopy Create free account
hub / github.com/AdRoll/baker / NewTimestamp

Function NewTimestamp

filter/timestamp.go:31–40  ·  view source on GitHub ↗

NewTimestamp creates and configures a Timestamp filter.

(cfg baker.FilterParams)

Source from the content-addressed store, hash-verified

29
30// NewTimestamp creates and configures a Timestamp filter.
31func NewTimestamp(cfg baker.FilterParams) (baker.Filter, error) {
32 dcfg := cfg.DecodedConfig.(*TimestampConfig)
33
34 fidx, ok := cfg.FieldByName(dcfg.Field)
35 if !ok {
36 return nil, fmt.Errorf("unknown field %q", dcfg.Field)
37 }
38
39 return &Timestamp{fidx: fidx}, nil
40}
41
42// Stats implements baker.Filter.
43func (f *Timestamp) Stats() baker.FilterStats {

Callers 1

TestTimestampFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestTimestampFunction · 0.68