Module: Textus::Lanes::Artifact::Handlers

Defined in:
lib/textus/lanes/artifact/handlers.rb

Class Method Summary collapse

Class Method Details

.get(key:, store:, ctx:, call:) ⇒ Object



7
8
9
# File 'lib/textus/lanes/artifact/handlers.rb', line 7

def get(key:, store:, ctx:, call:)
  store.get(key:)
end

.list(store:, ctx:, call:, prefix: nil) ⇒ Object



11
12
13
# File 'lib/textus/lanes/artifact/handlers.rb', line 11

def list(store:, ctx:, call:, prefix: nil)
  store.list(prefix: prefix || "artifact")
end

.refresh(key:, store:, ctx:, call:) ⇒ Object



22
23
24
25
# File 'lib/textus/lanes/artifact/handlers.rb', line 22

def refresh(key:, store:, ctx:, call:)
  cache = Cache.new(store)
  cache.expire(key)
end

.status(store:, ctx:, call:) ⇒ Object



15
16
17
18
19
20
# File 'lib/textus/lanes/artifact/handlers.rb', line 15

def status(store:, ctx:, call:)
  store.list(prefix: "artifact").map do |row|
    cache = Cache.new(store)
    { key: row[:key], stale: cache.stale?(row[:key]) }
  end
end