github.com/prebid/prebid-server@v0.275.0/adapters/consumable/instant.go (about)

     1  package consumable
     2  
     3  import "time"
     4  
     5  type instant interface {
     6  	Now() time.Time
     7  }
     8  
     9  // Send a real instance when you construct it in adapter_map.go
    10  type realInstant struct{}
    11  
    12  func (realInstant) Now() time.Time {
    13  	return time.Now()
    14  }
    15  
    16  // Use this for tests e.g. knownInstant(time.Date(y, m, ..., time.UTC))
    17  type knownInstant time.Time
    18  
    19  func (i knownInstant) Now() time.Time {
    20  	return time.Time(i)
    21  }