package main import ( "context" "fmt" "github.com/rs/zerolog/log" "time" //"github.com/bitly/go-simplejson" ) type InstanceHostName string type Archiver struct { locator *InstanceLocator instances map[InstanceHostName]*Instance startup *time.Time ctx context.Context } func NewArchiver(ctx context.Context) *Archiver { a := new(Archiver) a.ctx = ctx return a } func (a *Archiver) Uptime() time.Duration { return time.Since(*a.startup) } func (a *Archiver) Run() int { t := time.Now() a.startup = &t a.locator = NewInstanceLocator() log.Info().Msg(fmt.Sprintf("in %#v.Run()", a)) go a.locator.Locate() for { time.Sleep(1 * time.Second) } return 0 }