func (e *Engine) SetTimeManager(manager TimeManager) func(*Engine) {
	return func(engine *Engine) {
		engine.timeManager = manager
	}
}
SetTimeManager is a configuration function for `NewEngine` which sets the
Engine's TimeManager instance to the `manager` argument.
package updates
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"time"
	"github.com/blang/semver"
	"github.com/manifoldco/torus-cli/config"
)
const (
	releaseHourCheck = 6  
)
var (
	timeLayout       = time.RFC3339
	releaseDay       = time.Wednesday
	minCheckDuration = time.Second
)
type TimeManager interface {
	Now() time.Time
}
type defaultTimeManager struct{}
func (m defaultTimeManager) Now() time.Time {
	return time.Now().UTC()
}
type Engine struct {
	config        *config.Config
	stop          chan struct{}
	lastCheck     time.Time
	targetVersion string
	timeManager   TimeManager
	client        *http.Client
}
type VersionInfo struct {
	Version  string `json:"version"`
	Released string `json:"released"`
}
func NewEngine(cfg *config.Config, t *http.Transport, options ...func(*Engine)) *Engine {
	engine := &Engine{
		config:        cfg,
		stop:          make(chan struct{}),
		targetVersion: "unknown",
		client:        &http.Client{Transport: t},
	}
	for _, opt := range options {
		opt(engine)
	}
	if engine.timeManager == nil {
		engine.timeManager = defaultTimeManager{}
	}
	return engine
}
func (e *Engine) Start() error {
	return nil
}
func (e *Engine) Stop() error {
	close(e.stop)
	return nil
}
func (e *Engine) VersionInfo() (bool, string) {
	return e.needsUpdate(), e.targetVersion
}