func (o *QueryOp) SetCallback(f QueryCallbackFunc) error {
	o.m.Lock()
	defer o.m.Unlock()
	if o.started {
		return ErrStarted
	}
	o.callback = f
	return nil
}
SetCallback sets the function to call when an error occurs or a record is added or removed.
package dnssd
import "unsafe"
type QueryCallbackFunc func(op *QueryOp, err error, add bool, interfaceIndex int, fullname string, rrtype, rrclass uint16, rdata []byte, ttl uint32)
type QueryOp struct {
	baseOp
	name            string
	rrtype, rrclass uint16
	callback        QueryCallbackFunc
}
func NewQueryOp(interfaceIndex int, name string, rrtype, rrclass uint16, f QueryCallbackFunc) *QueryOp {
	op := &QueryOp{}
	op.SetInterfaceIndex(interfaceIndex)
	op.SetName(name)
	op.SetType(rrtype)
	op.SetClass(rrclass)
	op.SetCallback(f)
	return op
}
func StartQueryOp(interfaceIndex int, name string, rrtype, rrclass uint16, f QueryCallbackFunc) (*QueryOp, error) {
	op := NewQueryOp(interfaceIndex, name, rrtype, rrclass, f)
	return op, op.Start()
}
func (o *QueryOp) Name() string {
	o.m.Lock()
	defer o.m.Unlock()
	return o.name
}
func (o *QueryOp) SetName(n string) error {
	o.m.Lock()
	defer o.m.Unlock()
	if o.started {
		return ErrStarted
	}
	o.name = n
	return nil
}
func (o *QueryOp) Type() uint16 {
	o.m.Lock()
	defer o.m.Unlock()
	return o.rrtype
}
func (o *QueryOp) SetType(t uint16) error {
	o.m.Lock()
	defer o.m.Unlock()
	if o.started {
		return ErrStarted
	}
	o.rrtype = t
	return nil
}
func (o *QueryOp) Class() uint16 {
	o.m.Lock()
	defer o.m.Unlock()
	return o.rrclass
}
func (o *QueryOp) SetClass(c uint16) error {
	o.m.Lock()
	defer o.m.Unlock()
	if o.started {
		return ErrStarted
	}
	o.rrclass = c
	return nil
}