carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package rootstate
2
3import "os"
4
5type liveStore interface {
6 HoldLive(string) (func(), error)
7 LiveHeld(string) (bool, error)
8}
9
10func HoldLive(s Store, name string) (func(), error) {
11 if s, ok := s.(liveStore); ok {
12 return s.HoldLive(name)
13 }
14 return nil, os.ErrPermission
15}
16
17func LiveHeld(s Store, name string) (bool, error) {
18 if s, ok := s.(liveStore); ok {
19 return s.LiveHeld(name)
20 }
21 return false, os.ErrPermission
22}
23