package hostbox import ( "context" "github.com/carlosframework/platform/internal/hostwrite" "github.com/carlosframework/platform/internal/registry" ) func RegistryHoldPolicy(reg *registry.Registry) func(context.Context, string) (string, error) { return func(ctx context.Context, host string) (string, error) { if ctx == nil || reg == nil { return "", ErrUnsupported } if err := ctx.Err(); err != nil { return "", err } rt, err := reg.Get(host) if err != nil { return "", err } if rt == nil { return "", nil } return rt.HoldOp, nil } } func Selected(work hostwrite.Work) (Selection, error) { w, ok := work.(selectedWork) if !ok { return Selection{}, ErrUnsupported } return w.selection, nil }