Пример #1
0
func newForwarder(dialer x.Dialer, dashboards []*shard.Shard, here *shard.Shard, srv *dashboard.DashboardServer) *forwarder {
	return &forwarder{
		dashboards: shard.NewPopulate(dashboards),
		here:       here,
		dialer:     dialer,
		srv:        srv,
	}
}
Пример #2
0
func NewServer(dialer x.Dialer, timelines []*shard.Shard, dbDir string, cacheSize int) (*DashboardServer, error) {
	t := &DashboardServer{
		timelines: shard.NewPopulate(timelines),
		dialer:    dialer,
	}
	if err := t.Server.Init(dbDir, cacheSize); err != nil {
		return nil, err
	}
	return t, nil
}
Пример #3
0
func newForwarder(dialer x.Dialer, timelines []*shard.Shard, here *shard.Shard, srv *timeline.TimelineServer, filter Filter) *forwarder {
	fwd := &forwarder{
		filter:    make(map[int64]struct{}),
		timelines: shard.NewPopulate(timelines),
		here:      here,
		dialer:    dialer,
		srv:       srv,
	}
	for _, id := range filter {
		fwd.filter[id] = struct{}{}
	}
	return fwd
}