From 42431954e236e3ed56edf8460b839b4c9b28edec Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sat, 23 Mar 2019 20:43:22 +0100 Subject: [PATCH] Move getTimeline to memory.go --- cmd/eksterd/memory.go | 16 ++++++++++++++++ cmd/eksterd/timeline.go | 20 -------------------- 2 files changed, 16 insertions(+), 20 deletions(-) delete mode 100644 cmd/eksterd/timeline.go diff --git a/cmd/eksterd/memory.go b/cmd/eksterd/memory.go index a3253fc..5d1e1fb 100644 --- a/cmd/eksterd/memory.go +++ b/cmd/eksterd/memory.go @@ -19,6 +19,7 @@ import ( "p83.nl/go/ekster/pkg/fetch" "p83.nl/go/ekster/pkg/microsub" "p83.nl/go/ekster/pkg/server" + "p83.nl/go/ekster/pkg/timeline" "p83.nl/go/ekster/pkg/util" "github.com/gomodule/redigo/redis" @@ -725,6 +726,21 @@ func Fetch2(fetchURL string) (*http.Response, error) { return resp, err } +func (b *memoryBackend) getTimeline(channel string) timeline.Backend { + timelineType := "sorted-set" + if channel == "notifications" { + timelineType = "stream" + } else { + if setting, ok := b.Settings[channel]; ok { + if setting.ChannelType != "" { + timelineType = setting.ChannelType + } + } + } + + return timeline.Create(channel, timelineType, b.pool) +} + func (b *memoryBackend) createChannel(name string) microsub.Channel { uid := fmt.Sprintf("%012d", b.NextUID) channel := microsub.Channel{ diff --git a/cmd/eksterd/timeline.go b/cmd/eksterd/timeline.go deleted file mode 100644 index 5e0888a..0000000 --- a/cmd/eksterd/timeline.go +++ /dev/null @@ -1,20 +0,0 @@ -package main - -import ( - "p83.nl/go/ekster/pkg/timeline" -) - -func (b *memoryBackend) getTimeline(channel string) timeline.Backend { - timelineType := "sorted-set" - if channel == "notifications" { - timelineType = "stream" - } else { - if setting, ok := b.Settings[channel]; ok { - if setting.ChannelType != "" { - timelineType = setting.ChannelType - } - } - } - - return timeline.Create(channel, timelineType, b.pool) -}