package hostwrite import "context" // Selection carries the original work and rendered inputs across a callback. // The receiver uses With at its final local effect, never a new hostname lookup. // Network waits belong outside With; remote effects need a provider that binds // the request to this selection and refuses a successor at publication. type Selection struct { Host string Work Work Identity Identity } func (s Selection) With(ctx context.Context, effect func() error) error { if ctx == nil || s.Host == "" || s.Work == nil || effect == nil { return ErrUnavailable } return s.Work.With(ctx, s.Identity, effect) } type Callback func(context.Context, Selection) error