carlos / platform Public

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

Plain git — no account needed to clone.

Download

Download this file

1package hostguard
2
3import "context"
4
5// WithLocal holds the existing host lock for local bookkeeping or cleanup.
6// It grants no claim, installation, spawn or write authority. Ordinary host
7// work must still use With. The callback must not wait on a network request.
8func (g Guard) WithLocal(ctx context.Context, host string, fn func() error) error {
9 if fn == nil {
10 return ErrInvalidInput
11 }
12 return g.locked(ctx, host, func(_ *recordDir) error { return fn() })
13}
14