From 89a22450e5f6bc5fb849654207b3cda035e23265 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 16 Feb 2021 20:32:46 +0300 Subject: [PATCH] [#378] shard: Define new epoch event Signed-off-by: Leonard Lyubich --- pkg/local_object_storage/shard/gc.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/local_object_storage/shard/gc.go b/pkg/local_object_storage/shard/gc.go index 3af5db40c..dc5cc31e1 100644 --- a/pkg/local_object_storage/shard/gc.go +++ b/pkg/local_object_storage/shard/gc.go @@ -21,8 +21,24 @@ type eventType int const ( _ eventType = iota + eventNewEpoch ) +type newEpoch struct { + epoch uint64 +} + +func (e newEpoch) typ() eventType { + return eventNewEpoch +} + +// EventNewEpoch returns new epoch event. +func EventNewEpoch(e uint64) Event { + return newEpoch{ + epoch: e, + } +} + type eventHandler func(context.Context, Event) type eventHandlers struct {