bitbucket.org/alima123/expires@v0.0.0-20191226173914-cddaf5cffb3d/dataexpires.go (about) 1 package expires 2 3 import ( 4 "time" 5 ) 6 7 type ( 8 DataExpires interface { 9 Data() interface{} 10 Expires 11 } 12 13 dataExpires struct { 14 data interface{} 15 Expires 16 } 17 ) 18 19 func NewDataExpires(data interface{}, dur time.Duration) DataExpires { 20 return &dataExpires{ 21 data: data, 22 Expires: NewExpires(dur), 23 } 24 } 25 26 func (de *dataExpires) Data() interface{} { 27 return de.data 28 }