//IsValid checks whether the value is valid or not
IsValid checks whether the value is valid or not
// IsValid checks whether the value is valid or not
func (v *Value) IsValid() bool {
	if v.Error != nil {
		return false
	}
	if v.Time != nil {
		return true
	}
	if v.Type == "value" {
		t, err := time.Parse(time.RFC3339, v.Value)
		if err != nil {
			v.Error = err
			return false
		}
		v.Time = &t
		return true
	}
	if v.Type == "interval" {
		if v.From == nil && v.To == nil {
			return false
		}
		resT, resF := false, false
		if v.From != nil {
			resF = v.From.IsValid()
		}
		if v.To != nil {
			resT = v.To.IsValid()
		}
		return resT || resF
	}
	return false
}
func ( v * Value ) IsValid ( ) bool { if v . Error != nil { return false } if v . Time != nil { return true } if v . Type == " " { t , err := time . Parse ( time . RFC3339 , v . Value ) if err != nil { v . Error = err return false } v . Time = & t return true } if v . Type == " " { if v . From == nil && v . To == nil { return false } resT , resF := false , false if v . From != nil { resF = v . From . IsValid ( ) } if v . To != nil { resT = v . To . IsValid ( ) } return resT || resF } return false }
IsValid checks whether the value is valid or not
IsValid checks whether the value is valid or not
/*
	 * if type is value then will try to do the normal flow
	 * Else if it is interval we will parse from and to if available
	 */