Exemple #1
0
func NewSource(ins *visor.Instance, tail Tailer, pubc chan<- Line) Source {
	s := &source{
		ins:        ins,
		errc:       make(chan error, 1),
		waitc:      make(chan error),
		stopc:      make(chan chan error),
		instanceID: strconv.FormatInt(ins.ID, 10),
		topics: []string{
			ins.ServiceName(),
			ins.RevString(),
			ins.EnvString(),
			ins.RefString(),
		},
	}

	go s.waitStop()
	go s.loop(tail, pubc)

	return s
}