| 85 | } |
| 86 | |
| 87 | func (h *hooks) setDefaults() { |
| 88 | if h.dial == nil { |
| 89 | h.dial = func(ctx context.Context, network, addr string) (net.Conn, error) { return nil, nil } |
| 90 | } |
| 91 | if h.process == nil { |
| 92 | h.process = func(ctx context.Context, cmd Cmder) error { return nil } |
| 93 | } |
| 94 | if h.pipeline == nil { |
| 95 | h.pipeline = func(ctx context.Context, cmds []Cmder) error { return nil } |
| 96 | } |
| 97 | if h.txPipeline == nil { |
| 98 | h.txPipeline = func(ctx context.Context, cmds []Cmder) error { return nil } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | // AddHook is to add a hook to the queue. |
| 103 | // Hook is a function executed during network connection, command execution, and pipeline, |