github.com/tickstep/library-go@v0.1.1/expires/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  }